OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Thu, 14 Aug 2008 10:45:12 +0000 (10:45 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Thu, 14 Aug 2008 10:45:12 +0000 (10:45 +0000)
- Added some regions to common.cs to make it a bit easier to read.

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

win/C#/Functions/Common.cs
win/C#/frmMain.Designer.cs
win/C#/frmMain.resx

index bead1ba..4945d4d 100644 (file)
@@ -18,76 +18,7 @@ namespace Handbrake.Functions
 {\r
     class Common\r
     {\r
-        /// <summary>\r
-        /// Checks for updates and returns true if an update is available.\r
-        /// </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
-        {\r
-            try\r
-            {\r
-                Functions.AppcastReader rssRead = new Functions.AppcastReader();\r
-                string build = rssRead.build();\r
-\r
-                int latest = int.Parse(build);\r
-                int current = Properties.Settings.Default.hb_build;\r
-                int skip = Properties.Settings.Default.skipversion;\r
-\r
-                if (latest == skip)\r
-                    return false;\r
-                else\r
-                {\r
-                    Boolean update = (latest > current);\r
-                    return update;\r
-                }\r
-            }\r
-            catch (Exception exc)\r
-            {\r
-                if (debug == true)\r
-                    MessageBox.Show("Unable to check for updates, Please try again later. \n" + exc.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);\r
-                return false;\r
-            }\r
-        }\r
-\r
-        /// <summary>\r
-        /// 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 ArrayList getCliVersionData()\r
-        {\r
-            ArrayList cliVersionData = new ArrayList();\r
-            // 0 = SVN Build / Version\r
-            // 1 = Build Date\r
-\r
-            Process cliProcess = new Process();\r
-            ProcessStartInfo handBrakeCLI = new ProcessStartInfo("HandBrakeCLI.exe", " -u");\r
-            handBrakeCLI.UseShellExecute = false;\r
-            handBrakeCLI.RedirectStandardError = true;\r
-            handBrakeCLI.RedirectStandardOutput = true;\r
-            handBrakeCLI.CreateNoWindow = true;\r
-            cliProcess.StartInfo = handBrakeCLI;\r
-            cliProcess.Start();\r
-\r
-            // Retrieve standard output and report back to parent thread until the process is complete\r
-            String line;\r
-            TextReader stdOutput = cliProcess.StandardError;\r
-\r
-            while (!cliProcess.HasExited)\r
-            {\r
-                line = stdOutput.ReadLine();\r
-                Match m = Regex.Match(line, @"HandBrake [0-9\.]*svn[0-9]*[M]* \([0-9]*\)");\r
-                if (m.Success != false)\r
-                {\r
-                    string data = line.Replace("(", "").Replace(")", "").Replace("HandBrake ", "");\r
-                    string[] arr = data.Split(' ');\r
-                    cliVersionData.Add(arr[0]);\r
-                    cliVersionData.Add(arr[1]);\r
-                    return cliVersionData;\r
-                }\r
-            }\r
-            return null;\r
-        }\r
+        #region Presets\r
 \r
         /// <summary>\r
         /// Update the presets.dat file with the latest version of HandBrak's presets from the CLI\r
@@ -107,77 +38,6 @@ namespace Handbrake.Functions
             hbproc.Dispose();\r
             hbproc.Close();\r
         }\r
-\r
-        /// <summary>\r
-        /// Function which generates the filename and path automatically based on \r
-        /// the Source Name, DVD title and DVD Chapters\r
-        /// </summary>\r
-        /// <param name="mainWindow"></param>\r
-        public void autoName(frmMain mainWindow)\r
-        {\r
-            if (Properties.Settings.Default.autoNaming == "Checked")\r
-            {\r
-                if (mainWindow.drp_dvdtitle.Text != "Automatic")\r
-                {\r
-                    string source = mainWindow.text_source.Text;\r
-                    string[] sourceName = source.Split('\\');\r
-                    source = sourceName[sourceName.Length - 1].Replace(".iso", "").Replace(".mpg", "").Replace(".ts", "").Replace(".ps", "");\r
-\r
-                    string title = mainWindow.drp_dvdtitle.Text;\r
-                    string[] titlesplit = title.Split(' ');\r
-                    title = titlesplit[0];\r
-\r
-                    string cs = mainWindow.drop_chapterStart.Text;\r
-                    string cf = mainWindow.drop_chapterFinish.Text;\r
-\r
-                    if (title == "Automatic")\r
-                        title = "";\r
-                    if (cs == "Auto")\r
-                        cs = "";\r
-                    if (cf == "Auto")\r
-                        cf = "";\r
-\r
-                    string dash = "";\r
-                    if (cf != "Auto")\r
-                        dash = "-";\r
-\r
-                    if (!mainWindow.text_destination.Text.Contains("\\"))\r
-                    {\r
-                        string filePath = "";\r
-                        if (Properties.Settings.Default.autoNamePath.Trim() != "")\r
-                        {\r
-                            if (Properties.Settings.Default.autoNamePath.Trim() != "Click 'Browse' to set the default location")\r
-                                filePath = Properties.Settings.Default.autoNamePath + "\\";\r
-                        }\r
-                        mainWindow.text_destination.Text = filePath + source + "_T" + title + "_C" + cs + dash + cf + ".mp4";\r
-                    }\r
-                    else\r
-                    {\r
-                        string dest = mainWindow.text_destination.Text;\r
-\r
-                        string[] destName = dest.Split('\\');\r
-\r
-\r
-                        string[] extension = dest.Split('.');\r
-                        string ext = extension[extension.Length - 1];\r
-\r
-                        destName[destName.Length - 1] = source + "_T" + title + "_C" + cs + dash + cf + "." + ext;\r
-\r
-                        string fullDest = "";\r
-                        foreach (string part in destName)\r
-                        {\r
-                            if (fullDest != "")\r
-                                fullDest = fullDest + "\\" + part;\r
-                            else\r
-                                fullDest = fullDest + part;\r
-                        }\r
-\r
-                        mainWindow.text_destination.Text = fullDest;\r
-                    }\r
-                }\r
-            }\r
-        }\r
-\r
         /// <summary>\r
         /// This function takes in a Query which has been parsed by QueryParser and\r
         /// set's all the GUI widgets correctly.\r
@@ -544,6 +404,10 @@ namespace Handbrake.Functions
             #endregion\r
         }\r
 \r
+        #endregion\r
+\r
+        #region Query Generator & Chapter CSV Creation\r
+\r
         /// <summary>\r
         /// Generates a CLI query based on the GUI widgets.\r
         /// </summary>\r
@@ -580,7 +444,6 @@ namespace Handbrake.Functions
             query += generateTabbedComponentsQuery(mainWindow, mainWindow.text_source.Text);\r
             return query;\r
         }\r
