summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsr55 <[email protected]>2009-07-15 13:47:20 +0000
committersr55 <[email protected]>2009-07-15 13:47:20 +0000
commit10842fdfd29f934d72c00ec4ff998f187111ba8a (patch)
tree802d2a806d910aba6e88b882b2e4936dee7e79fc
parent742df70f4ae59aba07e2b094c2f9f4a9efc01a7c (diff)
WinGui:
- Experimental MacGUI preset import. (Single preset export only) git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2694 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--win/C#/Functions/QueryParser.cs133
-rw-r--r--win/C#/HandBrakeCS.csproj1
-rw-r--r--win/C#/Presets/Import.cs264
-rw-r--r--win/C#/frmMain.Designer.cs150
-rw-r--r--win/C#/frmMain.cs10
-rw-r--r--win/C#/frmMain.resx35
6 files changed, 445 insertions, 148 deletions
diff --git a/win/C#/Functions/QueryParser.cs b/win/C#/Functions/QueryParser.cs
index 0b7c2a395..3d294405e 100644
--- a/win/C#/Functions/QueryParser.cs
+++ b/win/C#/Functions/QueryParser.cs
@@ -18,70 +18,71 @@ namespace Handbrake.Functions
#region Varibles
- #region Source
- public int DVDTitle { get; private set; }
- public int DVDChapterStart { get; private set; }
- public int DVDChapterFinish { get; private set; }
- #endregion
-
- #region Output Settings
- public string Format { get; private set; }
- public Boolean LargeMP4 { get; private set; }
- public Boolean IpodAtom { get; private set; }
- public Boolean OptimizeMP4 { get; private set; }
- #endregion
-
- #region Picture Settings
- public int Width { get; private set; }
- public int Height { get; private set; }
- public int MaxWidth { get; private set; }
- public int MaxHeight { get; private set; }
- public string CropValues { get; private set; }
- public string CropTop { get; private set; }
- public string CropBottom { get; private set; }
- public string CropLeft { get; private set; }
- public string CropRight { get; private set; }
- public int AnamorphicMode { get; private set; }
- public Boolean keepDisplayAsect { get; private set; }
- public double displayWidthValue { get; private set; }
- public int pixelAspectWidth { get; private set; }
- public int pixelAspectHeight { get; private set; }
- public int AnamorphicModulus { get; private set; }
- #endregion
-
- #region Video Filters
- public string DeTelecine { get; private set; }
- public int DeBlock { get; private set; }
- public string DeInterlace { get; private set; }
- public string DeNoise { get; private set; }
- public string Decomb { get; private set; }
- #endregion
-
- #region Video Settings
- public string VideoEncoder { get; private set; }
- public Boolean Grayscale { get; private set; }
- public Boolean TwoPass { get; private set; }
- public Boolean TurboFirstPass { get; private set; }
- public string VideoFramerate { get; private set; }
- public string AverageVideoBitrate { get; private set; }
- public string VideoTargetSize { get; private set; }
- public float VideoQuality { get; private set; }
- #endregion
-
- #region Audio Settings
- public ArrayList AudioInformation { get; private set; }
- public string Subtitles { get; private set; }
- public Boolean ForcedSubtitles { get; private set; }
- #endregion
-
- #region Chapter Markers
- public Boolean ChapterMarkers { get; private set; }
- #endregion
-
- #region Other
- public string H264Query { get; private set; }
- public Boolean Verbose { get; private set; }
- #endregion
+ // Source
+ public int DVDTitle { get; set; }
+ public int DVDChapterStart { get; set; }
+ public int DVDChapterFinish { get; set; }
+
+ // Output Settings
+ public string Format { get; set; }
+ public Boolean LargeMP4 { get; set; }
+ public Boolean IpodAtom { get; set; }
+ public Boolean OptimizeMP4 { get; set; }
+
+ // Picture Settings
+ public int Width { get; set; }
+ public int Height { get; set; }
+ public int MaxWidth { get; set; }
+ public int MaxHeight { get; set; }
+ public string CropValues { get; set; }
+ public string CropTop { get; set; }
+ public string CropBottom { get; set; }
+ public string CropLeft { get; set; }
+ public string CropRight { get; set; }
+ public int AnamorphicMode { get; set; }
+ public Boolean keepDisplayAsect { get; set; }
+ public double displayWidthValue { get; set; }
+ public int pixelAspectWidth { get; set; }
+ public int pixelAspectHeight { get; set; }
+ public int AnamorphicModulus { get; set; }
+
+ // Video Filters
+ public string DeTelecine { get; set; }
+ public int DeBlock { get; set; }
+ public string DeInterlace { get; set; }
+ public string DeNoise { get; set; }
+ public string Decomb { get; set; }
+
+ // Video Settings
+ public string VideoEncoder { get; set; }
+ public Boolean Grayscale { get; set; }
+ public Boolean TwoPass { get; set; }
+ public Boolean TurboFirstPass { get; set; }
+ public string VideoFramerate { get; set; }
+ public string AverageVideoBitrate { get; set; }
+ public string VideoTargetSize { get; set; }
+ public float VideoQuality { get; set; }
+
+ // Audio Settings
+ public ArrayList AudioInformation { get; set; }
+ public string Subtitles { get; set; }
+ public Boolean ForcedSubtitles { get; set; }
+
+ // Chapter Markers
+ public Boolean ChapterMarkers { get; set; }
+
+ // Other
+ public string H264Query { get; set; }
+ public Boolean Verbose { get; set; }
+
+ // Preset Information
+ public int PresetBuildNumber { get; set; }
+ public string PresetDescription { get; set; }
+ public string PresetName { get; set; }
+ public string Type { get; set; }
+ public Boolean UsesMaxPictureSettings { get; set; }
+ public Boolean UsesPictureFilters { get; set; }
+ public Boolean UsesPictureSettings { get; set; }
#endregion
@@ -204,7 +205,7 @@ namespace Handbrake.Functions
if (width.Success)
thisQuery.Width = int.Parse(width.Groups[0].Value.Replace("-w ", ""));
-
+
if (height.Success)
thisQuery.Height = int.Parse(height.Groups[0].Value.Replace("-l ", ""));
@@ -222,7 +223,7 @@ namespace Handbrake.Functions
thisQuery.CropBottom = actCropValues[1];
thisQuery.CropLeft = actCropValues[2];
thisQuery.CropRight = actCropValues[3];
- }
+ }
if (strictAnamorphic.Success)
thisQuery.AnamorphicMode = 1;
diff --git a/win/C#/HandBrakeCS.csproj b/win/C#/HandBrakeCS.csproj
index ce9d2fd4c..fda90e513 100644
--- a/win/C#/HandBrakeCS.csproj
+++ b/win/C#/HandBrakeCS.csproj
@@ -195,6 +195,7 @@
<Compile Include="Functions\Main.cs" />
<Compile Include="Functions\UpdateCheckInformation.cs" />
<Compile Include="Functions\Win32.cs" />
+ <Compile Include="Presets\Import.cs" />
<Compile Include="Presets\preset.cs" />
<Compile Include="Presets\PresetsHandler.cs" />
<Compile Include="EncodeQueue\QueueHandler.cs" />
diff --git a/win/C#/Presets/Import.cs b/win/C#/Presets/Import.cs
new file mode 100644
index 000000000..ac5e15d6b
--- /dev/null
+++ b/win/C#/Presets/Import.cs
@@ -0,0 +1,264 @@
+using System;
+using System.IO;
+using System.Xml;
+using System.Windows.Forms;
+using System.Collections;
+using Handbrake.Functions;
+
+namespace Handbrake.Presets
+{
+ class Import
+ {
+ public QueryParser importMacPreset(string filename)
+ {
+ if (!File.Exists(filename))
+ return null;
+
+ StreamReader sr = File.OpenText(filename);
+ string fromfile = string.Empty;
+ int fileChar;
+ while ((fileChar = sr.Read()) != -1)
+ fromfile += Convert.ToChar(fileChar);
+
+ XmlDocument doc = new XmlDocument();
+ doc.LoadXml(fromfile);
+
+ XmlNode root = doc;
+ if (!root.HasChildNodes)
+ {
+ MessageBox.Show(
+ "The Preset file you selected appears to be invlaid or from an older version of HandBrake", "Error",
+ MessageBoxButtons.OK, MessageBoxIcon.Error);
+ return null;
+ }
+
+ // We'll query a query parser object and use it's public var structures to store all the data.
+ // This will allow the preset loader logic to be used instead of writing custom logic just for this file.
+ QueryParser queryParsed = new QueryParser();
+
+ /***** Get the Audio Tracks *****/
+ XmlNode audioListDict = root.ChildNodes[2].ChildNodes[0].FirstChild.ChildNodes[1];
+ ArrayList AudioInfo = new ArrayList();
+ for (int i = 0; i < audioListDict.ChildNodes.Count; i++)
+ {
+ XmlNode audioChannel = audioListDict.ChildNodes[i];
+ AudioTrack track = new AudioTrack();
+
+ for (int subi = 0; subi < audioChannel.ChildNodes.Count; subi += 2)
+ {
+ // Audio Channel Information is here.
+ string key = audioChannel.ChildNodes[subi].InnerText;
+ string value = audioChannel.ChildNodes[subi + 1].InnerText;
+ switch (key)
+ {
+ case "AudioBitrate":
+ track.Bitrate = value;
+ break;
+ case "AudioEncoder":
+ track.Encoder = value.Replace("AAC (CoreAudio)", "AAC (faac)");
+ break;
+ case "AudioMixdown":
+ track.MixDown = value;
+ break;
+ case "AudioSamplerate":
+ track.SampleRate = value;
+ break;
+ case "AudioTrack":
+ track.Track = value;
+ break;
+ case "AudioTrackDRCSlider":
+ track.DRC = value;
+ break;
+ }
+ }
+ AudioInfo.Add(track);
+ }
+ queryParsed.AudioInformation = AudioInfo;
+
+ /***** Get the rest of the settings. *****/
+ XmlNode presetSettings = root.ChildNodes[2].ChildNodes[0].FirstChild;
+ for (int i = 2; i < presetSettings.ChildNodes.Count; i += 2) // Start from 2 to avoid the audio settings which we don't need.
+ {
+ string key = presetSettings.ChildNodes[i].InnerText;
+ string value = presetSettings.ChildNodes[i + 1].InnerText;
+
+ switch (key)
+ {
+ // Output Settings
+ case "FileFormat":
+ queryParsed.Format = value;
+ break;
+ case "Mp4HttpOptimize":
+ queryParsed.OptimizeMP4 = value == "1";
+ break;
+ case "Mp4LargeFile":
+ queryParsed.LargeMP4 = value == "1";
+ break;
+ case "Mp4iPodCompatible":
+ queryParsed.IpodAtom = value == "1";
+ break;
+
+ // Picture Settings
+ case "PictureAutoCrop":
+ break;
+ case "PictureTopCrop":
+ queryParsed.CropTop = value;
+ break;
+ case "PictureBottomCrop":
+ queryParsed.CropBottom = value;
+ break;
+ case "PictureLeftCrop":
+ queryParsed.CropLeft = value;
+ break;
+ case "PictureRightCrop":
+ queryParsed.CropRight = value;
+ break;
+ case "PictureHeight":
+ queryParsed.Height = int.Parse(value);
+ break;
+ case "PictureWidth":
+ queryParsed.Width = int.Parse(value);
+ break;
+ case "PictureKeepRatio":
+ queryParsed.keepDisplayAsect = value == "1";
+ break;
+ case "PicturePAR":
+ queryParsed.AnamorphicMode = int.Parse(value);
+ break;
+
+
+ // Filters
+ case "PictureDeblock":
+ queryParsed.DeBlock = int.Parse(value);
+ break;
+ case "PictureDecomb":
+ queryParsed.Decomb = "Off";
+ if (value == "1") queryParsed.Decomb = "Default";
+ break;
+ case "PictureDecombCustom":
+ if (value != "")
+ queryParsed.Decomb = value;
+ break;
+ case "PictureDecombDeinterlace":
+ // Not Used
+ break;
+ case "PictureDeinterlace":
+ switch (value)
+ {
+ case "0":
+ queryParsed.DeInterlace = "None";
+ break;
+ case "1":
+ queryParsed.DeInterlace = "Fast";
+ break;
+ case "2":
+ queryParsed.DeInterlace = "Slow";
+ break;
+ case "3":
+ queryParsed.DeInterlace = "Slowest";
+ break;
+ }
+ break;
+ case "PictureDeinterlaceCustom":
+ if (value != "")
+ queryParsed.DeInterlace = value;
+ break;
+ case "PictureDenoise":
+ switch (value)
+ {
+ case "0":
+ queryParsed.DeNoise = "None";
+ break;
+ case "1":
+ queryParsed.DeNoise = "Weak";
+ break;
+ case "2":
+ queryParsed.DeNoise = "Medium";
+ break;
+ case "3":
+ queryParsed.DeNoise = "Strong";
+ break;
+ }
+
+ break;
+ case "PictureDenoiseCustom":
+ if (value != "")
+ queryParsed.DeNoise = value;
+ break;
+ case "PictureDetelecine":
+ queryParsed.DeTelecine = "Off";
+ if (value == "1") queryParsed.DeTelecine = "Default";
+ break;
+ case "PictureDetelecineCustom":
+ if (value != "")
+ queryParsed.DeTelecine = value;
+ break;
+
+ // Video Tab
+ case "VideoAvgBitrate":
+ queryParsed.Width = int.Parse(value);
+ break;
+ case "VideoEncoder":
+ queryParsed.VideoEncoder = value;
+ break;
+ case "VideoFramerate":
+ queryParsed.VideoFramerate = value;
+ break;
+ case "VideoGrayScale":
+ queryParsed.Grayscale = value == "1";
+ break;
+ case "VideoQualitySlider":
+ queryParsed.VideoQuality = float.Parse(value);
+ break;
+ case "VideoQualityType":
+ break;
+ case "VideoTargetSize":
+ queryParsed.VideoTargetSize = value;
+ break;
+ case "VideoTurboTwoPass":
+ queryParsed.TurboFirstPass = value == "1";
+ break;
+ case "VideoTwoPass":
+ queryParsed.TwoPass = value == "1";
+ break;
+
+ // Chapter Markers Tab
+ case "ChapterMarkers":
+ queryParsed.ChapterMarkers = value == "1";
+ break;
+
+ // Advanced x264 tab
+ case "x264Option":
+ queryParsed.H264Query = value;
+ break;
+
+ // Preset Information
+ case "PresetBuildNumber":
+ queryParsed.PresetBuildNumber = int.Parse(value);
+ break;
+ case "PresetDescription":
+ queryParsed.PresetDescription = value;
+ break;
+ case "PresetName":
+ queryParsed.PresetName = value;
+ break;
+ case "Type":
+ queryParsed.Type = value;
+ break;
+ case "UsesMaxPictureSettings":
+ queryParsed.UsesMaxPictureSettings = value == "1";
+ break;
+ case "UsesPictureFilters":
+ queryParsed.UsesPictureFilters = value == "1";
+ break;
+ case "UsesPictureSettings":
+ queryParsed.UsesPictureSettings = value == "1";
+ break;
+ }
+ }
+ return queryParsed;
+ }
+
+ // --- It's the end of the road
+ }
+} \ No newline at end of file
diff --git a/win/C#/frmMain.Designer.cs b/win/C#/frmMain.Designer.cs
index 316885914..c5d09ae24 100644
--- a/win/C#/frmMain.Designer.cs
+++ b/win/C#/frmMain.Designer.cs
@@ -40,7 +40,7 @@ namespace Handbrake
this.components = new System.ComponentModel.Container();
System.Windows.Forms.ContextMenuStrip notifyIconMenu;
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMain));
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
this.btn_restore = new System.Windows.Forms.ToolStripMenuItem();
this.DVD_Save = new System.Windows.Forms.SaveFileDialog();
this.ToolTip = new System.Windows.Forms.ToolTip(this.components);
@@ -64,6 +64,7 @@ namespace Handbrake
this.drop_chapterFinish = new System.Windows.Forms.ComboBox();
this.drop_chapterStart = new System.Windows.Forms.ComboBox();
this.drop_angle = new System.Windows.Forms.ComboBox();
+ this.drp_dvdtitle = new System.Windows.Forms.ComboBox();
this.DVD_Open = new System.Windows.Forms.FolderBrowserDialog();
this.File_Open = new System.Windows.Forms.OpenFileDialog();
this.ISO_Open = new System.Windows.Forms.OpenFileDialog();
@@ -151,6 +152,7 @@ namespace Handbrake
this.btn_destBrowse = new System.Windows.Forms.Button();
this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+ this.Label10 = new System.Windows.Forms.Label();
this.lbl_angle = new System.Windows.Forms.Label();
this.Label9 = new System.Windows.Forms.Label();
this.Label13 = new System.Windows.Forms.Label();
@@ -158,11 +160,11 @@ namespace Handbrake
this.lbl_duration = new System.Windows.Forms.Label();
this.labelStaticDestination = new System.Windows.Forms.Label();
this.labelPreset = new System.Windows.Forms.Label();
- this.drp_dvdtitle = new System.Windows.Forms.ComboBox();
this.labelSource = new System.Windows.Forms.Label();
- this.Label10 = new System.Windows.Forms.Label();
this.labelStaticSource = new System.Windows.Forms.Label();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
+ this.mnu_importMacPreset = new System.Windows.Forms.ToolStripMenuItem();
+ this.openPreset = new System.Windows.Forms.OpenFileDialog();
this.PictureSettings = new Handbrake.Controls.PictureSettings();
this.Filters = new Handbrake.Controls.Filters();
this.AudioSettings = new Handbrake.Controls.AudioPanel();
@@ -201,12 +203,12 @@ namespace Handbrake
this.btn_restore});
notifyIconMenu.Name = "notifyIconMenu";
notifyIconMenu.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional;
- notifyIconMenu.Size = new System.Drawing.Size(114, 26);
+ notifyIconMenu.Size = new System.Drawing.Size(124, 26);
//
// btn_restore
//
this.btn_restore.Name = "btn_restore";
- this.btn_restore.Size = new System.Drawing.Size(113, 22);
+ this.btn_restore.Size = new System.Drawing.Size(123, 22);
this.btn_restore.Text = "Restore";
this.btn_restore.Click += new System.EventHandler(this.btn_restore_Click);
//
@@ -390,9 +392,9 @@ namespace Handbrake
//
// number
//
- dataGridViewCellStyle1.Format = "N0";
- dataGridViewCellStyle1.NullValue = null;
- this.number.DefaultCellStyle = dataGridViewCellStyle1;
+ dataGridViewCellStyle3.Format = "N0";
+ dataGridViewCellStyle3.NullValue = null;
+ this.number.DefaultCellStyle = dataGridViewCellStyle3;
this.number.Frozen = true;
this.number.HeaderText = "Chapter Number";
this.number.MaxInputLength = 3;
@@ -482,6 +484,21 @@ namespace Handbrake
this.drop_angle.TabIndex = 45;
this.ToolTip.SetToolTip(this.drop_angle, "Select the chapter range you would like to enocde. (default: All Chapters)");
//
+ // drp_dvdtitle
+ //
+ this.drp_dvdtitle.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.drp_dvdtitle.FormattingEnabled = true;
+ this.drp_dvdtitle.Items.AddRange(new object[] {
+ "Automatic"});
+ this.drp_dvdtitle.Location = new System.Drawing.Point(40, 3);
+ this.drp_dvdtitle.Name = "drp_dvdtitle";
+ this.drp_dvdtitle.Size = new System.Drawing.Size(119, 21);
+ this.drp_dvdtitle.TabIndex = 7;
+ this.ToolTip.SetToolTip(this.drp_dvdtitle, "Select the title you wish to encode.\r\nThe longest title is selected by default af" +
+ "ter you have scanned a source.");
+ this.drp_dvdtitle.SelectedIndexChanged += new System.EventHandler(this.drp_dvdtitle_SelectedIndexChanged);
+ this.drp_dvdtitle.Click += new System.EventHandler(this.drp_dvdtitle_Click);
+ //
// DVD_Open
//
this.DVD_Open.Description = "Select the \"VIDEO_TS\" folder from your DVD Drive.";
@@ -504,13 +521,13 @@ namespace Handbrake
this.mnu_killCLI,
this.mnu_exit});
this.FileToolStripMenuItem.Name = "FileToolStripMenuItem";
- this.FileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
+ this.FileToolStripMenuItem.Size = new System.Drawing.Size(35, 20);
this.FileToolStripMenuItem.Text = "&File";
//
// mnu_killCLI
//
this.mnu_killCLI.Name = "mnu_killCLI";
- this.mnu_killCLI.Size = new System.Drawing.Size(138, 22);
+ this.mnu_killCLI.Size = new System.Drawing.Size(143, 22);
this.mnu_killCLI.Text = "Cancel Scan";
this.mnu_killCLI.Visible = false;
this.mnu_killCLI.Click += new System.EventHandler(this.mnu_killCLI_Click);
@@ -518,7 +535,7 @@ namespace Handbrake
// mnu_exit
//
this.mnu_exit.Name = "mnu_exit";
- this.mnu_exit.Size = new System.Drawing.Size(138, 22);
+ this.mnu_exit.Size = new System.Drawing.Size(143, 22);
this.mnu_exit.Text = "E&xit";
this.mnu_exit.Click += new System.EventHandler(this.mnu_exit_Click);
//
@@ -535,7 +552,7 @@ namespace Handbrake
this.ToolStripSeparator5,
this.mnu_options});
this.ToolsToolStripMenuItem.Name = "ToolsToolStripMenuItem";
- this.ToolsToolStripMenuItem.Size = new System.Drawing.Size(48, 20);
+ this.ToolsToolStripMenuItem.Size = new System.Drawing.Size(44, 20);
this.ToolsToolStripMenuItem.Text = "&Tools";
//
// mnu_encode
@@ -543,7 +560,7 @@ namespace Handbrake
this.mnu_encode.Image = global::Handbrake.Properties.Resources.Queue_Small;
this.mnu_encode.Name = "mnu_encode";
this.mnu_encode.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Q)));
- this.mnu_encode.Size = new System.Drawing.Size(184, 22);
+ this.mnu_encode.Size = new System.Drawing.Size(186, 22);
this.mnu_encode.Text = "Show Queue";
this.mnu_encode.Click += new System.EventHandler(this.mnu_encode_Click);
//
@@ -551,20 +568,20 @@ namespace Handbrake
//
this.mnu_encodeLog.Image = global::Handbrake.Properties.Resources.ActivityWindow_small;
this.mnu_encodeLog.Name = "mnu_encodeLog";
- this.mnu_encodeLog.Size = new System.Drawing.Size(184, 22);
+ this.mnu_encodeLog.Size = new System.Drawing.Size(186, 22);
this.mnu_encodeLog.Text = "Activity Window";
this.mnu_encodeLog.Click += new System.EventHandler(this.mnu_encodeLog_Click);
//
// ToolStripSeparator5
//
this.ToolStripSeparator5.Name = "ToolStripSeparator5";
- this.ToolStripSeparator5.Size = new System.Drawing.Size(181, 6);
+ this.ToolStripSeparator5.Size = new System.Drawing.Size(183, 6);
//
// mnu_options
//
this.mnu_options.Image = global::Handbrake.Properties.Resources.Pref_Small;
this.mnu_options.Name = "mnu_options";
- this.mnu_options.Size = new System.Drawing.Size(184, 22);
+ this.mnu_options.Size = new System.Drawing.Size(186, 22);
this.mnu_options.Text = "Options";
this.mnu_options.Click += new System.EventHandler(this.mnu_options_Click);
//
@@ -575,9 +592,10 @@ namespace Handbrake
this.mnu_delete_preset,
this.toolStripSeparator7,
this.btn_new_preset,
+ this.mnu_importMacPreset,
this.mnu_SelectDefault});
this.PresetsToolStripMenuItem.Name = "PresetsToolStripMenuItem";
- this.PresetsToolStripMenuItem.Size = new System.Drawing.Size(56, 20);
+ this.PresetsToolStripMenuItem.Size = new System.Drawing.Size(55, 20);
this.PresetsToolStripMenuItem.Text = "&Presets";
//
// mnu_presetReset
@@ -626,14 +644,14 @@ namespace Handbrake
this.toolStripSeparator6,
this.mnu_about});
this.HelpToolStripMenuItem.Name = "HelpToolStripMenuItem";
- this.HelpToolStripMenuItem.Size = new System.Drawing.Size(44, 20);
+ this.HelpToolStripMenuItem.Size = new System.Drawing.Size(40, 20);
this.HelpToolStripMenuItem.Text = "&Help";
//
// mnu_user_guide
//
this.mnu_user_guide.Image = global::Handbrake.Properties.Resources.Help16;
this.mnu_user_guide.Name = "mnu_user_guide";
- this.mnu_user_guide.Size = new System.Drawing.Size(194, 22);
+ this.mnu_user_guide.Size = new System.Drawing.Size(192, 22);
this.mnu_user_guide.Text = "HandBrake User Guide";
this.mnu_user_guide.Click += new System.EventHandler(this.mnu_user_guide_Click);
//
@@ -641,39 +659,39 @@ namespace Handbrake
//
this.mnu_handbrake_home.Image = global::Handbrake.Properties.Resources.info16;
this.mnu_handbrake_home.Name = "mnu_handbrake_home";
- this.mnu_handbrake_home.Size = new System.Drawing.Size(194, 22);
+ this.mnu_handbrake_home.Size = new System.Drawing.Size(192, 22);
this.mnu_handbrake_home.Text = "HandBrake Homepage";
this.mnu_handbrake_home.Click += new System.EventHandler(this.mnu_handbrake_home_Click);
//
// mnu_handbrake_forums
//
this.mnu_handbrake_forums.Name = "mnu_handbrake_forums";
- this.mnu_handbrake_forums.Size = new System.Drawing.Size(194, 22);
+ this.mnu_handbrake_forums.Size = new System.Drawing.Size(192, 22);
this.mnu_handbrake_forums.Text = "HandBrake Forums";
this.mnu_handbrake_forums.Click += new System.EventHandler(this.mnu_handbrake_forums_Click);
//
// ToolStripSeparator3
//
this.ToolStripSeparator3.Name = "ToolStripSeparator3";
- this.ToolStripSeparator3.Size = new System.Drawing.Size(191, 6);
+ this.ToolStripSeparator3.Size = new System.Drawing.Size(189, 6);
//
// mnu_UpdateCheck
//
this.mnu_UpdateCheck.Name = "mnu_UpdateCheck";
- this.mnu_UpdateCheck.Size = new System.Drawing.Size(194, 22);
+ this.mnu_UpdateCheck.Size = new System.Drawing.Size(192, 22);
this.mnu_UpdateCheck.Text = "Check for Updates";
this.mnu_UpdateCheck.Click += new System.EventHandler(this.mnu_UpdateCheck_Click);
//
// toolStripSeparator6
//
this.toolStripSeparator6.Name = "toolStripSeparator6";
- this.toolStripSeparator6.Size = new System.Drawing.Size(191, 6);
+ this.toolStripSeparator6.Size = new System.Drawing.Size(189, 6);
//
// mnu_about
//
this.mnu_about.Image = global::Handbrake.Properties.Resources.hb16;
this.mnu_about.Name = "mnu_about";
- this.mnu_about.Size = new System.Drawing.Size(194, 22);
+ this.mnu_about.Size = new System.Drawing.Size(192, 22);
this.mnu_about.Text = "About...";
this.mnu_about.Click += new System.EventHandler(this.mnu_about_Click);
//
@@ -872,7 +890,6 @@ namespace Handbrake
this.tab_picture.Text = "Picture";
this.tab_picture.UseVisualStyleBackColor = true;
//
- //
// Check_ChapterMarkers
//
this.Check_ChapterMarkers.AutoSize = true;
@@ -1087,40 +1104,40 @@ namespace Handbrake
this.pmnu_saveChanges,
this.pmnu_delete});
this.presets_menu.Name = "presets_menu";
- this.presets_menu.Size = new System.Drawing.Size(148, 98);
+ this.presets_menu.Size = new System.Drawing.Size(155, 98);
this.presets_menu.Text = ";";
this.presets_menu.Opening += new System.ComponentModel.CancelEventHandler(this.presets_menu_Opening);
//
// pmnu_expandAll
//
this.pmnu_expandAll.Name = "pmnu_expandAll";
- this.pmnu_expandAll.Size = new System.Drawing.Size(147, 22);
+ this.pmnu_expandAll.Size = new System.Drawing.Size(154, 22);
this.pmnu_expandAll.Text = "Expand All";
this.pmnu_expandAll.Click += new System.EventHandler(this.pmnu_expandAll_Click);
//
// pmnu_collapse
//
this.pmnu_collapse.Name = "pmnu_collapse";
- this.pmnu_collapse.Size = new System.Drawing.Size(147, 22);
+ this.pmnu_collapse.Size = new System.Drawing.Size(154, 22);
this.pmnu_collapse.Text = "Collapse All";
this.pmnu_collapse.Click += new System.EventHandler(this.pmnu_collapse_Click);
//
// sep1
//
this.sep1.Name = "sep1";
- this.sep1.Size = new System.Drawing.Size(144, 6);
+ this.sep1.Size = new System.Drawing.Size(151, 6);
//
// pmnu_saveChanges
//
this.pmnu_saveChanges.Name = "pmnu_saveChanges";
- this.pmnu_saveChanges.Size = new System.Drawing.Size(147, 22);
+ this.pmnu_saveChanges.Size = new System.Drawing.Size(154, 22);
this.pmnu_saveChanges.Text = "Save Changes";
this.pmnu_saveChanges.Click += new System.EventHandler(this.pmnu_saveChanges_Click);
//
// pmnu_delete
//
this.pmnu_delete.Name = "pmnu_delete";
- this.pmnu_delete.Size = new System.Drawing.Size(147, 22);
+ this.pmnu_delete.Size = new System.Drawing.Size(154, 22);
this.pmnu_delete.Text = "Delete";
this.pmnu_delete.Click += new System.EventHandler(this.pmnu_delete_click);
//
@@ -1154,7 +1171,7 @@ namespace Handbrake
this.btn_source.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
this.btn_source.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btn_source.Name = "btn_source";
- this.btn_source.Size = new System.Drawing.Size(88, 36);
+ this.btn_source.Size = new System.Drawing.Size(85, 36);
this.btn_source.Text = "Source";
this.btn_source.ToolTipText = "Open a new source file or folder.";
this.btn_source.Click += new System.EventHandler(this.btn_source_Click);
@@ -1163,7 +1180,7 @@ namespace Handbrake
//
this.btn_file_source.Image = global::Handbrake.Properties.Resources.Movies_Small;
this.btn_file_source.Name = "btn_file_source";
- this.btn_file_source.Size = new System.Drawing.Size(192, 22);
+ this.btn_file_source.Size = new System.Drawing.Size(194, 22);
this.btn_file_source.Text = "Video File";
this.btn_file_source.Click += new System.EventHandler(this.btn_file_source_Click);
//
@@ -1172,20 +1189,20 @@ namespace Handbrake
this.btn_dvd_source.Image = ((System.Drawing.Image)(resources.GetObject("btn_dvd_source.Image")));
this.btn_dvd_source.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btn_dvd_source.Name = "btn_dvd_source";
- this.btn_dvd_source.Size = new System.Drawing.Size(192, 22);
+ this.btn_dvd_source.Size = new System.Drawing.Size(194, 22);
this.btn_dvd_source.Text = "DVD/ VIDEO_TS Folder";
this.btn_dvd_source.Click += new System.EventHandler(this.btn_dvd_source_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
- this.toolStripSeparator1.Size = new System.Drawing.Size(189, 6);
+ this.toolStripSeparator1.Size = new System.Drawing.Size(191, 6);
//
// mnu_dvd_drive
//
this.mnu_dvd_drive.Image = global::Handbrake.Properties.Resources.disc_small;
this.mnu_dvd_drive.Name = "mnu_dvd_drive";
- this.mnu_dvd_drive.Size = new System.Drawing.Size(192, 22);
+ this.mnu_dvd_drive.Size = new System.Drawing.Size(194, 22);
this.mnu_dvd_drive.Text = "[No DVD Drive Ready]";
this.mnu_dvd_drive.Visible = false;
this.mnu_dvd_drive.Click += new System.EventHandler(this.mnu_dvd_drive_Click);
@@ -1212,7 +1229,7 @@ namespace Handbrake
this.btn_add2Queue.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
this.btn_add2Queue.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btn_add2Queue.Name = "btn_add2Queue";
- this.btn_add2Queue.Size = new System.Drawing.Size(117, 36);
+ this.btn_add2Queue.Size = new System.Drawing.Size(110, 36);
this.btn_add2Queue.Text = "Add to Queue";
this.btn_add2Queue.ToolTipText = "Add a new item to the Queue";
this.btn_add2Queue.Click += new System.EventHandler(this.btn_add2Queue_Click);
@@ -1223,7 +1240,7 @@ namespace Handbrake
this.btn_showQueue.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
this.btn_showQueue.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btn_showQueue.Name = "btn_showQueue";
- this.btn_showQueue.Size = new System.Drawing.Size(110, 36);
+ this.btn_showQueue.Size = new System.Drawing.Size(104, 36);
this.btn_showQueue.Tag = "";
this.btn_showQueue.Text = "Show Queue";
this.btn_showQueue.Click += new System.EventHandler(this.btn_showQueue_Click);
@@ -1239,7 +1256,7 @@ namespace Handbrake
this.tb_preview.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
this.tb_preview.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tb_preview.Name = "tb_preview";
- this.tb_preview.Size = new System.Drawing.Size(84, 36);
+ this.tb_preview.Size = new System.Drawing.Size(81, 36);
this.tb_preview.Text = "Preview";
this.tb_preview.Click += new System.EventHandler(this.tb_preview_Click);
//
@@ -1249,7 +1266,7 @@ namespace Handbrake
this.btn_ActivityWindow.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
this.btn_ActivityWindow.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btn_ActivityWindow.Name = "btn_ActivityWindow";
- this.btn_ActivityWindow.Size = new System.Drawing.Size(130, 36);
+ this.btn_ActivityWindow.Size = new System.Drawing.Size(120, 36);
this.btn_ActivityWindow.Text = "Activity Window";
this.btn_ActivityWindow.ToolTipText = "Displays the activity window which displays the log of the last completed or curr" +
"ently running encode.";
@@ -1391,6 +1408,17 @@ namespace Handbrake
this.tableLayoutPanel1.Size = new System.Drawing.Size(723, 27);
this.tableLayoutPanel1.TabIndex = 49;
//
+ // Label10
+ //
+ this.Label10.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
+ this.Label10.AutoSize = true;
+ this.Label10.ForeColor = System.Drawing.Color.Black;
+ this.Label10.Location = new System.Drawing.Point(3, 7);
+ this.Label10.Name = "Label10";
+ this.Label10.Size = new System.Drawing.Size(31, 13);
+ this.Label10.TabIndex = 6;
+ this.Label10.Text = "Title:";
+ //
// lbl_angle
//
this.lbl_angle.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
@@ -1465,21 +1493,6 @@ namespace Handbrake
this.labelPreset.TabIndex = 54;
this.labelPreset.Text = "Output Settings (Preset: None)";
//
- // drp_dvdtitle
- //
- this.drp_dvdtitle.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.drp_dvdtitle.FormattingEnabled = true;
- this.drp_dvdtitle.Items.AddRange(new object[] {
- "Automatic"});
- this.drp_dvdtitle.Location = new System.Drawing.Point(40, 3);
- this.drp_dvdtitle.Name = "drp_dvdtitle";
- this.drp_dvdtitle.Size = new System.Drawing.Size(119, 21);
- this.drp_dvdtitle.TabIndex = 7;
- this.ToolTip.SetToolTip(this.drp_dvdtitle, "Select the title you wish to encode.\r\nThe longest title is selected by default af" +
- "ter you have scanned a source.");
- this.drp_dvdtitle.SelectedIndexChanged += new System.EventHandler(this.drp_dvdtitle_SelectedIndexChanged);
- this.drp_dvdtitle.Click += new System.EventHandler(this.drp_dvdtitle_Click);
- //
// labelSource
//
this.labelSource.AutoSize = true;
@@ -1489,17 +1502,6 @@ namespace Handbrake
this.labelSource.TabIndex = 52;
this.labelSource.Text = "Select \"Source\" to continue";
//
- // Label10
- //
- this.Label10.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
- this.Label10.AutoSize = true;
- this.Label10.ForeColor = System.Drawing.Color.Black;
- this.Label10.Location = new System.Drawing.Point(3, 7);
- this.Label10.Name = "Label10";
- this.Label10.Size = new System.Drawing.Size(31, 13);
- this.Label10.TabIndex = 6;
- this.Label10.Text = "Title:";
- //
// labelStaticSource
//
this.labelStaticSource.AutoSize = true;
@@ -1523,6 +1525,18 @@ namespace Handbrake
this.flowLayoutPanel1.Size = new System.Drawing.Size(195, 13);
this.flowLayoutPanel1.TabIndex = 55;
//
+ // mnu_importMacPreset
+ //
+ this.mnu_importMacPreset.Name = "mnu_importMacPreset";
+ this.mnu_importMacPreset.Size = new System.Drawing.Size(194, 22);
+ this.mnu_importMacPreset.Text = "Import";
+ this.mnu_importMacPreset.Click += new System.EventHandler(this.mnu_importMacPreset_Click);
+ //
+ // openPreset
+ //
+ this.openPreset.DefaultExt = "plist";
+ this.openPreset.Filter = "Plist Files|*.plist";
+ //
// PictureSettings
//
this.PictureSettings.BackColor = System.Drawing.Color.Transparent;
@@ -1761,5 +1775,7 @@ namespace Handbrake
internal Label Label10;
private Label labelStaticSource;
private FlowLayoutPanel flowLayoutPanel1;
+ private ToolStripMenuItem mnu_importMacPreset;
+ private OpenFileDialog openPreset;
}
} \ No newline at end of file
diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs
index aa489325f..3076ae67a 100644
--- a/win/C#/frmMain.cs
+++ b/win/C#/frmMain.cs
@@ -367,6 +367,15 @@ namespace Handbrake
{
loadNormalPreset();
}
+ private void mnu_importMacPreset_Click(object sender, EventArgs e)
+ {
+ Import imp = new Import();
+ if (openPreset.ShowDialog() == DialogResult.OK)
+ {
+ QueryParser parsed = imp.importMacPreset(openPreset.FileName);
+ PresetLoader.presetLoader(this, parsed, parsed.PresetName, parsed.UsesPictureSettings);
+ }
+ }
private void btn_new_preset_Click(object sender, EventArgs e)
{
Form preset = new frmAddPreset(this, queryGen.generateTheQuery(this), presetHandler);
@@ -1706,7 +1715,6 @@ namespace Handbrake
}
#endregion
-
// This is the END of the road ****************************************
}
} \ No newline at end of file
diff --git a/win/C#/frmMain.resx b/win/C#/frmMain.resx
index 57ce99c9f..0a115b4ea 100644
--- a/win/C#/frmMain.resx
+++ b/win/C#/frmMain.resx
@@ -166,17 +166,18 @@ Note: Do not change any of the chapter numbers!</value>
<data name="btn_dvd_source.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
- YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJQSURBVDhPlZNdSNNRGMb/F110ZZEVhVBgeeHNICiiuggp
- olAUyyxI0oSaH1QYC3N+tKnp5ubm1JUua5uuqdPKMgr7kApFItTUkWZqVhSVYmao5Nev/xyoQ4k88Nyc
- 8z6/93nP4QjCfy6lwc4ltZVso4P/tMyXRcmMHqZ0EeY6jZQVInzuf0e1Tb9Ina3P/tkpLD6XkNg8BJe5
- u93C+HDVrP4M2ZkcMOOw5tLZ9nxJyJE4HSExBoKkBQhVpTrGhso9zNPfiph0JlB+U01ZcRbmwnRMeWlc
- 08opUCV6QissGsZ+WOY6z4hmuuXglC6pRYBbJSp+fzXNxnaZ66o1s3rkyKHWruJuWRYOcwZ2kxKr8TI3
- DCkU6+QYNUnuNGWmLEY+5uOK3degoKZcx3SfEvozPfVB3OtNhi4ZvI2nrTIc23U9gtmYwa8eNXzScq8i
- l6bHWnfRwhHeREJzGFONgYw/CeB9qQSZNNR9FyUGBT87lfQ3plJj1zLTq4COGDegLVo0HmeqKZjx+gOM
- PNzDYPU2lLF+4jhyN6BIl8pgexK3bRpaXopJuhJEwGloiWDmVSgTLw4xWreXoZrtfK/wp/nKak4E+s6/
- hDFHTkd9GndsOdCTBq1i3NdHmWgIYvRpAMO1OxlwSPhi2YpT641CuoWzsSfnAfnZiVRZ1Tjvx9GsF+bU
- pF1BvWolD9JXUZmyDnOiD1cvbCZiYXfXCPrMi+gVZ8hOiiL53DHORwdzKnw/hw/uYt9uCTskfvj7+rBp
- 41rWr/Fig7fX8j/Tsn/fcgx/ARfG3ml6M3rzAAAAAElFTkSuQmCC
+ YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAlpJREFUOE+tk21I
+ k1EYhif0oyA0sqIQCix/+GcQFFH9CCmiUBTLLEjShJofVBgL2fxoU9Pp5ubUlS5rU9f8rCyjsA+pUCRC
+ TR1ppmVFUSlmhq78unrnQF1KGHTg/nEOz30993PO+7qJFrmUeiv2n+Mij+XLRLLYULdF2pxlEVIDcw0p
+ AsyxD5fmI/rQ94pqi26eOlsfuZj+7BgSm01QdA4ih7m73Yx9qGpavwatjPebqCzOprPt8YKQgzFagqL0
+ BEjyEFWVaBkdLHMxT34uYNwWR9nVTEoL0zHlp2DMSeaSRk6eKt4VWm5WM/rVPNN5SjDTLQebZEHNA1wr
+ UvHjk3E6tsNcV62e1r3KLGqtKm6WplNpSsVqVFJsOM8VfSKFWjkGtcyZptSYzvC7XByx3zQoqCnTMvlG
+ CX1prnornPUmQJcUXsbSVhGK5bIOkcmQyveeTHiv4VZ5Nk33Nc6iuSO8CIfmECYa/bE/8ON1iRipJNh5
+ F0V6Bd86lfQ1JlFj1TDVq4COKCegLVIwHmGiKRB7/V6G7+5koHozymgfYRy5E1CgTWKgXcZ1i5qWp0KS
+ rjgBcAJawph6FszYk/2M1O1isGYLX8p9ab6wgqP+3rMvYciS01GfzA1LFvQkQ6sQ9/khxhoCGHnox1Dt
+ NvorxXw0b8Km8UQh2cip6GOzgNyMeKqKM7HdjqFZJ5pRk2YJ9aql3EnxoCJxNaZ4Ly6e3UDY3O6OEXRp
+ 59ApTpIhiyDh9GHORAZyPHQPB/ZtZ/cOMVvFPvh6e7F+3SrWrHRnraf7Xz/xf/rJ/kvxb84I3U1y+9/W
+ AAAAAElFTkSuQmCC
</value>
</data>
<metadata name="notifyIcon.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
@@ -570,6 +571,15 @@ Note: Do not change any of the chapter numbers!</value>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>98</value>
</metadata>
+ <metadata name="File_Save.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>664, 15</value>
+ </metadata>
+ <metadata name="openPreset.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>680, 54</value>
+ </metadata>
+ <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>98</value>
+ </metadata>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAYAMDAAAAEACACoDgAAZgAAACAgAAABAAgAqAgAAA4PAAAQEAAAAQAIAGgFAAC2FwAAMDAAAAEA
@@ -949,7 +959,4 @@ Note: Do not change any of the chapter numbers!</value>
AAD6AQAA4AEAAMABAACAAQAAgAEAAMBBAADAYQAAjGEAAIRhAADc+wAA3/8AAA==
</value>
</data>
- <metadata name="File_Save.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>664, 15</value>
- </metadata>
</root> \ No newline at end of file