OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Wed, 22 Apr 2009 12:27:37 +0000 (12:27 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Wed, 22 Apr 2009 12:27:37 +0000 (12:27 +0000)
- Queue: Can now store unlimited number of audio tracks in presets. It is no longer limited to 4.
- Activity Window: Fixed a bug where it was looking at the wrong class for checking the status of encoding.
- Activity Window: Improved update / display performance dramatically by removing a List data structure.
- Misc: Old code removed / code tweaks

git-svn-id: svn://localhost/HandBrake/trunk@2349 b64f7644-9d1e-0410-96f1-a4d463321fa5

20 files changed:
win/C#/Controls/x264Panel.Designer.cs
win/C#/Controls/x264Panel.resx
win/C#/Functions/Encode.cs
win/C#/Functions/Main.cs
win/C#/Functions/PresetLoader.cs
win/C#/Functions/QueryGenerator.cs
win/C#/Functions/QueryParser.cs
win/C#/HandBrakeCS.csproj
win/C#/Installer/Installer.nsi
win/C#/Program.cs
win/C#/Queue/QueueHandler.cs
win/C#/frmActivityWindow.cs
win/C#/frmMain.Designer.cs
win/C#/frmMain.cs
win/C#/frmMain.resx
win/C#/frmOptions.cs
win/C#/frmPreview.Designer.cs
win/C#/frmPreview.cs
win/C#/frmQueue.cs
win/C#/frmUpdater.cs

index 5f08ed7..3e3c4a2 100644 (file)
             this.label43.AutoSize = true;\r
             this.label43.BackColor = System.Drawing.Color.Transparent;\r
             this.label43.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.label43.Location = new System.Drawing.Point(13, 18);\r
+            this.label43.Location = new System.Drawing.Point(13, 13);\r
             this.label43.Name = "label43";\r
             this.label43.Size = new System.Drawing.Size(165, 13);\r
             this.label43.TabIndex = 49;\r
index 8dca4f1..dbd32d1 100644 (file)
   <metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
     <value>17, 17</value>\r
   </metadata>\r
-  <metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
-    <value>17, 17</value>\r
-  </metadata>\r
   <data name="slider_psyrd.ToolTip" xml:space="preserve">\r
     <value>Psychovisual Rate Distortion Optimization sure is a mouthful, isn't it? Basically, it means x264 tries to retain detail, for better quality to the human eye, \r
 as opposed to trying to maximize quality the way a computer understands it, through signal-to-noise ratios that have trouble telling apart fine detail and noise.</value>\r
index 1cd3de4..6c30828 100644 (file)
@@ -16,20 +16,18 @@ namespace Handbrake.Functions
     {\r
         // DLL Imports\r
         [DllImport("user32.dll")]\r
-        public static extern void LockWorkStation();\r
+        private static extern void LockWorkStation();\r
         [DllImport("user32.dll")]\r
-        public static extern int ExitWindowsEx(int uFlags, int dwReason);\r
+        private static extern int ExitWindowsEx(int uFlags, int dwReason);\r
 \r
         // Declarations\r
         Process hbProc = new Process();\r
-        Boolean encoding;\r
 \r
         /// <summary>\r
         /// Execute a HandBrakeCLI process.\r
         /// </summary>\r
-        /// <param name="s"></param>\r
         /// <param name="query">The CLI Query</param>\r
-        public Process runCli(object s, string query)\r
+        public Process runCli(string query)\r
         {\r
             try\r
             {\r
@@ -42,7 +40,8 @@ namespace Handbrake.Functions
                 if (Properties.Settings.Default.cli_minimized == "Checked")\r
                     cliStart.WindowStyle = ProcessWindowStyle.Minimized;\r
                 hbProc = Process.Start(cliStart);\r
-                encoding = true;\r
+                isEncoding = true;\r
+                currentQuery = query;\r
 \r
                 // Set the process Priority \r
                 if (hbProc != null)\r
@@ -80,7 +79,8 @@ namespace Handbrake.Functions
         /// </summary>\r
         public void afterEncodeAction()\r
         {\r
-            encoding = false;\r
+            isEncoding = false;\r
+            currentQuery = String.Empty;\r
             // Do something whent he encode ends.\r
             switch (Properties.Settings.Default.CompletionOption)\r
             {\r
@@ -132,9 +132,8 @@ namespace Handbrake.Functions
         /// Save a copy of the log to the users desired location or a default location\r
         /// if this feature is enabled in options.\r
         /// </summary>\r
-        /// <param name="query"></param>\r
         /// <param name="destination"></param>\r
-        public void copyLog(string query, string destination)\r
+        public void copyLog(string destination)\r
         {\r
             // The user may wish to do something with the log.\r
             if (Properties.Settings.Default.saveLog == "Checked")\r
@@ -169,10 +168,12 @@ namespace Handbrake.Functions
         /// <summary>\r
         /// Returns whether HandBrake is currently encoding or not.\r
         /// </summary>\r
-        public Boolean isEncoding\r
-        {\r
-            get { return encoding; }\r
-        }\r
+        public Boolean isEncoding { get; set; }\r
+\r
+        /// <summary>\r
+        /// Returns the currently encoding query string\r
+        /// </summary>\r
+        public String currentQuery { get; set; }\r
 \r
     }\r
 }\r
index 93b2939..acca7e7 100644 (file)
@@ -1,11 +1,10 @@
-/*  Common.cs $\r
+/*  Main.cs $\r
        \r
           This file is part of the HandBrake source code.\r
           Homepage: <http://handbrake.fr>.\r
           It may be used under the terms of the GNU General Public License. */\r
 \r
 using System;\r
-using System.Collections;\r
 using System.Windows.Forms;\r
 using System.IO;\r
 using System.Diagnostics;\r
@@ -23,7 +22,7 @@ namespace Handbrake.Functions
         /// <summary>\r
         /// Calculate the duration of the selected title and chapters\r
         /// </summary>\r
-        public TimeSpan calculateDuration(string chapter_start, string chapter_end, Parsing.Title selectedTitle)\r
+        public static TimeSpan calculateDuration(string chapter_start, string chapter_end, Parsing.Title selectedTitle)\r
         {\r
             TimeSpan Duration = TimeSpan.FromSeconds(0.0);\r
 \r
@@ -62,7 +61,7 @@ namespace Handbrake.Functions
         /// <param name="right"></param>\r
         /// <param name="selectedTitle"></param>\r
         /// <returns></returns>\r
-        public int cacluateNonAnamorphicHeight(int width, decimal top, decimal bottom, decimal left, decimal right, Parsing.Title selectedTitle)\r
+        public static int cacluateNonAnamorphicHeight(int width, decimal top, decimal bottom, decimal left, decimal right, Parsing.Title selectedTitle)\r
         {\r
             float aspect = selectedTitle.AspectRatio;\r
             int aw = 0;\r
@@ -111,7 +110,7 @@ namespace Handbrake.Functions
         /// <summary>\r
         /// Select the longest title in the DVD title dropdown menu on frmMain\r
         /// </summary>\r
-        public Parsing.Title selectLongestTitle(ComboBox drp_dvdtitle)\r
+        public static Parsing.Title selectLongestTitle(ComboBox drp_dvdtitle)\r
         {\r
             int current_largest = 0;\r
             Parsing.Title title2Select;\r
@@ -161,7 +160,7 @@ namespace Handbrake.Functions
         /// <summary>\r
         /// Set's up the DataGridView on the Chapters tab (frmMain)\r
         /// </summary>\r
-        public DataGridView chapterNaming(DataGridView data_chpt, string chapter_end)\r
+        public static DataGridView chapterNaming(DataGridView data_chpt, string chapter_end)\r
         {\r
             int i = 0, finish = 0;\r
 \r
@@ -185,7 +184,7 @@ namespace Handbrake.Functions
         /// Function which generates the filename and path automatically based on \r
         /// the Source Name, DVD title and DVD Chapters\r
         /// </summary>\r
-        public string autoName(ComboBox drp_dvdtitle, string chapter_start, string chatper_end, string source, string dest, int format)\r
+        public static string autoName(ComboBox drp_dvdtitle, string chapter_start, string chatper_end, string source, string dest, int format)\r
         {\r
             string AutoNamePath = string.Empty;\r
             if (drp_dvdtitle.Text != "Automatic")\r
@@ -227,7 +226,7 @@ namespace Handbrake.Functions
                 if (!dest.Contains(Path.DirectorySeparatorChar.ToString()))\r
                 {\r
                     // If there is an auto name path, use it...\r
-                    if (Properties.Settings.Default.autoNamePath.Trim() != "" && Properties.Settings.Default.autoNamePath.Trim() != "Click 'Browse' to set the default location") \r
+                    if (Properties.Settings.Default.autoNamePath.Trim() != "" && Properties.Settings.Default.autoNamePath.Trim() != "Click 'Browse' to set the default location")\r
                         AutoNamePath = Path.Combine(Properties.Settings.Default.autoNamePath, destination_filename);\r
                     else // ...otherwise, output to the source directory\r
                         AutoNamePath = null;\r
@@ -248,7 +247,7 @@ namespace Handbrake.Functions
         /// </summary>\r
         /// <param name="debug">Turns on debug mode. Don't use on program startup</param>\r
         /// <returns>Boolean True = Update available</returns>\r
-        public Boolean updateCheck(Boolean debug)\r
+        public static Boolean updateCheck(Boolean debug)\r
         {\r
             try\r
             {\r
@@ -262,7 +261,7 @@ namespace Handbrake.Functions
 \r
                 if (latest == skip)\r
                     return false;\r
-                \r
+\r
                 Boolean update = (latest > current);\r
                 return update;\r
             }\r
@@ -278,7 +277,7 @@ namespace Handbrake.Functions
         /// Get's HandBrakes version data from the CLI.\r
         /// </summary>\r
         /// <returns>Arraylist of Version Data. 0 = hb_version 1 = hb_build</returns>\r
-        public void setCliVersionData()\r
+        public static void setCliVersionData()\r
         {\r
             String line;\r
 \r
@@ -324,6 +323,10 @@ namespace Handbrake.Functions
                 MessageBox.Show("Unable to retrieve version information from the CLI. \nError:\n" + e);\r
             }\r
         }\r
+\r
+        /// <summary>\r
+        /// Search through the running processes on the system and kill HandBrakeCLI\r
+        /// </summary>\r
         private static void killCLI()\r
         {\r
             string AppName = "HandBrakeCLI";\r
@@ -346,7 +349,7 @@ namespace Handbrake.Functions
         /// If it does, it means the last queue did not complete before HandBrake closed.\r
         /// So, return a boolean if true. \r
         /// </summary>\r
-        public Boolean check_queue_recovery()\r
+        public static Boolean check_queue_recovery()\r
         {\r
             try\r
             {\r
index 53cc363..8fabbe6 100644 (file)
@@ -1,6 +1,5 @@
 using System;\r
 using System.Windows.Forms;\r
-using System.Drawing;\r
 \r
 namespace Handbrake.Functions\r
 {\r
@@ -20,7 +19,7 @@ namespace Handbrake.Functions
             // Setup the GUI\r
             // ---------------------------\r
 \r
-            #region source\r
+            #region Source\r
             // Reset some vaules to stock first to prevent errors.\r
             mainWindow.check_iPodAtom.CheckState = CheckState.Unchecked;\r
 \r
@@ -36,9 +35,7 @@ namespace Handbrake.Functions
 \r
             #endregion\r
 \r
-            #region destination\r
-\r
-            mainWindow.drp_videoEncoder.Text = presetQuery.VideoEncoder;\r
+            #region Destination and Output Settings\r
 \r
             if (presetQuery.Format != null)\r
             {\r
@@ -148,6 +145,8 @@ namespace Handbrake.Functions
             #endregion\r
 \r
             #region Video\r
+            mainWindow.drp_videoEncoder.Text = presetQuery.VideoEncoder;\r
+\r
             if (presetQuery.AverageVideoBitrate != null)\r
             {\r
                 mainWindow.radio_avgBitrate.Checked = true;\r
@@ -186,7 +185,7 @@ namespace Handbrake.Functions
                     // with a different granularity, so, round and try again.\r
                     if (value == 0)\r
                     {\r
-                        double val =  Math.Round(calculated, 0);\r
+                        double val = Math.Round(calculated, 0);\r
                         int.TryParse(val.ToString(), out value);\r
                     }\r
 \r
@@ -226,51 +225,17 @@ namespace Handbrake.Functions
             // Clear the audio listing\r
             mainWindow.lv_audioList.Items.Clear();\r
 \r
-            // Create a new row for the Audio list based on the currently selected items in the dropdown.\r
-            ListViewItem newTrack;\r
-            if (presetQuery.AudioTrack1 != "None")\r
-            {\r
-                newTrack = new ListViewItem("Automatic");\r
-                newTrack.SubItems.Add(presetQuery.AudioEncoder1);\r
-                newTrack.SubItems.Add(presetQuery.AudioTrackMix1);\r
-                newTrack.SubItems.Add(presetQuery.AudioSamplerate1);\r
-                newTrack.SubItems.Add(presetQuery.AudioBitrate1);\r
-                newTrack.SubItems.Add(presetQuery.DRC1.ToString());\r
-                mainWindow.lv_audioList.Items.Add(newTrack);\r
-            }\r
-\r
-            if (presetQuery.AudioTrack2 != "None")\r
-            {\r
-                newTrack = new ListViewItem("Automatic");\r
-                newTrack.SubItems.Add(presetQuery.AudioEncoder2);\r
-                newTrack.SubItems.Add(presetQuery.AudioTrackMix2);\r
-                newTrack.SubItems.Add(presetQuery.AudioSamplerate2);\r
-                newTrack.SubItems.Add(presetQuery.AudioBitrate2);\r
-                newTrack.SubItems.Add(presetQuery.DRC2.ToString());\r
-                mainWindow.lv_audioList.Items.Add(newTrack);\r
-            }\r
-\r
-            if (presetQuery.AudioTrack3 != "None")\r
-            {\r
-                newTrack = new ListViewItem("Automatic");\r
-                newTrack.SubItems.Add(presetQuery.AudioEncoder3);\r
-                newTrack.SubItems.Add(presetQuery.AudioTrackMix3);\r
-                newTrack.SubItems.Add(presetQuery.AudioSamplerate3);\r
-                newTrack.SubItems.Add(presetQuery.AudioBitrate3);\r
-                newTrack.SubItems.Add(presetQuery.DRC3.ToString());\r
-                mainWindow.lv_audioList.Items.Add(newTrack);\r
-            }\r
-\r
-            if (presetQuery.AudioTrack4 != "None")\r
-            {\r
-                newTrack = new ListViewItem("Automatic");\r
-                newTrack.SubItems.Add(presetQuery.AudioEncoder4);\r
-                newTrack.SubItems.Add(presetQuery.AudioTrackMix4);\r
-                newTrack.SubItems.Add(presetQuery.AudioSamplerate4);\r
-                newTrack.SubItems.Add(presetQuery.AudioBitrate4);\r
-                newTrack.SubItems.Add(presetQuery.DRC4.ToString());\r
-                mainWindow.lv_audioList.Items.Add(newTrack);\r
-            }\r
+            if (presetQuery.AudioInformation != null)\r
+                foreach (AudioTrack track in presetQuery.AudioInformation)\r
+                {\r
+                    ListViewItem newTrack = new ListViewItem("Automatic");\r
+                    newTrack.SubItems.Add(track.Encoder);\r
+                    newTrack.SubItems.Add(track.MixDown);\r
+                    newTrack.SubItems.Add(track.SampleRate);\r
+                    newTrack.SubItems.Add(track.Bitrate);\r
+                    newTrack.SubItems.Add(track.DRC);\r
+                    mainWindow.lv_audioList.Items.Add(newTrack);\r
+                }\r
 \r
             // Subtitle Stuff\r
             mainWindow.drp_subtitle.Text = presetQuery.Subtitles;\r
index c3f66fc..a78ce2d 100644 (file)
@@ -90,7 +90,7 @@ namespace Handbrake.Functions
         /// </summary>\r
         /// <param name="mainWindow"></param>\r
         /// <returns></returns>\r
-        public string generateTabbedComponentsQuery(frmMain mainWindow)\r
+        public static string generateTabbedComponentsQuery(frmMain mainWindow)\r
         {\r
             string query = "";\r
 \r
@@ -274,11 +274,11 @@ namespace Handbrake.Functions
 \r
                 // Sample Rate (-R)\r
                 if (row.SubItems[3].Text != String.Empty)\r
-                    samplerates.Add(row.SubItems[3].Text.Replace("Auto", "0"));\r
+                    samplerates.Add(row.SubItems[3].Text.Replace("Auto", "Auto"));\r
 \r
                 // Audio Bitrate (-B)\r
                 if (row.SubItems[4].Text != String.Empty)\r
-                    bitrates.Add(row.SubItems[4].Text.Replace("Auto", "0"));\r
+                    bitrates.Add(row.SubItems[4].Text.Replace("Auto", "auto"));\r
 \r
                 // DRC (-D)\r
                 if (row.SubItems[5].Text != String.Empty)\r
index 2e1f470..5557b51 100644 (file)
@@ -8,6 +8,7 @@ using System;
 using System.Globalization;\r
 using System.Text.RegularExpressions;\r
 using System.Windows.Forms;\r
+using System.Collections;\r
 \r
 namespace Handbrake.Functions\r
 {\r
@@ -50,7 +51,7 @@ namespace Handbrake.Functions
         public string DeInterlace { get; private set; }\r
         public string DeNoise { get; private set; }\r
         public string Decomb { get; private set; }\r
-        #endregion    \r
+        #endregion\r
 \r
         #region Video Settings\r
         public string VideoEncoder { get; private set; }\r
@@ -64,30 +65,7 @@ namespace Handbrake.Functions
         #endregion\r
 \r
         #region Audio Settings\r
-        public string AudioTrack1 { get; private set; }\r
-        public string AudioTrack2 { get; private set; }\r
-        public string AudioTrack3 { get; private set; }\r
-        public string AudioTrack4 { get; private set; }\r
-        public string AudioTrackMix1 { get; private set; }\r
-        public string AudioTrackMix2 { get; private set; }\r
-        public string AudioTrackMix3 { get; private set; }\r
-        public string AudioTrackMix4 { get; private set; }\r
-        public string AudioEncoder1 { get; private set; }\r
-        public string AudioEncoder2 { get; private set; }\r
-        public string AudioEncoder3 { get; private set; }\r
-        public string AudioEncoder4 { get; private set; }\r
-        public string AudioBitrate1 { get; private set; }\r
-        public string AudioBitrate2 { get; private set; }\r
-        public string AudioBitrate3 { get; private set; }\r
-        public string AudioBitrate4 { get; private set; }\r
-        public string AudioSamplerate1 { get; private set; }\r
-        public string AudioSamplerate2 { get; private set; }\r
-        public string AudioSamplerate3 { get; private set; }\r
-        public string AudioSamplerate4 { get; private set; }\r
-        public double DRC1 { get; private set; }\r
-        public double DRC2 { get; private set; }\r
-        public double DRC3 { get; private set; }\r
-        public double DRC4 { get; private set; }\r
+        public ArrayList AudioInformation { get; private set; }\r
         public string Subtitles { get; private set; }\r
         public Boolean ForcedSubtitles { get; private set; }\r
         #endregion\r
@@ -103,7 +81,6 @@ namespace Handbrake.Functions
 \r
         #endregion\r
 \r
-        // All the Main Window GUI options\r
         /// <summary>\r
         /// Takes in a query which can be in any order and parses it. \r
         /// All varibles are then set so they can be used elsewhere.\r
@@ -123,7 +100,7 @@ namespace Handbrake.Functions
             //Source\r
             Match title = Regex.Match(input, @"-t ([0-9]*)");\r
             Match chapters = Regex.Match(input, @"-c ([0-9-]*)");\r
-           \r
+\r
             //Output Settings\r
             Match format = Regex.Match(input, @"-f ([a-z0-9a-z0-9a-z0-9]*)");\r
             Match grayscale = Regex.Match(input, @" -g");\r
@@ -160,35 +137,12 @@ namespace Handbrake.Functions
 \r
             //Audio Settings Tab\r
             Match noAudio = Regex.Match(input, @"-a none");\r
-            Match audioTrack1 = Regex.Match(input, @"-a ([0-9]*)");\r
-            Match audioTrack2 = Regex.Match(input, @"-a ([0-9]*),([0-9]*)");\r
-            Match audioTrack3 = Regex.Match(input, @"-a ([0-9]*),([0-9]*),([0-9]*)");\r
-            Match audioTrack4 = Regex.Match(input, @"-a ([0-9]*),([0-9]*),([0-9]*),([0-9]*)");\r
-\r
-            Match audioTrack1Mix = Regex.Match(input, @"-6 ([0-9a-z]*)");\r
-            Match audioTrack2Mix = Regex.Match(input, @"-6 ([0-9a-z]*),([0-9a-z]*)");\r
-            Match audioTrack3Mix = Regex.Match(input, @"-6 ([0-9a-z]*),([0-9a-z]*),([0-9a-z]*)");\r
-            Match audioTrack4Mix = Regex.Match(input, @"-6 ([0-9a-z]*),([0-9a-z]*),([0-9a-z]*),([0-9a-z]*)");\r
-\r
-            Match audioEncoder1 = Regex.Match(input, @"-E ([a-zA-Z0-9+]*)");\r
-            Match audioEncoder2 = Regex.Match(input, @"-E ([a-zA-Z0-9+]*),([a-zA-Z0-9+]*)");\r
-            Match audioEncoder3 = Regex.Match(input, @"-E ([a-zA-Z0-9+]*),([a-zA-Z0-9+]*),([a-zA-Z0-9+]*)");\r
-            Match audioEncoder4 = Regex.Match(input, @"-E ([a-zA-Z0-9+]*),([a-zA-Z0-9+]*),([a-zA-Z0-9+]*),([a-zA-Z0-9+]*)");\r
-\r
-            Match audioBitrate1 = Regex.Match(input, @"-B ([0-9auto]*)");\r
-            Match audioBitrate2 = Regex.Match(input, @"-B ([0-9auto]*),([0-9auto]*)");\r
-            Match audioBitrate3 = Regex.Match(input, @"-B ([0-9auto]*),([0-9auto]*),([0-9auto]*)");\r
-            Match audioBitrate4 = Regex.Match(input, @"-B ([0-9auto]*),([0-9auto]*),([0-9auto]*),([0-9auto]*)");\r
-\r
-            Match audioSampleRate1 = Regex.Match(input, @"-R ([0-9Auto.]*)");\r
-            Match audioSampleRate2 = Regex.Match(input, @"-R ([0-9Auto.]*),([0-9Auto.]*)");\r
-            Match audioSampleRate3 = Regex.Match(input, @"-R ([0-9Auto.]*),([0-9Auto.]*),([0-9Auto.]*)");\r
-            Match audioSampleRate4 = Regex.Match(input, @"-R ([0-9Auto.]*),([0-9Auto.]*),([0-9Auto.]*),([0-9Auto.]*)");\r
-\r
-            Match drc1 = Regex.Match(input, @"-D ([0-9.]*)");\r
-            Match drc2 = Regex.Match(input, @"-D ([0-9.]*),([0-9.]*)");\r
-            Match drc3 = Regex.Match(input, @"-D ([0-9.]*),([0-9.]*),([0-9.]*)");\r
-            Match drc4 = Regex.Match(input, @"-D ([0-9.]*),([0-9.]*),([0-9.]*),([0-9.]*)");\r
+            Match audioTracks = Regex.Match(input, @"-a ([0-9,]*)");\r
+            Match audioTrackMixes = Regex.Match(input, @"-6 ([0-9a-zA-Z,]*)");\r
+            Match audioEncoders = Regex.Match(input, @"-E ([a-zA-Z0-9+,]*)");\r
+            Match audioBitrates = Regex.Match(input, @"-B ([0-9a-zA-Z,]*)");       // Auto = a-z\r
+            Match audioSampleRates = Regex.Match(input, @"-R ([0-9a-zA-Z.,]*)");  // Auto = a-z\r
+            Match drcValues = Regex.Match(input, @"-D ([0-9.,]*)");\r
 \r
             Match subtitles = Regex.Match(input, @"-s ([0-9a-zA-Z]*)");\r
             Match subScan = Regex.Match(input, @" -U");\r
@@ -262,7 +216,7 @@ namespace Handbrake.Functions
                     thisQuery.CropLeft = actCropValues[2];\r
                     thisQuery.CropRight = actCropValues[3];\r
                 }\r
-                \r
+\r
                 thisQuery.Anamorphic = anamorphic.Success;\r
                 thisQuery.LooseAnamorphic = lanamorphic.Success;\r
 \r
@@ -336,7 +290,7 @@ namespace Handbrake.Functions
                 thisQuery.Grayscale = grayscale.Success;\r
                 thisQuery.TwoPass = twoPass.Success;\r
                 thisQuery.TurboFirstPass = turboFirstPass.Success;\r
-                \r
+\r
                 if (videoBitrate.Success)\r
                     thisQuery.AverageVideoBitrate = videoBitrate.ToString().Replace("-b ", "");\r
                 if (videoFilesize.Success)\r
@@ -344,194 +298,74 @@ namespace Handbrake.Functions
 \r
                 if (videoQuality.Success)\r
                 {\r
-                   float qConvert = float.Parse(videoQuality.ToString().Replace("-q ", ""), Culture);\r
+                    float qConvert = float.Parse(videoQuality.ToString().Replace("-q ", ""), Culture);\r
                     //qConvert = Math.Ceiling(qConvert);\r
                     thisQuery.VideoQuality = qConvert;\r
                 }\r
                 #endregion\r
 \r
                 #region Audio Tab\r
-\r
-                // Tracks\r
-                if (noAudio.Success)\r
-                    thisQuery.AudioTrack1 = "None";\r
-                else if (audioTrack1.Success)\r
-                    thisQuery.AudioTrack1 = "Automatic";\r
-\r
-                if (audioTrack2.Success)\r
-                {\r
-                    string[] audioChan = audioTrack2.ToString().Split(',');\r
-                    thisQuery.AudioTrack2 = audioChan[1];\r
-                }\r
-                else\r
-                    thisQuery.AudioTrack2 = "None";\r
-\r
-                if (audioTrack3.Success)\r
-                {\r
-                    string[] audioChan = audioTrack3.ToString().Split(',');\r
-                    thisQuery.AudioTrack3 = audioChan[2];\r
-                }\r
-                else\r
-                    thisQuery.AudioTrack3 = "None";\r
-\r
-                if (audioTrack4.Success)\r
-                {\r
-                    string[] audioChan = audioTrack4.ToString().Split(',');\r
-                    thisQuery.AudioTrack4 = audioChan[3];\r
-                }\r
-                else\r
-                    thisQuery.AudioTrack4 = "None";\r
-\r
-\r
-                // Mixdowns\r
-                thisQuery.AudioTrackMix1 = "Automatic";\r
-                if (audioTrack1Mix.Success)\r
-                    thisQuery.AudioTrackMix1 =\r
-                        getMixDown(audioTrack1Mix.ToString().Replace("-6 ", "").Replace(" ", ""));\r
-\r
-                thisQuery.AudioTrackMix2 = "Automatic";\r
-                if (audioTrack2Mix.Success)\r
-                {\r
-                    string[] audio2mix = audioTrack2Mix.ToString().Split(',');\r
-                    thisQuery.AudioTrackMix2 = getMixDown(audio2mix[1].Trim());\r
-                }\r
-\r
-                thisQuery.AudioTrackMix3 = "Automatic";\r
-                if (audioTrack3Mix.Success)\r
-                {\r
-                    string[] audio3mix = audioTrack3Mix.ToString().Split(',');\r
-                    thisQuery.AudioTrackMix3 = getMixDown(audio3mix[2].Trim());\r
-                }\r
-\r
-                thisQuery.AudioTrackMix4 = "Automatic";\r
-                if (audioTrack4Mix.Success)\r
-                {\r
-                    string[] audio4mix = audioTrack4Mix.ToString().Split(',');\r
-                    thisQuery.AudioTrackMix4 = getMixDown(audio4mix[3].Trim());\r
-                }\r
-\r
-\r
-                // Audio Encoders\r
-                if (audioEncoder1.Success)\r
-                    thisQuery.AudioEncoder1 = getAudioEncoder(audioEncoder1.ToString().Replace("-E ", ""));\r
-\r
-                if (audioEncoder2.Success)\r
-                {\r
-                    string[] audio2enc = audioEncoder2.ToString().Split(',');\r
-                    thisQuery.AudioEncoder2 = getAudioEncoder(audio2enc[1].Trim());\r
-                }\r
-\r
-                if (audioEncoder3.Success)\r
-                {\r
-                    string[] audio3enc = audioEncoder3.ToString().Split(',');\r
-                    thisQuery.AudioEncoder3 = getAudioEncoder(audio3enc[2].Trim());\r
-                }\r
-\r
-                if (audioEncoder4.Success)\r
+                // Find out how many tracks we need to add by checking how many encoders or audio tracks are selected.\r
+                int encoderCount = 0;\r
+                if (audioEncoders.Success)\r
                 {\r
-                    string[] audio4enc = audioEncoder4.ToString().Split(',');\r
-                    thisQuery.AudioEncoder4 = getAudioEncoder(audio4enc[3].Trim());\r
+                    string[] audioDataCounters = audioEncoders.ToString().Replace("-E ", "").Split(',');\r
+                    encoderCount = audioDataCounters.Length;\r
                 }\r
 \r
-\r
-                // Audio Bitrate\r
-                thisQuery.AudioBitrate1 = "";\r
-                if (audioBitrate1.Success)\r
+                // Get the data from the regular expression results\r
+                string[] trackData = null;\r
+                string[] trackMixes = null;\r
+                string[] trackEncoders = null;\r
+                string[] trackBitrates = null;\r
+                string[] trackSamplerates = null;\r
+                string[] trackDRCvalues = null;\r
+\r
+                if (audioTracks.Success)\r
+                    trackData = audioTracks.ToString().Replace("-a ", "").Split(',');\r
+                if (audioTrackMixes.Success)\r
+                    trackMixes = audioTrackMixes.ToString().Replace("-6 ", "").Split(',');\r
+                if (audioEncoders.Success)\r
+                    trackEncoders = audioEncoders.ToString().Replace("-E ", "").Split(',');\r
+                if (audioBitrates.Success)\r
+                    trackBitrates = audioBitrates.ToString().Replace("-B ", "").Split(',');\r
+                if (audioSampleRates.Success)\r
+                    trackSamplerates = audioSampleRates.ToString().Replace("-R ", "").Split(',');\r
+                if (drcValues.Success)\r
+                    trackDRCvalues = drcValues.ToString().Replace("-D ", "").Split(',');\r
+\r
+                // Create new Audio Track Classes and store them in the ArrayList\r
+                ArrayList AllAudioTrackInfo = new ArrayList();\r
+                for (int x = 0; x < encoderCount; x++)\r
                 {\r
-                    thisQuery.AudioBitrate1 = audioBitrate1.ToString().Replace("-B ", "").Trim();\r
-                    if (audioBitrate1.ToString().Replace("-B ", "").Trim() == "0") thisQuery.AudioBitrate1 = "Auto";\r
-                }\r
+                    AudioTrack track = new AudioTrack();\r
+                    if (trackData != null)\r
+                        if (trackData.Length >= (x + 1))                         // Audio Track\r
+                            track.Track = trackData[x].Trim();\r
 \r
-                thisQuery.AudioBitrate2 = "";\r
-                if (audioBitrate2.Success && audioTrack2.Success)\r
-                {\r
-                    string[] audioBitrateSelect = audioBitrate2.ToString().Split(',');\r
-                    if (audioBitrateSelect[1].Trim() == "0") audioBitrateSelect[1] = "Auto";\r
-                    thisQuery.AudioBitrate2 = audioBitrateSelect[1].Trim();\r
-                }\r
+                    if (trackMixes != null)\r
+                        if (trackMixes.Length >= (x + 1))                        // Audio Mix\r
+                            track.MixDown = getMixDown(trackMixes[x].Trim());\r
 \r
-                thisQuery.AudioBitrate3 = "";\r
-                if (audioBitrate3.Success && audioTrack3.Success)\r
-                {\r
-                    string[] audioBitrateSelect = audioBitrate3.ToString().Split(',');\r
-                    if (audioBitrateSelect[2].Trim() == "0") audioBitrateSelect[2] = "Auto";\r
-                    thisQuery.AudioBitrate3 = audioBitrateSelect[2].Trim();\r
-                }\r
+                    if (trackEncoders != null)\r
+                        if (trackEncoders.Length >= (x + 1))                     // Audio Mix\r
+                            track.Encoder = getAudioEncoder(trackEncoders[x].Trim());\r
 \r
-                thisQuery.AudioBitrate4 = "";\r
-                if (audioBitrate4.Success)\r
-                {\r
-                    string[] audioBitrateSelect = audioBitrate4.ToString().Split(',');\r
-                    if (audioBitrateSelect[3].Trim() == "0") audioBitrateSelect[3] = "Auto";\r
-                    thisQuery.AudioBitrate4 = audioBitrateSelect[3].Trim();\r
-                }\r
+                    if (trackBitrates != null)\r
+                        if (trackBitrates.Length >= (x + 1))                     // Audio Encoder\r
+                            track.Bitrate = trackBitrates[x].Trim() == "auto" ? "Auto" : trackBitrates[x].Trim();\r
 \r
+                    if (trackSamplerates != null)\r
+                        if (trackSamplerates.Length >= (x + 1))                  // Audio SampleRate\r
+                            track.SampleRate = trackSamplerates[x].Trim() == "0" ? "Auto" : trackSamplerates[x].Trim();\r
 \r
-                // Audio Sample Rate\r
-                // Make sure to change 0 to Auto\r
-                thisQuery.AudioSamplerate1 = "Auto";\r
-                if (audioSampleRate1.Success)\r
-                {\r
-                    thisQuery.AudioSamplerate1 = audioSampleRate1.ToString().Replace("-R ", "").Trim();\r
-                    if (thisQuery.AudioSamplerate1 == "0") thisQuery.AudioSamplerate1 = "Auto";\r
-                }\r
+                    if (trackDRCvalues != null)\r
+                        if (trackDRCvalues.Length >= (x + 1))                   // Audio DRC Values\r
+                            track.DRC = trackDRCvalues[x].Trim();\r
 \r
-\r
-                if (audioSampleRate2.Success)\r
-                {\r
-                    string[] audioSRSelect = audioSampleRate2.ToString().Split(',');\r
-                    if (audioSRSelect[1] == "0") audioSRSelect[1] = "Auto";\r
-                    thisQuery.AudioSamplerate2 = audioSRSelect[1].Trim();\r
-                }\r
-\r
-                if (audioSampleRate3.Success)\r
-                {\r
-                    string[] audioSRSelect = audioSampleRate3.ToString().Split(',');\r
-                    if (audioSRSelect[2] == "0") audioSRSelect[2] = "Auto";\r
-                    thisQuery.AudioSamplerate3 = audioSRSelect[2].Trim();\r
-                }\r
-\r
-                if (audioSampleRate4.Success)\r
-                {\r
-                    string[] audioSRSelect = audioSampleRate4.ToString().Split(',');\r
-                    if (audioSRSelect[3] == "0") audioSRSelect[3] = "Auto";\r
-                    thisQuery.AudioSamplerate4 = audioSRSelect[3].Trim();\r
-                }\r
-\r
-                // DRC\r
-                float drcValue;\r
-\r
-                thisQuery.DRC1 = 1;\r
-                if (drc1.Success)\r
-                {\r
-                    string value = drc1.ToString().Replace("-D ", "");\r
-                    float.TryParse(value, out drcValue);\r
-                    thisQuery.DRC1 = drcValue;\r
-                }\r
-\r
-                thisQuery.DRC2 = 1;\r
-                if (drc2.Success)\r
-                {\r
-                    string[] drcPoint = drc2.ToString().Split(',');\r
-                    float.TryParse(drcPoint[1], out drcValue);\r
-                    thisQuery.DRC2 = drcValue;\r
-                }\r
-\r
-                thisQuery.DRC3 = 1;\r
-                if (drc3.Success)\r
-                {\r
-                    string[] drcPoint = drc3.ToString().Split(',');\r
-                    float.TryParse(drcPoint[2], out drcValue);\r
-                    thisQuery.DRC3 = drcValue;\r
-                }\r
-\r
-                thisQuery.DRC4 = 1;\r
-                if (drc4.Success)\r
-                {\r
-                    string[] drcPoint = drc4.ToString().Split(',');\r
-                    float.TryParse(drcPoint[3], out drcValue);\r
-                    thisQuery.DRC4 = drcValue;\r
+                    AllAudioTrackInfo.Add(track);\r
                 }\r
+                thisQuery.AudioInformation = AllAudioTrackInfo;\r
 \r
                 // Subtitle Stuff\r
                 if (subtitles.Success)\r
@@ -540,7 +374,6 @@ namespace Handbrake.Functions
                     thisQuery.Subtitles = subScan.Success ? "Autoselect" : "None";\r
 \r
                 thisQuery.ForcedSubtitles = forcedSubtitles.Success;\r
-\r
                 #endregion\r
 \r
                 #region Chapters Tab\r
@@ -604,4 +437,23 @@ namespace Handbrake.Functions
             }\r
         }\r
     }\r
+\r
+    public class AudioTrack\r
+    {\r
+        public AudioTrack()\r
+        {\r
+            // Default Values\r
+            Track = "Automatic";\r
+            MixDown = "Automatic";\r
+            SampleRate = "Auto";\r
+            Bitrate = "Auto";\r
+            DRC = "1";\r
+        }\r
+        public string Track { get; set; }\r
+        public string MixDown { get; set; }\r
+        public string Encoder { get; set; }\r
+        public string Bitrate { get; set; }\r
+        public string SampleRate { get; set; }\r
+        public string DRC { get; set; }\r
+    }\r
 }
\ No newline at end of file
index 9d50b94..e8bba46 100644 (file)
@@ -18,7 +18,7 @@
     <UpgradeBackupLocation>\r
     </UpgradeBackupLocation>\r
     <OldToolsVersion>2.0</OldToolsVersion>\r
-    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>\r
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>\r
     <IsWebBootstrapper>false</IsWebBootstrapper>\r
     <SignManifests>false</SignManifests>\r
     <PublishUrl>publish\</PublishUrl>\r
     <PlatformTarget>x86</PlatformTarget>\r
   </PropertyGroup>\r
   <ItemGroup>\r
+    <Reference Include="PresentationCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=x86" />\r
+    <Reference Include="PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />\r
     <Reference Include="System" />\r
+    <Reference Include="System.Core" />\r
     <Reference Include="System.Data" />\r
     <Reference Include="System.Deployment" />\r
     <Reference Include="System.Design" />\r
     <Reference Include="System.Messaging" />\r
     <Reference Include="System.Windows.Forms" />\r
     <Reference Include="System.XML" />\r
+    <Reference Include="UIAutomationProvider, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />\r
+    <Reference Include="WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />\r
+    <Reference Include="WindowsFormsIntegration, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />\r
   </ItemGroup>\r
   <ItemGroup>\r
     <Compile Include="Controls\Denoise.cs">\r
index bb24dd5..4b1e7de 100644 (file)
@@ -8,11 +8,13 @@
 \r
 ; HM NIS Edit Wizard helper defines\r
 !define PRODUCT_NAME "Handbrake"\r
-!define PRODUCT_VERSION "0.9.1"\r
+!define PRODUCT_VERSION "0.9.4"\r
 !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\Handbrake.exe"\r
 !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"\r
 !define PRODUCT_UNINST_ROOT_KEY "HKLM"\r
 \r
+SetCompressor lzma\r
+\r
 ; MUI 1.67 compatible ------\r
 !include "MUI.nsh"\r
 \r
@@ -53,7 +55,7 @@ Function .onInit
   Call GetDotNETVersion\r
   Pop $0\r
   ${If} $0 == "not found"\r
-    MessageBox MB_OK|MB_ICONSTOP ".NET runtime library is not installed. $\r$\n You can download .Net Framework 2 from the microsoft website. $\r$\n Alternatively you can use google for a direct download URL"\r
+    MessageBox MB_OK|MB_ICONSTOP ".NET runtime library is not installed. $\r$\n You can download .Net Framework 3.5 from the microsoft website. $\r$\n Alternatively you can use google for a direct download URL"\r
     Abort\r
   ${EndIf}\r
 \r
@@ -61,7 +63,7 @@ Function .onInit
 \r
   ${VersionCompare} $0 "2.0" $1\r
   ${If} $1 == 2\r
-    MessageBox MB_OK|MB_ICONSTOP ".NET runtime library v2.0 or newer is required. You have $0. $\r$\n You can download .Net Framework 2 from the microsoft website. $\r$\n Alternatively you can use google for a direct download URL"\r
+    MessageBox MB_OK|MB_ICONSTOP ".NET runtime library v3.5 or newer is required. You have $0. $\r$\n You can download .Net Framework 3.5 from the Microsoft website. $\r$\n Alternatively you can use google for a direct download URL"\r
     Abort\r
   ${EndIf}\r
 FunctionEnd\r
@@ -91,11 +93,14 @@ Section "Handbrake" SEC01
   CreateDirectory "$SMPROGRAMS\Handbrake"\r
   CreateShortCut "$SMPROGRAMS\Handbrake\Handbrake.lnk" "$INSTDIR\Handbrake.exe"\r
   CreateShortCut "$DESKTOP\Handbrake.lnk" "$INSTDIR\Handbrake.exe"\r
-  File "dvdinfo.dat"\r
-  File "cygwin1.dll"\r
-  File "hbcli.exe"\r
+  File "Interop.QTOLibrary.dll"\r
+  File "Interop.QTOControlLib.dll"\r
+  File "AxInterop.QTOControlLib.dll"\r
+  File "HandBrakeCLI.exe"\r
   File "Handbrake.exe.config"\r
   File "handbrakepineapple.ico"\r
+  File "presets.xml"\r
+  File "user_presets.xml"\r
   \r
   SetOutPath "$INSTDIR\doc"\r
   SetOverwrite ifnewer\r
@@ -134,12 +139,16 @@ FunctionEnd
 \r
 Section Uninstall\r
   Delete "$INSTDIR\uninst.exe"\r
+  \r
+  Delete "$INSTDIR\Interop.QTOLibrary.dll"\r
+  Delete "$INSTDIR\Interop.QTOControlLib.dll"\r
+  Delete "$INSTDIR\AxInterop.QTOControlLib.dll"\r
+  Delete "$INSTDIR\HandBrakeCLI.exe"\r
   Delete "$INSTDIR\handbrakepineapple.ico"\r
-  Delete "$INSTDIR\hbcli.exe"\r
-  Delete "$INSTDIR\cygwin1.dll"\r
-  Delete "$INSTDIR\dvdinfo.dat"\r
   Delete "$INSTDIR\Handbrake.exe"\r
   Delete "$INSTDIR\Handbrake.exe.config"\r
+  Delete "$INSTDIR\presets.xml"\r
+  Delete "$INSTDIR\user_presets.xml"\r
   Delete "$INSTDIR\doc\AUTHORS"\r
   Delete "$INSTDIR\doc\BUILD"\r
   Delete "$INSTDIR\doc\COPYING"\r
@@ -147,12 +156,12 @@ Section Uninstall
   Delete "$INSTDIR\doc\NEWS"\r
   Delete "$INSTDIR\doc\THANKS"\r
   Delete "$INSTDIR\doc\TRANSLATIONS"\r
-\r
+  RMDir  "$INSTDIR"\r
   Delete "$SMPROGRAMS\Handbrake\Uninstall.lnk"\r
   Delete "$DESKTOP\Handbrake.lnk"\r
   Delete "$SMPROGRAMS\Handbrake\Handbrake.lnk"\r
-  RMDir "$SMPROGRAMS\Handbrake"\r
-  RMDir "$INSTDIR"\r
+  RMDir  "$SMPROGRAMS\Handbrake"\r
+  RMDir  "$INSTDIR"\r
 \r
   DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"\r
   DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"\r
index cee6dfa..885a369 100644 (file)
@@ -22,10 +22,10 @@ namespace Handbrake
             try\r
             {\r
                 // Make sure the screen resolution is not below 1024x768\r
-                System.Windows.Forms.Screen scr = Screen.PrimaryScreen;\r
+                Screen scr = Screen.PrimaryScreen;\r
                 if ((scr.Bounds.Width < 1024) || (scr.Bounds.Height < 720))\r
                 {\r
-                    MessageBox.Show("Your system does not meet the minimum requirements for HandBrake. \n" + "Your screen is running at: " + scr.Bounds.Width + "x" + scr.Bounds.Height.ToString() + " \nScreen resolution is too Low. Must be 1024x720 or greater", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);\r
+                    MessageBox.Show("Your system does not meet the minimum requirements for HandBrake. \n" + "Your screen is running at: " + scr.Bounds.Width + "x" + scr.Bounds.Height + " \nScreen resolution is too Low. Must be 1024x720 or greater", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);\r
                     launch = false;\r
                 }\r
             }\r
index 945a2ae..f5f3460 100644 (file)
@@ -11,15 +11,16 @@ using System.Windows.Forms;
 using System.Xml.Serialization;\r
 using System.Threading;\r
 using System.Diagnostics;\r
+using Handbrake.Functions;\r
 \r
 namespace Handbrake.Queue\r
 {\r
     public class QueueHandler\r
     {\r
+        readonly Encode encodeHandler = new Encode();\r
         private static XmlSerializer ser = new XmlSerializer(typeof(List<QueueItem>));\r
         List<QueueItem> queue = new List<QueueItem>();\r
         int id; // Unique identifer number for each job\r
-        private QueueItem lastItem;\r
 \r
         #region Queue Handling\r
         public List<QueueItem> getQueue()\r
@@ -31,11 +32,11 @@ namespace Handbrake.Queue
         /// Get's the next CLI query for encoding\r
         /// </summary>\r
         /// <returns>String</returns>\r
-        public string getNextItemForEncoding()\r
+        private string getNextItemForEncoding()\r
         {\r
             QueueItem job = queue[0];\r
             String query = job.Query;\r
-            lastItem = job;\r
+            lastQueueItem = job;\r
             remove(0);    // Remove the item which we are about to pass out.\r
             return query;\r
         }\r
@@ -44,10 +45,7 @@ namespace Handbrake.Queue
         /// Get the last query that was returned by getNextItemForEncoding()\r
         /// </summary>\r
         /// <returns></returns>\r
-        public QueueItem getLastQueryItem()\r
-        {\r
-            return lastItem;\r
-        }\r
+        public QueueItem lastQueueItem { get; set; }    \r
 \r
         /// <summary>\r
         /// Add's a new item to the queue\r
@@ -72,7 +70,6 @@ namespace Handbrake.Queue
         {\r
             foreach (QueueItem checkItem in queue)\r
             {\r
-\r
                 if (checkItem.Destination.Contains(destination.Replace("\\\\", "\\")))\r
                     return true;\r
             }\r
@@ -84,10 +81,9 @@ namespace Handbrake.Queue
         /// </summary>\r
         /// <param name="index">Index</param>\r
         /// <returns>Bolean true if successful</returns>\r
-        public Boolean remove(int index)\r
+        public void remove(int index)\r
         {\r
             queue.RemoveAt(index);\r
-            return true;\r
         }\r
 \r
         /// <summary>\r
@@ -135,11 +131,7 @@ namespace Handbrake.Queue
         /// </summary>\r
         public void write2disk(string file)\r
         {\r
-            string tempPath;\r
-            if (file == "hb_queue_recovery.xml")\r
-                tempPath = Path.Combine(Path.GetTempPath(), "hb_queue_recovery.xml");\r
-            else\r
-                tempPath = file;\r
+            string tempPath = file == "hb_queue_recovery.xml" ? Path.Combine(Path.GetTempPath(), "hb_queue_recovery.xml") : file;\r
 \r
             try\r
             {\r
@@ -227,37 +219,22 @@ namespace Handbrake.Queue
         }\r
         #endregion\r
 \r
-        //------------------------------------------------------------------------\r
-        Functions.Encode encodeHandler = new Functions.Encode();\r
-        private Boolean started = false;\r
-        private Boolean paused;\r
-        private Boolean encoding;\r
-\r
         #region Encoding\r
 \r
-        public Boolean isEncodeStarted\r
-        {\r
-            get { return started; }\r
-        }\r
-        public Boolean isPaused\r
-        {\r
-            get { return paused; }\r
-        }\r
-        public Boolean isEncoding\r
-        {\r
-            get { return encoding; }\r
-        }\r
+        public Boolean isEncodeStarted { get; private set; }\r
+        public Boolean isPaused { get; private set; }\r
+        public Boolean isEncoding { get; private set; }\r
 \r
         public void startEncode()\r
         {\r
             Thread theQueue;\r
             if (this.count() != 0)\r
             {\r
-                if (paused)\r
-                    paused = false;\r
+                if (isPaused)\r
+                    isPaused = false;\r
                 else\r
                 {\r
-                    paused = false;\r
+                    isPaused = false;\r
                     try\r
                     {\r
                         theQueue = new Thread(startProc) {IsBackground = true};\r
@@ -272,7 +249,7 @@ namespace Handbrake.Queue
         }\r
         public void pauseEncode()\r
         {\r
-            paused = true;\r
+            isPaused = true;\r
             EncodePaused(null);\r
         }\r
 \r
@@ -288,17 +265,17 @@ namespace Handbrake.Queue
                     write2disk("hb_queue_recovery.xml"); // Update the queue recovery file\r
 \r
                     EncodeStarted(null);\r
-                    hbProc = encodeHandler.runCli(this, query);\r
+                    hbProc = encodeHandler.runCli(query);\r
                     hbProc.WaitForExit();\r
 \r
                     encodeHandler.addCLIQueryToLog(query);\r
-                    encodeHandler.copyLog(query, getLastQueryItem().Destination);\r
+                    encodeHandler.copyLog(lastQueueItem.Destination);\r
 \r
                     hbProc.Close();\r
                     hbProc.Dispose();\r
                     EncodeFinished(null);\r
 \r
-                    while (paused) // Need to find a better way of doing this.\r
+                    while (isPaused) // Need to find a better way of doing this.\r
                     {\r
                         Thread.Sleep(10000);\r
                     }\r
@@ -327,7 +304,7 @@ namespace Handbrake.Queue
             if (OnEncodeStart != null)\r
                 OnEncodeStart(this, e);\r
 \r
-            encoding = true;\r
+            isEncoding = true;\r
         }\r
         protected virtual void EncodePaused(EventArgs e)\r
         {\r
@@ -339,7 +316,7 @@ namespace Handbrake.Queue
             if (OnEncodeEnded != null)\r
                 OnEncodeEnded(this, e);\r
 \r
-            encoding = false;\r
+            isEncoding = false;\r
         }\r
         protected virtual void EncodeQueueFinished(EventArgs e)\r
         {\r
index 5c14e41..b1fa0da 100644 (file)
@@ -20,23 +20,23 @@ namespace Handbrake
         delegate void SetTextCallback(string text);\r
         String read_file;\r
         Thread monitor;\r
-        Functions.Encode encodeHandler;\r
+        Queue.QueueHandler encodeQueue;\r
         int position;  // Position in the arraylist reached by the current log output in the rtf box.\r
 \r
         /// <summary>\r
         /// This window should be used to display the RAW output of the handbrake CLI which is produced during an encode.\r
         /// </summary>\r
-        public frmActivityWindow(string file, Functions.Encode eh)\r
+        public frmActivityWindow(string file, Queue.QueueHandler eh)\r
         {\r
             InitializeComponent();\r
-            this.rtf_actLog.Text = string.Empty;\r
 \r
-            // When the window closes, we want to abort the monitor thread.\r
-            this.Disposed += new EventHandler(forceQuit);\r
-\r
-            encodeHandler = eh;\r
+            rtf_actLog.Text = string.Empty;\r
+            encodeQueue = eh;\r
             read_file = file;\r
             position = 0;\r
+            \r
+            // When the window closes, we want to abort the monitor thread.\r
+            this.Disposed += new EventHandler(forceQuit);\r
 \r
             // Print the Log header in the Rich text box.\r
             displayLogHeader();\r
@@ -47,7 +47,7 @@ namespace Handbrake
                 txt_log.Text = "Encode Log";\r
 \r
             // Start a new thread which will montior and keep the log window up to date if required/\r
-            startLogThread(read_file);            \r
+            startLogThread(read_file);\r
         }\r
 \r
         /// <summary>\r
@@ -65,6 +65,11 @@ namespace Handbrake
             rtf_actLog.AppendText(String.Format("### Install Dir: {0} \n", Application.StartupPath));\r
             rtf_actLog.AppendText(String.Format("### Data Dir: {0} \n", Application.UserAppDataPath));\r
             rtf_actLog.AppendText("#########################################\n\n");\r
+            if (encodeQueue.isEncoding && encodeQueue.lastQueueItem.Query != String.Empty)\r
+            {\r
+                rtf_actLog.AppendText("### CLI Query: " + encodeQueue.lastQueueItem.Query + "\n\n");\r
+                rtf_actLog.AppendText("#########################################\n\n");\r
+            }\r
         }\r
 \r
         /// <summary>\r
@@ -94,54 +99,6 @@ namespace Handbrake
         }\r
 \r
         /// <summary>\r
-        /// Change the log file to be displayed to hb_encode_log.dat\r
-        /// </summary>\r
-        /// <param name="sender"></param>\r
-        /// <param name="e"></param>\r
-        private void btn_scan_log_Click(object sender, EventArgs e)\r
-        {\r
-            if (monitor != null)\r
-                monitor.Abort();\r
-\r
-            rtf_actLog.Clear();\r
-            read_file = "dvdinfo.dat";\r
-            displayLogHeader();\r
-            startLogThread(read_file);\r
-            txt_log.Text = "Scan Log";\r
-        }\r
-\r
-        /// <summary>\r
-        /// Change the log file to be displayed to dvdinfo.dat\r
-        /// </summary>\r
-        /// <param name="sender"></param>\r
-        /// <param name="e"></param>\r
-        private void btn_encode_log_Click(object sender, EventArgs e)\r
-        {\r
-            if (monitor != null)\r
-                monitor.Abort();\r
-\r
-            rtf_actLog.Clear();\r
-            read_file = "hb_encode_log.dat";\r
-            position = 0;\r
-            displayLogHeader();\r
-            startLogThread(read_file);\r
-            txt_log.Text = "Encode Log";\r
-        }\r
-\r
-        /// <summary>\r
-        /// Copy to Clipboard\r
-        /// </summary>\r
-        /// <param name="sender"></param>\r
-        /// <param name="e"></param>\r
-        private void btn_copy_Click(object sender, EventArgs e)\r
-        {\r
-            if (rtf_actLog.SelectedText != "")\r
-                Clipboard.SetDataObject(rtf_actLog.SelectedText, true);\r
-            else\r
-                Clipboard.SetDataObject(rtf_actLog.Text, true);\r
-        }\r
-\r
-        /// <summary>\r
         /// Updates the log window with any new data which is in the log file.\r
         /// This is done every 5 seconds.\r
         /// </summary>\r
@@ -154,7 +111,7 @@ namespace Handbrake
                 updateTextFromThread();\r
                 while (true)\r
                 {\r
-                    if (encodeHandler.isEncoding)\r
+                    if (encodeQueue.isEncoding)\r
                         updateTextFromThread();\r
                     else\r
                     {\r
@@ -186,19 +143,11 @@ namespace Handbrake
         {\r
             try\r
             {\r
-                string text;\r
-                List<string> data = readFile();\r
-                int count = data.Count;\r
+                String info = readFile();\r
+                if (info.Contains("has exited"))\r
+                    info += "\n ############ End of Log ############## \n";\r
 \r
-                while (position < count)\r
-                {\r
-                    text = data[position];\r
-                    if (data[position].Contains("has exited"))\r
-                        text = "\n ############ End of Log ############## \n";\r
-                    position++;\r
-\r
-                    SetText(text);\r
-                }\r
+                SetText(info);\r
             }\r
             catch (Exception exc)\r
             {\r
@@ -238,12 +187,9 @@ namespace Handbrake
         /// Read the log file, and store the data in a List.\r
         /// </summary>\r
         /// <returns></returns>\r
-        private List<string> readFile()\r
+        private String readFile()\r
         {\r
-            // Ok, the task here is to, Get an arraylist of log data.\r
-            // And update some global varibles which are pointers to the last displayed log line.\r
-            List<string> logData = new List<string>();\r
-\r
+            String appendText = String.Empty;\r
             try\r
             {\r
                 // hb_encode_log.dat is the primary log file. Since .NET can't read this file whilst the CLI is outputing to it (Not even in read only mode),\r
@@ -260,18 +206,21 @@ namespace Handbrake
 \r
                 // Open the copied log file for reading\r
                 StreamReader sr = new StreamReader(logFile2);\r
-                string line = sr.ReadLine();\r
-                while (line != null)\r
+                string line;\r
+                int i = 1;\r
+                while ((line = sr.ReadLine()) != null)\r
                 {\r
-                    if (line.Trim() != "")\r
-                        logData.Add(line + Environment.NewLine);\r
-\r
-                    line = sr.ReadLine();\r
+                    if (i > position)\r
+                    {\r
+                        appendText += line + Environment.NewLine;\r
+                        position++;\r
+                    }\r
+                    i++;\r
                 }\r
                 sr.Close();\r
                 sr.Dispose();\r
 \r
-                return logData;\r
+                return appendText;\r
             }\r
             catch (Exception exc)\r
             {\r
@@ -296,11 +245,8 @@ namespace Handbrake
             this.Close();\r
         }\r
 \r
-        /// <summary>\r
-        /// Copy Log Menu Item on the right click menu for the log rtf box\r
-        /// </summary>\r
-        /// <param name="sender"></param>\r
-        /// <param name="e"></param>\r
+        #region User Interface\r
+\r
         private void mnu_copy_log_Click(object sender, EventArgs e)\r
         {\r
             if (rtf_actLog.SelectedText != "")\r
@@ -308,6 +254,42 @@ namespace Handbrake
             else\r
                 Clipboard.SetDataObject(rtf_actLog.Text, true);\r
         }\r
+        private void btn_copy_Click(object sender, EventArgs e)\r
+        {\r
+            if (rtf_actLog.SelectedText != "")\r
+                Clipboard.SetDataObject(rtf_actLog.SelectedText, true);\r
+            else\r
+                Clipboard.SetDataObject(rtf_actLog.Text, true);\r
+        }\r
+        private void btn_scan_log_Click(object sender, EventArgs e)\r
+        {\r
+            // Switch to the scan log.\r
+\r
+            if (monitor != null)\r
+                monitor.Abort();\r
+\r
+            rtf_actLog.Clear();\r
+            read_file = "dvdinfo.dat";\r
+            displayLogHeader();\r
+            startLogThread(read_file);\r
+            txt_log.Text = "Scan Log";\r
+        }\r
+        private void btn_encode_log_Click(object sender, EventArgs e)\r
+        {\r
+            // Switch to the encode log\r
+\r
+            if (monitor != null)\r
+                monitor.Abort();\r
+\r
+            rtf_actLog.Clear();\r
+            read_file = "hb_encode_log.dat";\r
+            position = 0;\r
+            displayLogHeader();\r
+            startLogThread(read_file);\r
+            txt_log.Text = "Encode Log";\r
+        }\r
+\r
+        #endregion\r
 \r
         #region System Information\r
         private struct MEMORYSTATUS // Unused var's are requred here.\r
index 6f5afee..7a89b0f 100644 (file)
@@ -40,7 +40,7 @@ namespace Handbrake
             this.components = new System.ComponentModel.Container();\r
             System.Windows.Forms.ContextMenuStrip notifyIconMenu;\r
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMain));\r
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();\r
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();\r
             this.btn_restore = new System.Windows.Forms.ToolStripMenuItem();\r
             this.DVD_Save = new System.Windows.Forms.SaveFileDialog();\r
             this.File_Save = new System.Windows.Forms.SaveFileDialog();\r
@@ -48,7 +48,6 @@ namespace Handbrake
             this.drop_chapterFinish = new System.Windows.Forms.ComboBox();\r
             this.drop_chapterStart = new System.Windows.Forms.ComboBox();\r
             this.drp_dvdtitle = new System.Windows.Forms.ComboBox();\r
-            this.text_source = new System.Windows.Forms.TextBox();\r
             this.text_destination = new System.Windows.Forms.TextBox();\r
             this.drp_videoEncoder = new System.Windows.Forms.ComboBox();\r
             this.drp_audbit_1 = new System.Windows.Forms.ComboBox();\r
@@ -75,6 +74,7 @@ namespace Handbrake
             this.drop_format = new System.Windows.Forms.ComboBox();\r
             this.check_customCrop = new System.Windows.Forms.RadioButton();\r
             this.check_autoCrop = new System.Windows.Forms.RadioButton();\r
+            this.text_source = new System.Windows.Forms.TextBox();\r
             this.lbl_src_res = new System.Windows.Forms.Label();\r
             this.lbl_duration = new System.Windows.Forms.Label();\r
             this.label_duration = new System.Windows.Forms.Label();\r
@@ -224,6 +224,7 @@ namespace Handbrake
             this.notifyIcon = new System.Windows.Forms.NotifyIcon(this.components);\r
             this.StatusStrip = new System.Windows.Forms.StatusStrip();\r
             this.lbl_encode = new System.Windows.Forms.ToolStripStatusLabel();\r
+            this.hbproc = new System.Diagnostics.Process();\r
             notifyIconMenu = new System.Windows.Forms.ContextMenuStrip(this.components);\r
             notifyIconMenu.SuspendLayout();\r
             ((System.ComponentModel.ISupportInitialize)(this.slider_videoQuality)).BeginInit();\r
@@ -262,12 +263,12 @@ namespace Handbrake
             this.btn_restore});\r
             notifyIconMenu.Name = "notifyIconMenu";\r
             notifyIconMenu.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional;\r
-            notifyIconMenu.Size = new System.Drawing.Size(129, 26);\r
+            notifyIconMenu.Size = new System.Drawing.Size(124, 26);\r
             // \r
             // btn_restore\r
             // \r
             this.btn_restore.Name = "btn_restore";\r
-            this.btn_restore.Size = new System.Drawing.Size(128, 22);\r
+            this.btn_restore.Size = new System.Drawing.Size(123, 22);\r
             this.btn_restore.Text = "Restore";\r
             this.btn_restore.Click += new System.EventHandler(this.btn_restore_Click);\r
             // \r
@@ -328,17 +329,6 @@ namespace Handbrake
             this.drp_dvdtitle.SelectedIndexChanged += new System.EventHandler(this.drp_dvdtitle_SelectedIndexChanged);\r
             this.drp_dvdtitle.Click += new System.EventHandler(this.drp_dvdtitle_Click);\r
             // \r
-            // text_source\r
-            // \r
-            this.text_source.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.text_source.Location = new System.Drawing.Point(99, 19);\r
-            this.text_source.Name = "text_source";\r
-            this.text_source.ReadOnly = true;\r
-            this.text_source.Size = new System.Drawing.Size(584, 21);\r
-            this.text_source.TabIndex = 1;\r
-            this.text_source.Text = "Click \'Source\' to continue";\r
-            this.ToolTip.SetToolTip(this.text_source, "Location of the source input file, folder or dvd.");\r
-            // \r
             // text_destination\r
             // \r
             this.text_destination.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
@@ -463,7 +453,7 @@ namespace Handbrake
             this.slider_videoQuality.Margin = new System.Windows.Forms.Padding(0);\r
             this.slider_videoQuality.Maximum = 100;\r
             this.slider_videoQuality.Name = "slider_videoQuality";\r
-            this.slider_videoQuality.Size = new System.Drawing.Size(322, 42);\r
+            this.slider_videoQuality.Size = new System.Drawing.Size(322, 45);\r
             this.slider_videoQuality.TabIndex = 14;\r
             this.slider_videoQuality.TickFrequency = 17;\r
             this.ToolTip.SetToolTip(this.slider_videoQuality, "Set the quality level of the video. (Around 70% is fine for most)");\r
@@ -608,9 +598,9 @@ namespace Handbrake
             // \r
             // number\r
             // \r
-            dataGridViewCellStyle1.Format = "N0";\r
-            dataGridViewCellStyle1.NullValue = null;\r
-            this.number.DefaultCellStyle = dataGridViewCellStyle1;\r
+            dataGridViewCellStyle2.Format = "N0";\r
+            dataGridViewCellStyle2.NullValue = null;\r
+            this.number.DefaultCellStyle = dataGridViewCellStyle2;\r
             this.number.Frozen = true;\r
             this.number.HeaderText = "Chapter Number";\r
             this.number.MaxInputLength = 3;\r
@@ -713,6 +703,17 @@ namespace Handbrake
             this.check_autoCrop.UseVisualStyleBackColor = true;\r
             this.check_autoCrop.CheckedChanged += new System.EventHandler(this.check_autoCrop_CheckedChanged);\r
             // \r
+            // text_source\r
+            // \r
+            this.text_source.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.text_source.Location = new System.Drawing.Point(99, 19);\r
+            this.text_source.Name = "text_source";\r
+            this.text_source.ReadOnly = true;\r
+            this.text_source.Size = new System.Drawing.Size(584, 21);\r
+            this.text_source.TabIndex = 1;\r
+            this.text_source.Text = "Click \'Source\' to continue";\r
+            this.ToolTip.SetToolTip(this.text_source, "Location of the source input file, folder or dvd.");\r
+            // \r
             // lbl_src_res\r
             // \r
             this.lbl_src_res.AutoSize = true;\r
@@ -964,7 +965,7 @@ namespace Handbrake
             this.frmMainMenu.Location = new System.Drawing.Point(0, 0);\r
             this.frmMainMenu.Name = "frmMainMenu";\r
             this.frmMainMenu.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional;\r
-            this.frmMainMenu.Size = new System.Drawing.Size(1004, 24);\r
+            this.frmMainMenu.Size = new System.Drawing.Size(1000, 24);\r
             this.frmMainMenu.TabIndex = 0;\r
             this.frmMainMenu.Text = "MenuStrip";\r
             // \r
@@ -1191,19 +1192,19 @@ namespace Handbrake
             this.toolStripSeparator2,\r
             this.audioList_remove});\r
             this.audioMenu.Name = "audioMenu";\r
-            this.audioMenu.Size = new System.Drawing.Size(152, 76);\r
+            this.audioMenu.Size = new System.Drawing.Size(142, 76);\r
             // \r
             // audioList_moveup\r
             // \r
             this.audioList_moveup.Name = "audioList_moveup";\r
-            this.audioList_moveup.Size = new System.Drawing.Size(151, 22);\r
+            this.audioList_moveup.Size = new System.Drawing.Size(141, 22);\r
             this.audioList_moveup.Text = "Move Up";\r
             this.audioList_moveup.Click += new System.EventHandler(this.audioList_moveup_Click);\r
             // \r
             // audioList_movedown\r
             // \r
             this.audioList_movedown.Name = "audioList_movedown";\r
-            this.audioList_movedown.Size = new System.Drawing.Size(151, 22);\r
+            this.audioList_movedown.Size = new System.Drawing.Size(141, 22);\r
             this.audioList_movedown.Text = "Move Down";\r
             this.audioList_movedown.TextAlign = System.Drawing.ContentAlignment.MiddleRight;\r
             this.audioList_movedown.Click += new System.EventHandler(this.audioList_movedown_Click);\r
@@ -1211,12 +1212,12 @@ namespace Handbrake
             // toolStripSeparator2\r
             // \r
             this.toolStripSeparator2.Name = "toolStripSeparator2";\r
-            this.toolStripSeparator2.Size = new System.Drawing.Size(148, 6);\r
+            this.toolStripSeparator2.Size = new System.Drawing.Size(138, 6);\r
             // \r
             // audioList_remove\r
             // \r
             this.audioList_remove.Name = "audioList_remove";\r
-            this.audioList_remove.Size = new System.Drawing.Size(151, 22);\r
+            this.audioList_remove.Size = new System.Drawing.Size(141, 22);\r
             this.audioList_remove.Text = "Remove";\r
             this.audioList_remove.Click += new System.EventHandler(this.audioList_remove_Click);\r
             // \r
@@ -1228,7 +1229,7 @@ namespace Handbrake
             // \r
             // btn_RemoveAudioTrack\r
             // \r
-            this.btn_RemoveAudioTrack.BackColor = System.Drawing.SystemColors.Control;\r
+            this.btn_RemoveAudioTrack.BackColor = System.Drawing.Color.Transparent;\r
             this.btn_RemoveAudioTrack.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.btn_RemoveAudioTrack.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));\r
             this.btn_RemoveAudioTrack.Location = new System.Drawing.Point(132, 227);\r
@@ -1241,7 +1242,7 @@ namespace Handbrake
             // \r
             // btn_addAudioTrack\r
             // \r
-            this.btn_addAudioTrack.BackColor = System.Drawing.SystemColors.Control;\r
+            this.btn_addAudioTrack.BackColor = System.Drawing.Color.Transparent;\r
             this.btn_addAudioTrack.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.btn_addAudioTrack.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));\r
             this.btn_addAudioTrack.Location = new System.Drawing.Point(16, 227);\r
@@ -1281,7 +1282,7 @@ namespace Handbrake
             this.tb_drc.Margin = new System.Windows.Forms.Padding(0);\r
             this.tb_drc.Maximum = 31;\r
             this.tb_drc.Name = "tb_drc";\r
-            this.tb_drc.Size = new System.Drawing.Size(50, 42);\r
+            this.tb_drc.Size = new System.Drawing.Size(50, 45);\r
             this.tb_drc.TabIndex = 13;\r
             this.tb_drc.TickFrequency = 10;\r
             this.tb_drc.ValueChanged += new System.EventHandler(this.tb_drc_Scroll);\r
@@ -1784,7 +1785,7 @@ namespace Handbrake
             this.slider_deblock.Maximum = 15;\r
             this.slider_deblock.Minimum = 4;\r
             this.slider_deblock.Name = "slider_deblock";\r
-            this.slider_deblock.Size = new System.Drawing.Size(174, 42);\r
+            this.slider_deblock.Size = new System.Drawing.Size(174, 45);\r
             this.slider_deblock.TabIndex = 35;\r
             this.slider_deblock.Value = 4;\r
             this.slider_deblock.Scroll += new System.EventHandler(this.slider_deblock_Scroll);\r
@@ -2110,45 +2111,46 @@ namespace Handbrake
             this.pmnu_saveChanges,\r
             this.pmnu_delete});\r
             this.presets_menu.Name = "presets_menu";\r
-            this.presets_menu.Size = new System.Drawing.Size(163, 98);\r
+            this.presets_menu.Size = new System.Drawing.Size(155, 98);\r
             this.presets_menu.Text = ";";\r
             this.presets_menu.Opening += new System.ComponentModel.CancelEventHandler(this.presets_menu_Opening);\r
             // \r
             // pmnu_expandAll\r
             // \r
             this.pmnu_expandAll.Name = "pmnu_expandAll";\r
-            this.pmnu_expandAll.Size = new System.Drawing.Size(162, 22);\r
+            this.pmnu_expandAll.Size = new System.Drawing.Size(154, 22);\r
             this.pmnu_expandAll.Text = "Expand All";\r
             this.pmnu_expandAll.Click += new System.EventHandler(this.pmnu_expandAll_Click);\r
             // \r
             // pmnu_collapse\r
             // \r
             this.pmnu_collapse.Name = "pmnu_collapse";\r
-            this.pmnu_collapse.Size = new System.Drawing.Size(162, 22);\r
+            this.pmnu_collapse.Size = new System.Drawing.Size(154, 22);\r
             this.pmnu_collapse.Text = "Collapse All";\r
             this.pmnu_collapse.Click += new System.EventHandler(this.pmnu_collapse_Click);\r
             // \r
             // sep1\r
             // \r
             this.sep1.Name = "sep1";\r
-            this.sep1.Size = new System.Drawing.Size(159, 6);\r
+            this.sep1.Size = new System.Drawing.Size(151, 6);\r
             // \r
             // pmnu_saveChanges\r
             // \r
             this.pmnu_saveChanges.Name = "pmnu_saveChanges";\r
-            this.pmnu_saveChanges.Size = new System.Drawing.Size(162, 22);\r
+            this.pmnu_saveChanges.Size = new System.Drawing.Size(154, 22);\r
             this.pmnu_saveChanges.Text = "Save Changes";\r
             this.pmnu_saveChanges.Click += new System.EventHandler(this.pmnu_saveChanges_Click);\r
             // \r
             // pmnu_delete\r
             // \r
             this.pmnu_delete.Name = "pmnu_delete";\r
-            this.pmnu_delete.Size = new System.Drawing.Size(162, 22);\r
+            this.pmnu_delete.Size = new System.Drawing.Size(154, 22);\r
             this.pmnu_delete.Text = "Delete";\r
             this.pmnu_delete.Click += new System.EventHandler(this.pmnu_delete_click);\r
             // \r
             // toolStrip1\r
             // \r
+            this.toolStrip1.BackColor = System.Drawing.Color.Transparent;\r
             this.toolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;\r
             this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\r
             this.btn_source,\r
@@ -2162,7 +2164,7 @@ namespace Handbrake
             this.toolStrip1.Location = new System.Drawing.Point(0, 24);\r
             this.toolStrip1.Name = "toolStrip1";\r
             this.toolStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;\r
-            this.toolStrip1.Size = new System.Drawing.Size(1004, 39);\r
+            this.toolStrip1.Size = new System.Drawing.Size(1000, 39);\r
             this.toolStrip1.TabIndex = 1;\r
             this.toolStrip1.Text = "toolStrip1";\r
             // \r
@@ -2177,7 +2179,7 @@ namespace Handbrake
             this.btn_source.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;\r
             this.btn_source.ImageTransparentColor = System.Drawing.Color.Magenta;\r
             this.btn_source.Name = "btn_source";\r
-            this.btn_source.Size = new System.Drawing.Size(90, 36);\r
+            this.btn_source.Size = new System.Drawing.Size(85, 36);\r
             this.btn_source.Text = "Source";\r
             this.btn_source.ToolTipText = "Open a new source file or folder.";\r
             this.btn_source.Click += new System.EventHandler(this.btn_source_Click);\r
@@ -2186,7 +2188,7 @@ namespace Handbrake
             // \r
             this.btn_file_source.Image = global::Handbrake.Properties.Resources.Movies_Small;\r
             this.btn_file_source.Name = "btn_file_source";\r
-            this.btn_file_source.Size = new System.Drawing.Size(214, 22);\r
+            this.btn_file_source.Size = new System.Drawing.Size(194, 22);\r
             this.btn_file_source.Text = "Video File";\r
             this.btn_file_source.Click += new System.EventHandler(this.btn_file_source_Click);\r
             // \r
@@ -2195,20 +2197,20 @@ namespace Handbrake
             this.btn_dvd_source.Image = ((System.Drawing.Image)(resources.GetObject("btn_dvd_source.Image")));\r
             this.btn_dvd_source.ImageTransparentColor = System.Drawing.Color.Magenta;\r
             this.btn_dvd_source.Name = "btn_dvd_source";\r
-            this.btn_dvd_source.Size = new System.Drawing.Size(214, 22);\r
+            this.btn_dvd_source.Size = new System.Drawing.Size(194, 22);\r
             this.btn_dvd_source.Text = "DVD/ VIDEO_TS Folder";\r
             this.btn_dvd_source.Click += new System.EventHandler(this.btn_dvd_source_Click);\r
             // \r
             // toolStripSeparator1\r
             // \r
             this.toolStripSeparator1.Name = "toolStripSeparator1";\r
-            this.toolStripSeparator1.Size = new System.Drawing.Size(211, 6);\r
+            this.toolStripSeparator1.Size = new System.Drawing.Size(191, 6);\r
             // \r
             // mnu_dvd_drive\r
             // \r
             this.mnu_dvd_drive.Image = global::Handbrake.Properties.Resources.disc_small;\r
             this.mnu_dvd_drive.Name = "mnu_dvd_drive";\r
-            this.mnu_dvd_drive.Size = new System.Drawing.Size(214, 22);\r
+            this.mnu_dvd_drive.Size = new System.Drawing.Size(194, 22);\r
             this.mnu_dvd_drive.Text = "[No DVD Drive Ready]";\r
             this.mnu_dvd_drive.Visible = false;\r
             this.mnu_dvd_drive.Click += new System.EventHandler(this.mnu_dvd_drive_Click);\r
@@ -2224,7 +2226,7 @@ namespace Handbrake
             this.btn_start.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;\r
             this.btn_start.ImageTransparentColor = System.Drawing.Color.Magenta;\r
             this.btn_start.Name = "btn_start";\r
-            this.btn_start.Size = new System.Drawing.Size(70, 36);\r
+            this.btn_start.Size = new System.Drawing.Size(67, 36);\r
             this.btn_start.Text = "Start";\r
             this.btn_start.ToolTipText = "Start the encoding process";\r
             this.btn_start.Click += new System.EventHandler(this.btn_start_Click);\r
@@ -2235,7 +2237,7 @@ namespace Handbrake
             this.btn_add2Queue.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;\r
             this.btn_add2Queue.ImageTransparentColor = System.Drawing.Color.Magenta;\r
             this.btn_add2Queue.Name = "btn_add2Queue";\r
-            this.btn_add2Queue.Size = new System.Drawing.Size(122, 36);\r
+            this.btn_add2Queue.Size = new System.Drawing.Size(110, 36);\r
             this.btn_add2Queue.Text = "Add to Queue";\r
             this.btn_add2Queue.ToolTipText = "Add a new item to the Queue";\r
             this.btn_add2Queue.Click += new System.EventHandler(this.btn_add2Queue_Click);\r
@@ -2246,7 +2248,7 @@ namespace Handbrake
             this.btn_showQueue.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;\r
             this.btn_showQueue.ImageTransparentColor = System.Drawing.Color.Magenta;\r
             this.btn_showQueue.Name = "btn_showQueue";\r
-            this.btn_showQueue.Size = new System.Drawing.Size(115, 36);\r
+            this.btn_showQueue.Size = new System.Drawing.Size(104, 36);\r
             this.btn_showQueue.Tag = "";\r
             this.btn_showQueue.Text = "Show Queue";\r
             this.btn_showQueue.Click += new System.EventHandler(this.btn_showQueue_Click);\r
@@ -2262,7 +2264,7 @@ namespace Handbrake
             this.tb_preview.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;\r
             this.tb_preview.ImageTransparentColor = System.Drawing.Color.Magenta;\r
             this.tb_preview.Name = "tb_preview";\r
-            this.tb_preview.Size = new System.Drawing.Size(86, 36);\r
+            this.tb_preview.Size = new System.Drawing.Size(81, 36);\r
             this.tb_preview.Text = "Preview";\r
             this.tb_preview.Click += new System.EventHandler(this.tb_preview_Click);\r
             // \r
@@ -2272,7 +2274,7 @@ namespace Handbrake
             this.btn_ActivityWindow.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;\r
             this.btn_ActivityWindow.ImageTransparentColor = System.Drawing.Color.Magenta;\r
             this.btn_ActivityWindow.Name = "btn_ActivityWindow";\r
-            this.btn_ActivityWindow.Size = new System.Drawing.Size(132, 36);\r
+            this.btn_ActivityWindow.Size = new System.Drawing.Size(120, 36);\r
             this.btn_ActivityWindow.Text = "Activity Window";\r
             this.btn_ActivityWindow.ToolTipText = "Displays the activity window which displays the log of the last completed or curr" +\r
                 "ently running encode.";\r
@@ -2292,9 +2294,9 @@ namespace Handbrake
             // \r
             this.StatusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\r
             this.lbl_encode});\r
-            this.StatusStrip.Location = new System.Drawing.Point(0, 627);\r
+            this.StatusStrip.Location = new System.Drawing.Point(0, 623);\r
             this.StatusStrip.Name = "StatusStrip";\r
-            this.StatusStrip.Size = new System.Drawing.Size(1004, 22);\r
+            this.StatusStrip.Size = new System.Drawing.Size(1000, 22);\r
             this.StatusStrip.TabIndex = 7;\r
             this.StatusStrip.Text = "statusStrip1";\r
             // \r
@@ -2305,13 +2307,23 @@ namespace Handbrake
             this.lbl_encode.Size = new System.Drawing.Size(31, 17);\r
             this.lbl_encode.Text = "{0}";\r
             // \r
+            // hbproc\r
+            // \r
+            this.hbproc.StartInfo.Domain = "";\r
+            this.hbproc.StartInfo.LoadUserProfile = false;\r
+            this.hbproc.StartInfo.Password = null;\r
+            this.hbproc.StartInfo.StandardErrorEncoding = null;\r
+            this.hbproc.StartInfo.StandardOutputEncoding = null;\r
+            this.hbproc.StartInfo.UserName = "";\r
+            this.hbproc.SynchronizingObject = this;\r
+            // \r
             // frmMain\r
             // \r
             this.AllowDrop = true;\r
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\r
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\r
             this.AutoScroll = true;\r
-            this.ClientSize = new System.Drawing.Size(1004, 649);\r
+            this.ClientSize = new System.Drawing.Size(1000, 645);\r
             this.Controls.Add(this.gb_source);\r
             this.Controls.Add(this.groupBox_dest);\r
             this.Controls.Add(this.groupBox_output);\r
@@ -2394,7 +2406,6 @@ namespace Handbrake
         internal System.Windows.Forms.ComboBox drop_chapterStart;\r
         internal System.Windows.Forms.ComboBox drp_dvdtitle;\r
         internal System.Windows.Forms.Label Label17;\r
-        internal System.Windows.Forms.TextBox text_source;\r
         internal System.Windows.Forms.Label Label9;\r
         internal System.Windows.Forms.Label Label10;\r
         internal System.Windows.Forms.GroupBox groupBox_output;\r
@@ -2556,6 +2567,9 @@ namespace Handbrake
         private System.Windows.Forms.Label lbl_max;\r
         private System.Windows.Forms.DataGridViewTextBoxColumn number;\r
         private System.Windows.Forms.DataGridViewTextBoxColumn name;\r
+        internal TextBox text_source;\r
+        private System.Diagnostics.Process hbproc;\r
+\r
  \r
     }\r
 }
\ No newline at end of file
index 759a102..8c3725d 100644 (file)
@@ -5,7 +5,6 @@
           It may be used under the terms of the GNU General Public License. */\r
 \r
 using System;\r
-using System.Collections;\r
 using System.Collections.Generic;\r
 using System.Drawing;\r
 using System.Windows.Forms;\r
@@ -22,8 +21,6 @@ namespace Handbrake
     public partial class frmMain : Form\r
     {\r
         // Objects which may be used by one or more other objects\r
-        Main hb_common_func = new Main();\r
-        Encode encodeHandler = new Encode();\r
         QueueHandler encodeQueue = new QueueHandler();\r
         PresetsHandler presetHandler = new PresetsHandler();\r
         QueryGenerator queryGen = new QueryGenerator();\r
@@ -31,7 +28,6 @@ namespace Handbrake
         // Globals: Mainly used for tracking.\r
         Title selectedTitle;\r
         DVD thisDVD;\r
-        Process hbproc;\r
         private frmQueue queueWindow;\r
         private frmPreview qtpreview;\r
         private Form splash;\r
@@ -49,6 +45,7 @@ namespace Handbrake
 \r
         public frmMain()\r
         {\r
+           \r
             // Load and setup the splash screen in this thread\r
             splash = new frmSplashScreen();\r
             splash.Show();\r
@@ -60,7 +57,7 @@ namespace Handbrake
             // Update the users config file with the CLI version data.\r
             lblStatus.Text = "Setting Version Data ...";\r
             Application.DoEvents();\r
-            hb_common_func.setCliVersionData();\r
+            Main.setCliVersionData();\r
 \r
             // Show the form, but leave disabled until preloading is complete then show the main form\r
             this.Enabled = false;\r
@@ -132,6 +129,8 @@ namespace Handbrake
 \r
             // Queue Recovery\r
             queueRecovery();\r
+\r
+            \r
         }\r
 \r
         // Startup Functions   \r
@@ -145,7 +144,7 @@ namespace Handbrake
                     return;\r
                 }\r
 \r
-                Boolean update = hb_common_func.updateCheck(false);\r
+                Boolean update = Main.updateCheck(false);\r
                 if (update)\r
                 {\r
                     frmUpdater updateWindow = new frmUpdater();\r
@@ -159,7 +158,7 @@ namespace Handbrake
         }\r
         private void queueRecovery()\r
         {\r
-            if (hb_common_func.check_queue_recovery())\r
+            if (Main.check_queue_recovery())\r
             {\r
                 DialogResult result = MessageBox.Show("HandBrake has detected unfinished items on the queue from the last time the application was launched. Would you like to recover these?", "Queue Recovery Possible", MessageBoxButtons.YesNo, MessageBoxIcon.Question);\r
 \r
@@ -256,7 +255,7 @@ namespace Handbrake
             String file;\r
             file = lastAction == "scan" ? "dvdinfo.dat" : "hb_encode_log.dat";\r
 \r
-            frmActivityWindow dvdInfoWindow = new frmActivityWindow(file, encodeHandler);\r
+            frmActivityWindow dvdInfoWindow = new frmActivityWindow(file, encodeQueue);\r
             dvdInfoWindow.Show();\r
         }\r
         private void mnu_options_Click(object sender, EventArgs e)\r
@@ -332,7 +331,7 @@ namespace Handbrake
         }\r
         private void mnu_UpdateCheck_Click(object sender, EventArgs e)\r
         {\r
-            Boolean update = hb_common_func.updateCheck(true);\r
+            Boolean update = Main.updateCheck(true);\r
             if (update)\r
             {\r
                 frmUpdater updateWindow = new frmUpdater();\r
@@ -370,9 +369,9 @@ namespace Handbrake
         {\r
             DialogResult result = MessageBox.Show("Do you wish to include picture settings when updating the preset: " + treeView_presets.SelectedNode.Text, "Update Preset", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);\r
             if (result == DialogResult.Yes)\r
-                presetHandler.updatePreset(treeView_presets.SelectedNode.Text, queryGen.generateTabbedComponentsQuery(this), true);\r
+                presetHandler.updatePreset(treeView_presets.SelectedNode.Text, QueryGenerator.generateTabbedComponentsQuery(this), true);\r
             else if (result == DialogResult.No)\r
-                presetHandler.updatePreset(treeView_presets.SelectedNode.Text, queryGen.generateTabbedComponentsQuery(this), false);\r
+                presetHandler.updatePreset(treeView_presets.SelectedNode.Text, QueryGenerator.generateTabbedComponentsQuery(this), false);\r
         }\r
         private void pmnu_delete_click(object sender, EventArgs e)\r
         {\r
@@ -415,7 +414,7 @@ namespace Handbrake
             nodeStatus.Add(true);\r
 \r
             // Now add the new preset\r
-            Form preset = new frmAddPreset(this, queryGen.generateTabbedComponentsQuery(this), presetHandler);\r
+            Form preset = new frmAddPreset(this, QueryGenerator.generateTabbedComponentsQuery(this), presetHandler);\r
             preset.ShowDialog();\r
 \r
             // Now reload the TreeView states\r
@@ -703,7 +702,7 @@ namespace Handbrake
         {\r
             String file = lastAction == "scan" ? "dvdinfo.dat" : "hb_encode_log.dat";\r
 \r
-            frmActivityWindow ActivityWindow = new frmActivityWindow(file, encodeHandler);\r
+            frmActivityWindow ActivityWindow = new frmActivityWindow(file, encodeQueue);\r
             ActivityWindow.Show();\r
         }\r
         #endregion\r
@@ -886,7 +885,7 @@ namespace Handbrake
             // Run the autoName & chapterNaming functions\r
             if (Properties.Settings.Default.autoNaming == "Checked")\r
             {\r
-                string autoPath = hb_common_func.autoName(drp_dvdtitle, drop_chapterStart.Text, drop_chapterFinish.Text, text_source.Text, text_destination.Text, drop_format.SelectedIndex);\r
+                string autoPath = Main.autoName(drp_dvdtitle, drop_chapterStart.Text, drop_chapterFinish.Text, text_source.Text, text_destination.Text, drop_format.SelectedIndex);\r
                 if (autoPath != null)\r
                     text_destination.Text = autoPath;\r
                 else\r
@@ -894,7 +893,7 @@ namespace Handbrake
             }\r
 \r
             data_chpt.Rows.Clear();\r
-            DataGridView chapterGridView = hb_common_func.chapterNaming(data_chpt, drop_chapterFinish.Text);\r
+            DataGridView chapterGridView = Main.chapterNaming(data_chpt, drop_chapterFinish.Text);\r
             if (chapterGridView != null)\r
                 data_chpt = chapterGridView;\r
 \r
@@ -918,11 +917,11 @@ namespace Handbrake
                     drop_chapterFinish.Text = c_start.ToString();\r
             }\r
 \r
-            lbl_duration.Text = hb_common_func.calculateDuration(drop_chapterStart.Text, drop_chapterFinish.Text, selectedTitle).ToString();\r
+            lbl_duration.Text = Main.calculateDuration(drop_chapterStart.Text, drop_chapterFinish.Text, selectedTitle).ToString();\r
 \r
             // Run the Autonaming function\r
             if (Properties.Settings.Default.autoNaming == "Checked")\r
-                text_destination.Text = hb_common_func.autoName(drp_dvdtitle, drop_chapterStart.Text, drop_chapterFinish.Text, text_source.Text, text_destination.Text, drop_format.SelectedIndex);\r
+                text_destination.Text = Main.autoName(drp_dvdtitle, drop_chapterStart.Text, drop_chapterFinish.Text, text_source.Text, text_destination.Text, drop_format.SelectedIndex);\r
 \r
         }\r
         private void drop_chapterFinish_SelectedIndexChanged(object sender, EventArgs e)\r
@@ -941,11 +940,11 @@ namespace Handbrake
                     drop_chapterFinish.Text = c_start.ToString();\r
             }\r
 \r
-            lbl_duration.Text = hb_common_func.calculateDuration(drop_chapterStart.Text, drop_chapterFinish.Text, selectedTitle).ToString();\r
+            lbl_duration.Text = Main.calculateDuration(drop_chapterStart.Text, drop_chapterFinish.Text, selectedTitle).ToString();\r
 \r
             // Run the Autonaming function\r
             if (Properties.Settings.Default.autoNaming == "Checked")\r
-                text_destination.Text = hb_common_func.autoName(drp_dvdtitle, drop_chapterStart.Text, drop_chapterFinish.Text, text_source.Text, text_destination.Text, drop_format.SelectedIndex);\r
+                text_destination.Text = Main.autoName(drp_dvdtitle, drop_chapterStart.Text, drop_chapterFinish.Text, text_source.Text, text_destination.Text, drop_format.SelectedIndex);\r
 \r
             // Add more rows to the Chapter menu if needed.\r
             if (Check_ChapterMarkers.Checked)\r
@@ -1233,7 +1232,7 @@ namespace Handbrake
                 {\r
                     if (drp_anamorphic.Text == "None")\r
                     {\r
-                        int height = hb_common_func.cacluateNonAnamorphicHeight(width, text_top.Value, text_bottom.Value, text_left.Value, text_right.Value, selectedTitle);\r
+                        int height = Main.cacluateNonAnamorphicHeight(width, text_top.Value, text_bottom.Value, text_left.Value, text_right.Value, selectedTitle);\r
                         if (height != 0)\r
                             text_height.Text = height.ToString();\r
                     }\r
@@ -1553,7 +1552,7 @@ namespace Handbrake
                 text_destination.Text = text_destination.Text.Replace(".m4v", ".mp4");\r
                 data_chpt.Rows.Clear();\r
                 data_chpt.Enabled = true;\r
-                DataGridView chapterGridView = hb_common_func.chapterNaming(data_chpt, drop_chapterFinish.Text);\r
+                DataGridView chapterGridView = Main.chapterNaming(data_chpt, drop_chapterFinish.Text);\r
                 if (chapterGridView != null)\r
                     data_chpt = chapterGridView;\r
             }\r
@@ -1639,7 +1638,7 @@ namespace Handbrake
 \r
                 using (StreamReader sr = new StreamReader(dvdInfoPath))\r
                 {\r
-                    thisDVD = Parsing.DVD.Parse(sr);\r
+                    thisDVD = DVD.Parse(sr);\r
                     sr.Close();\r
                     sr.Dispose();\r
                 }\r
@@ -1672,7 +1671,7 @@ namespace Handbrake
 \r
                 // Now select the longest title\r
                 if (thisDVD.Titles.Count != 0)\r
-                    drp_dvdtitle.SelectedItem = hb_common_func.selectLongestTitle(drp_dvdtitle);\r
+                    drp_dvdtitle.SelectedItem = Main.selectLongestTitle(drp_dvdtitle);\r
 \r
                 // Enable the creation of chapter markers if the file is an image of a dvd.\r
                 if (text_source.Text.ToLower().Contains(".iso") || text_source.Text.ToLower().Contains("VIDEO_TS"))\r
@@ -2083,6 +2082,7 @@ namespace Handbrake
             base.OnFormClosing(e);\r
         }\r
         #endregion\r
+\r
         // This is the END of the road ------------------------------------------------------------------------------\r
     }\r
 }\r
index 77037cb..ca7b50f 100644 (file)
@@ -152,6 +152,12 @@ Make sure you have selected a "Title" from the "Source" box above otherwise
 the list will not be populated with the correct amount of chapters.\r
 Note: Do not change any of the chapter numbers!</value>\r
   </data>\r
+  <metadata name="number.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
+    <value>True</value>\r
+  </metadata>\r
+  <metadata name="name.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
+    <value>True</value>\r
+  </metadata>\r
   <metadata name="DVD_Open.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
     <value>232, 15</value>\r
   </metadata>\r
@@ -165,10 +171,10 @@ Note: Do not change any of the chapter numbers!</value>
     <value>106, 15</value>\r
   </metadata>\r
   <metadata name="audioMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
-    <value>17, 36</value>\r
+    <value>17, 52</value>\r
   </metadata>\r
   <metadata name="AudioMenuRowHeightHack.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
-    <value>123, 36</value>\r
+    <value>123, 52</value>\r
   </metadata>\r
   <metadata name="presets_menu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
     <value>1224, 15</value>\r
@@ -579,8 +585,11 @@ Note: Do not change any of the chapter numbers!</value>
   <metadata name="StatusStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
     <value>1113, 15</value>\r
   </metadata>\r
+  <metadata name="hbproc.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
+    <value>308, 52</value>\r
+  </metadata>\r
   <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
-    <value>75</value>\r
+    <value>98</value>\r
   </metadata>\r
   <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">\r
     <value>\r
index bbea71f..f83133d 100644 (file)
@@ -11,9 +11,6 @@ namespace Handbrake
 {\r
     public partial class frmOptions : Form\r
     {\r
-        /// <summary>\r
-        /// When the form loads, Initialise all the setting components with their correct values\r
-        /// </summary>\r
         public frmOptions()\r
         {\r
             InitializeComponent();\r
index 464ac25..bab1f41 100644 (file)
             this.cb_preview = new System.Windows.Forms.ToolStripComboBox();\r
             this.toolStripLabel2 = new System.Windows.Forms.ToolStripLabel();\r
             this.cb_duration = new System.Windows.Forms.ToolStripComboBox();\r
-            this.btn_playQT = new System.Windows.Forms.ToolStripButton();\r
-            this.btn_playVLC = new System.Windows.Forms.ToolStripButton();\r
             this.QTControl = new AxQTOControlLib.AxQTControl();\r
             this.panel1 = new System.Windows.Forms.Panel();\r
             this.lbl_status = new System.Windows.Forms.Label();\r
+            this.btn_playQT = new System.Windows.Forms.ToolStripButton();\r
+            this.btn_playVLC = new System.Windows.Forms.ToolStripButton();\r
             this.toolBar.SuspendLayout();\r
             ((System.ComponentModel.ISupportInitialize)(this.QTControl)).BeginInit();\r
             this.panel1.SuspendLayout();\r
@@ -59,8 +59,8 @@
             this.btn_playVLC});\r
             this.toolBar.Location = new System.Drawing.Point(0, 0);\r
             this.toolBar.Name = "toolBar";\r
-            this.toolBar.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;\r
-            this.toolBar.Size = new System.Drawing.Size(774, 25);\r
+            this.toolBar.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional;\r
+            this.toolBar.Size = new System.Drawing.Size(772, 25);\r
             this.toolBar.TabIndex = 37;\r
             this.toolBar.Text = "toolStrip1";\r
             // \r
@@ -68,7 +68,7 @@
             // \r
             this.lbl_preview.BackColor = System.Drawing.Color.Transparent;\r
             this.lbl_preview.Name = "lbl_preview";\r
-            this.lbl_preview.Size = new System.Drawing.Size(100, 22);\r
+            this.lbl_preview.Size = new System.Drawing.Size(89, 22);\r
             this.lbl_preview.Text = "Start at Preview:";\r
             // \r
             // cb_preview\r
@@ -76,6 +76,7 @@
             this.cb_preview.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;\r
             this.cb_preview.DropDownWidth = 75;\r
             this.cb_preview.FlatStyle = System.Windows.Forms.FlatStyle.Standard;\r
+            this.cb_preview.Font = new System.Drawing.Font("Tahoma", 9F);\r
             this.cb_preview.Items.AddRange(new object[] {\r
             "1",\r
             "2",\r
@@ -94,7 +95,7 @@
             // \r
             this.toolStripLabel2.BackColor = System.Drawing.Color.Transparent;\r
             this.toolStripLabel2.Name = "toolStripLabel2";\r
-            this.toolStripLabel2.Size = new System.Drawing.Size(111, 22);\r
+            this.toolStripLabel2.Size = new System.Drawing.Size(98, 22);\r
             this.toolStripLabel2.Text = "Duration (seconds)";\r
             // \r
             // cb_duration\r
             this.cb_duration.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;\r
             this.cb_duration.DropDownWidth = 75;\r
             this.cb_duration.FlatStyle = System.Windows.Forms.FlatStyle.Standard;\r
+            this.cb_duration.Font = new System.Drawing.Font("Tahoma", 9F);\r
             this.cb_duration.Items.AddRange(new object[] {\r
             "5",\r
             "10",\r
             this.cb_duration.Name = "cb_duration";\r
             this.cb_duration.Size = new System.Drawing.Size(75, 25);\r
             // \r
-            // btn_playQT\r
-            // \r
-            this.btn_playQT.Image = global::Handbrake.Properties.Resources.Play_small;\r
-            this.btn_playQT.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;\r
-            this.btn_playQT.ImageTransparentColor = System.Drawing.Color.Magenta;\r
-            this.btn_playQT.Name = "btn_playQT";\r
-            this.btn_playQT.Size = new System.Drawing.Size(99, 22);\r
-            this.btn_playQT.Text = "Play with QT";\r
-            this.btn_playQT.Click += new System.EventHandler(this.btn_playQT_Click);\r
-            // \r
-            // btn_playVLC\r
-            // \r
-            this.btn_playVLC.Image = global::Handbrake.Properties.Resources.Play_small;\r
-            this.btn_playVLC.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;\r
-            this.btn_playVLC.ImageTransparentColor = System.Drawing.Color.Magenta;\r
-            this.btn_playVLC.Name = "btn_playVLC";\r
-            this.btn_playVLC.Size = new System.Drawing.Size(103, 22);\r
-            this.btn_playVLC.Text = "Play with VLC";\r
-            this.btn_playVLC.Click += new System.EventHandler(this.btn_playVLC_Click);\r
-            // \r
             // QTControl\r
             // \r
             this.QTControl.Enabled = true;\r
             this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;\r
             this.panel1.Location = new System.Drawing.Point(0, 25);\r
             this.panel1.Name = "panel1";\r
-            this.panel1.Size = new System.Drawing.Size(774, 483);\r
+            this.panel1.Size = new System.Drawing.Size(772, 481);\r
             this.panel1.TabIndex = 40;\r
             // \r
             // lbl_status\r
             this.lbl_status.Text = "{0}";\r
             this.lbl_status.Visible = false;\r
             // \r
+            // btn_playQT\r
+            // \r
+            this.btn_playQT.Image = global::Handbrake.Properties.Resources.Play_small;\r
+            this.btn_playQT.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;\r
+            this.btn_playQT.ImageTransparentColor = System.Drawing.Color.Magenta;\r
+            this.btn_playQT.Name = "btn_playQT";\r
+            this.btn_playQT.Size = new System.Drawing.Size(89, 22);\r
+            this.btn_playQT.Text = "Play with QT";\r
+            this.btn_playQT.Click += new System.EventHandler(this.btn_playQT_Click);\r
+            // \r
+            // btn_playVLC\r
+            // \r
+            this.btn_playVLC.Image = global::Handbrake.Properties.Resources.Play_small;\r
+            this.btn_playVLC.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;\r
+            this.btn_playVLC.ImageTransparentColor = System.Drawing.Color.Magenta;\r
+            this.btn_playVLC.Name = "btn_playVLC";\r
+            this.btn_playVLC.Size = new System.Drawing.Size(93, 22);\r
+            this.btn_playVLC.Text = "Play with VLC";\r
+            this.btn_playVLC.Click += new System.EventHandler(this.btn_playVLC_Click);\r
+            // \r
             // frmPreview\r
             // \r
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\r
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\r
             this.BackColor = System.Drawing.Color.Black;\r
-            this.ClientSize = new System.Drawing.Size(774, 508);\r
+            this.ClientSize = new System.Drawing.Size(772, 506);\r
             this.Controls.Add(this.panel1);\r
             this.Controls.Add(this.toolBar);\r
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));\r
index 748d638..946f049 100644 (file)
@@ -15,7 +15,7 @@ namespace Handbrake
     {\r
 \r
         QueryGenerator hb_common_func = new QueryGenerator();\r
-        Functions.Encode process = new Functions.Encode();\r
+        Encode process = new Encode();\r
         private delegate void UpdateUIHandler();\r
         String currently_playing = "";\r
         readonly frmMain mainWindow;\r
@@ -88,7 +88,7 @@ namespace Handbrake
                 MessageBox.Show(this, "Handbrake is already encoding a video!", "Status", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
             else\r
             {\r
-                hbProc = process.runCli(this, (string)state);\r
+                hbProc = process.runCli((string)state);\r
                 hbProc.WaitForExit();\r
                 hbProc = null;\r
                 encodeCompleted();\r
index 4f8ac2c..39f5482 100644 (file)
@@ -166,17 +166,15 @@ namespace Handbrake
                 item.SubItems.Add(queue_item.Destination); // Destination\r
                 item.SubItems.Add(parsed.VideoEncoder); // Video\r
 \r
-                // Display the first 4 audio tracks.\r
-                String audio = parsed.AudioEncoder1;\r
-                if (parsed.AudioEncoder2 != null)\r
-                    audio += ", " + parsed.AudioEncoder2;\r
-\r
-                if (parsed.AudioEncoder3 != null)\r
-                    audio += ", " + parsed.AudioEncoder3;\r
-\r
-                if (parsed.AudioEncoder4 != null)\r
-                    audio += ", " + parsed.AudioEncoder4;\r
-\r
+                // Display The Audio Track Information\r
+                string audio = string.Empty;\r
+                foreach (Functions.AudioTrack track in parsed.AudioInformation)\r
+                {\r
+                    if (audio != "")\r
+                        audio += ", " + track.Encoder;\r
+                    else\r
+                        audio = track.Encoder;\r
+                }\r
                 item.SubItems.Add(audio); // Audio\r
 \r
                 list_queue.Items.Add(item);\r
@@ -203,9 +201,9 @@ namespace Handbrake
                 }\r
 \r
                 // found query is a global varible\r
-                Functions.QueryParser parsed = Functions.QueryParser.Parse(queue.getLastQueryItem().Query);\r
-                lbl_source.Text = queue.getLastQueryItem().Source;\r
-                lbl_dest.Text = queue.getLastQueryItem().Destination;\r
+                Functions.QueryParser parsed = Functions.QueryParser.Parse(queue.lastQueueItem.Query);\r
+                lbl_source.Text = queue.lastQueueItem.Source;\r
+                lbl_dest.Text = queue.lastQueueItem.Destination;\r
 \r
                 lbl_title.Text = parsed.DVDTitle == 0 ? "Auto" : parsed.DVDTitle.ToString();\r
 \r
@@ -220,16 +218,16 @@ namespace Handbrake
                 }\r
 \r
                 lbl_vEnc.Text = parsed.VideoEncoder;\r
-                String audio = parsed.AudioEncoder1;\r
-                if (parsed.AudioEncoder2 != null)\r
-                    audio += ", " + parsed.AudioEncoder2;\r
-\r
-                if (parsed.AudioEncoder3 != null)\r
-                    audio += ", " + parsed.AudioEncoder3;\r
-\r
-                if (parsed.AudioEncoder4 != null)\r
-                    audio += ", " + parsed.AudioEncoder4;\r
 \r
+                // Display The Audio Track Information\r
+                string audio = string.Empty;\r
+                foreach (Functions.AudioTrack track in parsed.AudioInformation)\r
+                {\r
+                    if (audio != "")\r
+                        audio += ", " + track.Encoder;\r
+                    else\r
+                        audio = track.Encoder;\r
+                }\r
                 lbl_aEnc.Text = audio;\r
             }\r
             catch (Exception)\r
@@ -379,9 +377,9 @@ namespace Handbrake
         }\r
         private void mnu_readd_Click(object sender, EventArgs e)\r
         {\r
-            if (queue.getLastQueryItem() != null)\r
+            if (queue.lastQueueItem != null)\r
             {\r
-                queue.add(queue.getLastQueryItem().Query, queue.getLastQueryItem().Source, queue.getLastQueryItem().Destination);\r
+                queue.add(queue.lastQueueItem.Query, queue.lastQueueItem.Source, queue.lastQueueItem.Destination);\r
                 queue.write2disk("hb_queue_recovery.xml"); // Update the queue recovery file\r
                 updateUIElements();\r
             }\r
index 8496fa5..b07f97b 100644 (file)
@@ -6,12 +6,13 @@
 \r
 using System;\r
 using System.Windows.Forms;\r
+using Handbrake.Functions;\r
 \r
 namespace Handbrake\r
 {\r
     public partial class frmUpdater : Form\r
     {\r
-        Functions.AppcastReader appcast = new Functions.AppcastReader();\r
+        AppcastReader appcast = new AppcastReader();\r
         public frmUpdater()\r
         {\r
             InitializeComponent();\r