-\r
         /// <summary>\r
         /// Generates a CLI query for the preview function.\r
         /// This basically forces a shortened version of the encdode.\r
@@ -616,95 +479,6 @@ namespace Handbrake.Functions
             return query;\r
         }\r
 \r
-        /// <summary>\r
-        /// Set's up the DataGridView on the Chapters tab (frmMain)\r
-        /// </summary>\r
-        /// <param name="mainWindow"></param>\r
-        public void chapterNaming(frmMain mainWindow)\r
-        {\r
-            try\r
-            {\r
-                mainWindow.data_chpt.Rows.Clear();\r
-                int i = 0;\r
-                int rowCount = 0;\r
-                int start = 0;\r
-                int finish = 0;\r
-                if (mainWindow.drop_chapterFinish.Text != "Auto")\r
-                    finish = int.Parse(mainWindow.drop_chapterFinish.Text);\r
-\r
-                if (mainWindow.drop_chapterStart.Text != "Auto")\r
-                    start = int.Parse(mainWindow.drop_chapterStart.Text);\r
-\r
-                rowCount = finish - (start - 1);\r
-\r
-                while (i < rowCount)\r
-                {\r
-                    DataGridViewRow row = new DataGridViewRow();\r
-\r
-                    mainWindow.data_chpt.Rows.Insert(i, row);\r
-                    mainWindow.data_chpt.Rows[i].Cells[0].Value = (i + 1);\r
-                    mainWindow.data_chpt.Rows[i].Cells[1].Value = "Chapter " + (i + 1);\r
-                    i++;\r
-                }\r
-            }\r
-            catch (Exception exc)\r
-            {\r
-                MessageBox.Show("chapterNaming() Error has occured: \n" + exc.ToString());\r
-            }\r
-        }\r
-\r
-        /// <summary>\r
-        /// Select the longest title in the DVD title dropdown menu on frmMain\r
-        /// </summary>\r
-        public void selectLongestTitle(frmMain mainWindow)\r
-        {\r
-            int current_largest = 0;\r
-            Handbrake.Parsing.Title title2Select;\r
-\r
-            // Check if there are titles in the DVD title dropdown menu and make sure, it's not just "Automatic"\r
-            if (mainWindow.drp_dvdtitle.Items[0].ToString() != "Automatic")\r
-                title2Select = (Handbrake.Parsing.Title)mainWindow.drp_dvdtitle.Items[0];\r
-            else\r
-                title2Select = null;\r
-\r
-            // So, If there are titles in the DVD Title dropdown menu, lets select the longest.\r
-            if (title2Select != null)\r
-            {\r
-                foreach (Handbrake.Parsing.Title x in mainWindow.drp_dvdtitle.Items)\r
-                {\r
-                    string title = x.ToString();\r
-                    if (title != "Automatic")\r
-                    {\r
-                        string[] y = title.Split(' ');\r
-                        string time = y[1].Replace("(", "").Replace(")", "");\r
-                        string[] z = time.Split(':');\r
-\r
-                        int hours = int.Parse(z[0]) * 60 * 60;\r
-                        int minutes = int.Parse(z[1]) * 60;\r
-                        int seconds = int.Parse(z[2]);\r
-                        int total_sec = hours + minutes + seconds;\r
-\r
-                        if (current_largest == 0)\r
-                        {\r
-                            current_largest = hours + minutes + seconds;\r
-                            title2Select = x;\r
-                        }\r
-                        else\r
-                        {\r
-                            if (total_sec > current_largest)\r
-                            {\r
-                                current_largest = total_sec;\r
-                                title2Select = x;\r
-                            }\r
-                        }\r
-                    }\r
-                }\r
-\r
-                // Now set the longest title in the gui.\r
-                mainWindow.drp_dvdtitle.SelectedItem = title2Select;\r
-            }\r
-        }\r
-\r
         // Generates part of the CLI query, for the tabbed components only.\r
         private string generateTabbedComponentsQuery(frmMain mainWindow, string source)\r
         {\r
@@ -747,16 +521,16 @@ namespace Handbrake.Functions
                 query += " --crop 0:0:0:0 ";\r
             else if (mainWindow.drp_crop.Text == "Custom")\r
             {\r
-                    if (mainWindow.text_top.Text == "")\r
-                        cropTop = "0";\r
-                    if (mainWindow.text_bottom.Text == "")\r
-                        cropBottom = "0";\r
-                    if (mainWindow.text_left.Text == "")\r
-                        cropLeft = "0";\r
-                    if (mainWindow.text_right.Text == "")\r
-                        cropRight = "0";\r
-\r
-                    query += " --crop " + cropTop + ":" + cropBottom + ":" + cropLeft + ":" + cropRight;\r
+                if (mainWindow.text_top.Text == "")\r
+                    cropTop = "0";\r
+                if (mainWindow.text_bottom.Text == "")\r
+                    cropBottom = "0";\r
+                if (mainWindow.text_left.Text == "")\r
+                    cropLeft = "0";\r
+                if (mainWindow.text_right.Text == "")\r
+                    cropRight = "0";\r
+\r
+                query += " --crop " + cropTop + ":" + cropBottom + ":" + cropLeft + ":" + cropRight;\r
             }\r
 \r
             switch (mainWindow.drp_deInterlace_option.Text)\r
@@ -1013,13 +787,13 @@ namespace Handbrake.Functions
                 query += " -6 dpl2";\r
 \r
             if (Mixdown2 != "" && track2 != "None")\r
-                    query += "," + getMixDown(Mixdown2);\r
+                query += "," + getMixDown(Mixdown2);\r
 \r
             if (Mixdown3 != "" && track3 != "None" && track2 != "None")\r
-                    query += "," + getMixDown(Mixdown3);\r
+                query += "," + getMixDown(Mixdown3);\r
 \r
             if (Mixdown4 != "" && track4 != "None" && track3 != "None")\r
-                    query += "," + getMixDown(Mixdown4);\r
+                query += "," + getMixDown(Mixdown4);\r
 \r
 \r
             //\r
@@ -1138,40 +912,10 @@ namespace Handbrake.Functions
 \r
             return query;\r
         }\r
-\r
-        // This function saves the data in the chapters tab, dataGridView into a CSV file called chapters.csv\r
-        // in a directory specified by file_path_name\r
-        private Boolean chapterCSVSave(frmMain mainWindow, string file_path_name)\r
+        // Get the CLI equive of the audio mixdown from the widget name.\r
+        private string getMixDown(string selectedAudio)\r
         {\r
-            try\r
-            {\r
-                StringBuilder csv = new StringBuilder();\r
-\r
-                foreach (DataGridViewRow row in mainWindow.data_chpt.Rows)\r
-                {\r
-                    csv.Append(row.Cells[0].Value.ToString());\r
-                    csv.Append(",");\r
-                    csv.Append(row.Cells[1].Value.ToString());\r
-                    csv.Append(Environment.NewLine);\r
-                }\r
-                StreamWriter file = new StreamWriter(file_path_name);\r
-                file.Write(csv.ToString());\r
-                file.Close();\r
-                file.Dispose();\r
-                return true;\r
-\r
-            }\r
-            catch (Exception exc)\r
-            {\r
-                MessageBox.Show("Unable to save Chapter Makrers file! \nChapter marker names will NOT be saved in your encode \n\n" + exc.ToString(), "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
-                return false;\r
-            }\r
-        }\r
-\r
-        // Get the CLI equive of the audio mixdown from the widget name.\r
-        private string getMixDown(string selectedAudio)\r
-        {\r
-            switch (selectedAudio)\r
+            switch (selectedAudio)\r
             {\r
                 case "Automatic":\r
                     return "dpl2";\r
@@ -1189,7 +933,6 @@ namespace Handbrake.Functions
                     return "dpl2";\r
             }\r
         }\r
-\r
         // Get the CLI equiv of the audio encoder from the widget name.\r
         private string getAudioEncoder(string selectedEncoder)\r
         {\r
@@ -1207,6 +950,272 @@ namespace Handbrake.Functions
                     return "";\r
             }\r
         }\r
+        // This function saves the data in the chapters tab, dataGridView into a CSV file called chapters.csv\r
+        // in a directory specified by file_path_name\r
+        private Boolean chapterCSVSave(frmMain mainWindow, string file_path_name)\r
+        {\r
+            try\r
+            {\r
+                StringBuilder csv = new StringBuilder();\r
+\r
+                foreach (DataGridViewRow row in mainWindow.data_chpt.Rows)\r
+                {\r
+                    csv.Append(row.Cells[0].Value.ToString());\r
+                    csv.Append(",");\r
+                    csv.Append(row.Cells[1].Value.ToString());\r
+                    csv.Append(Environment.NewLine);\r
+                }\r
+                StreamWriter file = new StreamWriter(file_path_name);\r
+                file.Write(csv.ToString());\r
+                file.Close();\r
+                file.Dispose();\r
+                return true;\r
+\r
+            }\r
+            catch (Exception exc)\r
+            {\r
+                MessageBox.Show("Unable to save Chapter Makrers file! \nChapter marker names will NOT be saved in your encode \n\n" + exc.ToString(), "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
+                return false;\r
+            }\r
+        }\r
+\r
+        #endregion\r
+\r
+        #region frmMain Actions\r
+\r
+        /// <summary>\r
+        /// Select the longest title in the DVD title dropdown menu on frmMain\r
+        /// </summary>\r
+        public void selectLongestTitle(frmMain mainWindow)\r
+        {\r
+            int current_largest = 0;\r
+            Handbrake.Parsing.Title title2Select;\r
+\r
+            // Check if there are titles in the DVD title dropdown menu and make sure, it's not just "Automatic"\r
+            if (mainWindow.drp_dvdtitle.Items[0].ToString() != "Automatic")\r
+                title2Select = (Handbrake.Parsing.Title)mainWindow.drp_dvdtitle.Items[0];\r
+            else\r
+                title2Select = null;\r
+\r
+            // So, If there are titles in the DVD Title dropdown menu, lets select the longest.\r
+            if (title2Select != null)\r
+            {\r
+                foreach (Handbrake.Parsing.Title x in mainWindow.drp_dvdtitle.Items)\r
+                {\r
+                    string title = x.ToString();\r
+                    if (title != "Automatic")\r
+                    {\r
+                        string[] y = title.Split(' ');\r
+                        string time = y[1].Replace("(", "").Replace(")", "");\r
+                        string[] z = time.Split(':');\r
+\r
+                        int hours = int.Parse(z[0]) * 60 * 60;\r
+                        int minutes = int.Parse(z[1]) * 60;\r
+                        int seconds = int.Parse(z[2]);\r
+                        int total_sec = hours + minutes + seconds;\r
+\r
+                        if (current_largest == 0)\r
+                        {\r
+                            current_largest = hours + minutes + seconds;\r
+                            title2Select = x;\r
+                        }\r
+                        else\r
+                        {\r
+                            if (total_sec > current_largest)\r
+                            {\r
+                                current_largest = total_sec;\r
+                                title2Select = x;\r
+                            }\r
+                        }\r
+                    }\r
+                }\r
+\r
+                // Now set the longest title in the gui.\r
+                mainWindow.drp_dvdtitle.SelectedItem = title2Select;\r
+            }\r
+        }\r
+\r
+        /// <summary>\r
+        /// Set's up the DataGridView on the Chapters tab (frmMain)\r
+        /// </summary>\r
+        /// <param name="mainWindow"></param>\r
+        public void chapterNaming(frmMain mainWindow)\r
+        {\r
+            try\r
+            {\r
+                mainWindow.data_chpt.Rows.Clear();\r
+                int i = 0;\r
+                int rowCount = 0;\r
+                int start = 0;\r
+                int finish = 0;\r
+                if (mainWindow.drop_chapterFinish.Text != "Auto")\r
+                    finish = int.Parse(mainWindow.drop_chapterFinish.Text);\r
+\r
+                if (mainWindow.drop_chapterStart.Text != "Auto")\r
+                    start = int.Parse(mainWindow.drop_chapterStart.Text);\r
+\r
+                rowCount = finish - (start - 1);\r
+\r
+                while (i < rowCount)\r
+                {\r
+                    DataGridViewRow row = new DataGridViewRow();\r
+\r
+                    mainWindow.data_chpt.Rows.Insert(i, row);\r
+                    mainWindow.data_chpt.Rows[i].Cells[0].Value = (i + 1);\r
+                    mainWindow.data_chpt.Rows[i].Cells[1].Value = "Chapter " + (i + 1);\r
+                    i++;\r
+                }\r
+            }\r
+            catch (Exception exc)\r
+            {\r
+                MessageBox.Show("chapterNaming() Error has occured: \n" + exc.ToString());\r
+            }\r
+        }\r
+\r
+        /// <summary>\r
+        /// Function which generates the filename and path automatically based on \r
+        /// the Source Name, DVD title and DVD Chapters\r
+        /// </summary>\r
+        /// <param name="mainWindow"></param>\r
+        public void autoName(frmMain mainWindow)\r
+        {\r
+            if (Properties.Settings.Default.autoNaming == "Checked")\r
+            {\r
+                if (mainWindow.drp_dvdtitle.Text != "Automatic")\r
+                {\r
+                    string source = mainWindow.text_source.Text;\r
+                    string[] sourceName = source.Split('\\');\r
+                    source = sourceName[sourceName.Length - 1].Replace(".iso", "").Replace(".mpg", "").Replace(".ts", "").Replace(".ps", "");\r
+\r
+                    string title = mainWindow.drp_dvdtitle.Text;\r
+                    string[] titlesplit = title.Split(' ');\r
+                    title = titlesplit[0];\r
+\r
+                    string cs = mainWindow.drop_chapterStart.Text;\r
+                    string cf = mainWindow.drop_chapterFinish.Text;\r
+\r
+                    if (title == "Automatic")\r
+                        title = "";\r
+                    if (cs == "Auto")\r
+                        cs = "";\r
+                    if (cf == "Auto")\r
+                        cf = "";\r
+\r
+                    string dash = "";\r
+                    if (cf != "Auto")\r
+                        dash = "-";\r
+\r
+                    if (!mainWindow.text_destination.Text.Contains("\\"))\r
+                    {\r
+                        string filePath = "";\r
+                        if (Properties.Settings.Default.autoNamePath.Trim() != "")\r
+                        {\r
+                            if (Properties.Settings.Default.autoNamePath.Trim() != "Click 'Browse' to set the default location")\r
+                                filePath = Properties.Settings.Default.autoNamePath + "\\";\r
+                        }\r
+                        mainWindow.text_destination.Text = filePath + source + "_T" + title + "_C" + cs + dash + cf + ".mp4";\r
+                    }\r
+                    else\r
+                    {\r
+                        string dest = mainWindow.text_destination.Text;\r
+\r
+                        string[] destName = dest.Split('\\');\r
+\r
+\r
+                        string[] extension = dest.Split('.');\r
+                        string ext = extension[extension.Length - 1];\r
+\r
+                        destName[destName.Length - 1] = source + "_T" + title + "_C" + cs + dash + cf + "." + ext;\r
+\r
+                        string fullDest = "";\r
+                        foreach (string part in destName)\r
+                        {\r
+                            if (fullDest != "")\r
+                                fullDest = fullDest + "\\" + part;\r
+                            else\r
+                                fullDest = fullDest + part;\r
+                        }\r
+\r
+                        mainWindow.text_destination.Text = fullDest;\r
+                    }\r
+                }\r
+            }\r
+        }\r
+\r
+        #endregion\r
+\r
+        #region Version and Update Checking\r
+\r
+        /// <summary>\r
+        /// Checks for updates and returns true if an update is available.\r
+        /// </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
+        {\r
+            try\r
+            {\r
+                Functions.AppcastReader rssRead = new Functions.AppcastReader();\r
+                string build = rssRead.build();\r
+\r
+                int latest = int.Parse(build);\r
+                int current = Properties.Settings.Default.hb_build;\r
+                int skip = Properties.Settings.Default.skipversion;\r
+\r
+                if (latest == skip)\r
+                    return false;\r
+                else\r
+                {\r
+                    Boolean update = (latest > current);\r
+                    return update;\r
+                }\r
+            }\r
+            catch (Exception exc)\r
+            {\r
+                if (debug == true)\r
+                    MessageBox.Show("Unable to check for updates, Please try again later. \n" + exc.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);\r
+                return false;\r
+            }\r
+        }\r
+        /// <summary>\r
+        /// 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 ArrayList getCliVersionData()\r
+        {\r
+            ArrayList cliVersionData = new ArrayList();\r
+            // 0 = SVN Build / Version\r
+            // 1 = Build Date\r
+\r
+            Process cliProcess = new Process();\r
+            ProcessStartInfo handBrakeCLI = new ProcessStartInfo("HandBrakeCLI.exe", " -u");\r
+            handBrakeCLI.UseShellExecute = false;\r
+            handBrakeCLI.RedirectStandardError = true;\r
+            handBrakeCLI.RedirectStandardOutput = true;\r
+            handBrakeCLI.CreateNoWindow = true;\r
+            cliProcess.StartInfo = handBrakeCLI;\r
+            cliProcess.Start();\r
+\r
+            // Retrieve standard output and report back to parent thread until the process is complete\r
+            String line;\r
+            TextReader stdOutput = cliProcess.StandardError;\r
+\r
+            while (!cliProcess.HasExited)\r
+            {\r
+                line = stdOutput.ReadLine();\r
+                Match m = Regex.Match(line, @"HandBrake [0-9\.]*svn[0-9]*[M]* \([0-9]*\)");\r
+                if (m.Success != false)\r
+                {\r
+                    string data = line.Replace("(", "").Replace(")", "").Replace("HandBrake ", "");\r
+                    string[] arr = data.Split(' ');\r
+                    cliVersionData.Add(arr[0]);\r
+                    cliVersionData.Add(arr[1]);\r
+                    return cliVersionData;\r
+                }\r
+            }\r
+            return null;\r
+        }\r
 \r
+        #endregion\r
     }\r
 }
\ No newline at end of file
index 5994cc9..0b962a3 100644 (file)
@@ -38,7 +38,7 @@ namespace Handbrake
             System.Windows.Forms.Label Label38;\r
             System.Windows.Forms.ContextMenuStrip notifyIconMenu;\r
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMain));\r
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();\r
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = 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
@@ -649,9 +649,9 @@ namespace Handbrake
             // \r
             // number\r
             // \r
-            dataGridViewCellStyle2.Format = "N0";\r
-            dataGridViewCellStyle2.NullValue = null;\r
-            this.number.DefaultCellStyle = dataGridViewCellStyle2;\r
+            dataGridViewCellStyle1.Format = "N0";\r
+            dataGridViewCellStyle1.NullValue = null;\r
+            this.number.DefaultCellStyle = dataGridViewCellStyle1;\r
             this.number.HeaderText = "Chapter Number";\r
             this.number.MaxInputLength = 3;\r
             this.number.Name = "number";\r
index d0c9f18..1b5323e 100644 (file)
@@ -155,12 +155,6 @@ 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>223, 15</value>\r
   </metadata>\r