OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Wed, 19 Dec 2007 22:10:27 +0000 (22:10 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Wed, 19 Dec 2007 22:10:27 +0000 (22:10 +0000)
- Some code clean up + removal of old unused code.

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

12 files changed:
win/C#/Functions/CLI.cs
win/C#/Functions/RssReader.cs
win/C#/Parsing/AudioTrack.cs
win/C#/Parsing/Chapter.cs
win/C#/Parsing/DVD.cs
win/C#/Parsing/Parser.cs
win/C#/Parsing/Subtitle.cs
win/C#/Parsing/Title.cs
win/C#/Properties/Settings.Designer.cs
win/C#/Properties/Settings.settings
win/C#/app.config
win/C#/frmMain.cs

index 259a98c..b0b79d3 100644 (file)
@@ -60,28 +60,5 @@ namespace Handbrake.Functions
             }\r
             return hbProc;\r
         }\r
-\r
-        public void killCLI()\r
-        {\r
-            try\r
-            {\r
-                hbProc.Kill();\r
-            }\r
-            catch (Exception)\r
-            {\r
-                // No need to do anything. Chances are the process was already dead.\r
-            }\r
-        }\r
-\r
-        public void closeCLI()\r
-        {\r
-            hbProc.Close();\r
-            hbProc.Dispose();\r
-        }\r
-\r
-        public void setNull()\r
-        {\r
-            hbProc = new Process();\r
-        }\r
     }\r
 }\r
index 36d105d..ce8dd56 100644 (file)
@@ -55,11 +55,14 @@ namespace Handbrake.Functions
             return latestTitle;\r
         }\r
 \r
+        private string hb_versionInfo;\r
+        private string hb_version;\r
+        private string hb_build;\r
+        private string hb_file;\r
 \r
-        public string versionInfo()\r
+        public void getInfo()\r
         {\r
             readRss();\r
-            string vinfo = "";\r
             for (int i = 0; i < nodeChannel.ChildNodes.Count; i++)\r
             {\r
                 if (nodeChannel.ChildNodes[6].Name == "item")\r
@@ -68,79 +71,49 @@ namespace Handbrake.Functions
                     t = readRss();\r
                     if (nodeItem["title"].InnerText == t)\r
                     {\r
-                        vinfo = nodeItem["description"].InnerText;\r
-                        break;\r
-                    }\r
-                }\r
-            }\r
+                        // Get the Version Information\r
+                        hb_versionInfo = nodeItem["description"].InnerText;\r
 \r
-            return vinfo;\r
-         }\r
-\r
-        public string version()\r
-        {\r
-            readRss();\r
-            string vinfo = "";\r
-            for (int i = 0; i < nodeChannel.ChildNodes.Count; i++)\r
-            {\r
-                if (nodeChannel.ChildNodes[6].Name == "item")\r
-                {\r
-                    nodeItem = nodeChannel.ChildNodes[0];\r
-                    string t = readRss();\r
-                    if (nodeItem["title"].InnerText == t)\r
-                    {\r
+                        // Get the version\r
                         string input = nodeItem.InnerXml;\r
                         Match ver = Regex.Match(input, @"sparkle:shortVersionString=""([0-9].[0-9].[0-9]*)\""");\r
-                        vinfo = ver.ToString().Replace("sparkle:shortVersionString=", "").Replace("\"", "");\r
+                        hb_version = ver.ToString().Replace("sparkle:shortVersionString=", "").Replace("\"", "");\r
+\r
+                        // Get the build number\r
+                        input = nodeItem.InnerXml;\r
+                        ver = Regex.Match(input, @"sparkle:version=""([0-9]*)\""");\r
+                        hb_build = ver.ToString().Replace("sparkle:version=", "").Replace("\"", "");\r
+\r
+                        // Get the update file\r
+                        hb_file = nodeItem["windows"].InnerText;\r
 \r
-                        break;\r
                     }\r
                 }\r
             }\r
-            return vinfo;\r
+         }\r
+\r
+        public string versionInfo()\r
+        {\r
+            getInfo();\r
+            return hb_versionInfo;\r
+        }\r
+\r
+        public string version()\r
+        {\r
+            getInfo();\r
+            return hb_version;\r
         }\r
 \r
         public string build()\r
         {\r
-            readRss();\r
-            string vinfo = "";\r
-            for (int i = 0; i < nodeChannel.ChildNodes.Count; i++)\r
-            {\r
-                if (nodeChannel.ChildNodes[6].Name == "item")\r
-                {\r
-                    nodeItem = nodeChannel.ChildNodes[0];\r
-                    string t = readRss();\r
-                    if (nodeItem["title"].InnerText == t)\r
-                    {\r
-                        string input = nodeItem.InnerXml; \r
-                        Match ver = Regex.Match(input, @"sparkle:version=""([0-9]*)\""");\r
-                        vinfo = ver.ToString().Replace("sparkle:version=", "").Replace("\"", "");\r
-                        break;\r
-                    }\r
-                }\r
-            }\r
-            return vinfo;\r
+            getInfo();\r
+            return hb_build;\r
         }\r
 \r
         public string downloadFile()\r
         {\r
-            readRss();\r
-            string file = "";\r
-            for (int i = 0; i < nodeChannel.ChildNodes.Count; i++)\r
-            {\r
-                if (nodeChannel.ChildNodes[6].Name == "item")\r
-                {\r
-                    nodeItem = nodeChannel.ChildNodes[0];\r
-                    t = readRss();\r
-                    if (nodeItem["title"].InnerText == t)\r
-                    {\r
-                        file = nodeItem["windows"].InnerText;\r
-                        break;\r
-                    }\r
-                }\r
-            }\r
-\r
-            return file;\r
-         }\r
+            getInfo();\r
+            return hb_file;\r
+        }\r
     }\r
 }
\ No newline at end of file
index 22861b9..95d9f30 100644 (file)
@@ -1,6 +1,5 @@
 using System;\r
 using System.Collections.Generic;\r
-using System.Text;\r
 using System.IO;\r
 using System.Text.RegularExpressions;\r
 \r
index 6496354..caea54b 100644 (file)
@@ -1,6 +1,5 @@
 using System;\r
 using System.Collections.Generic;\r
-using System.Text;\r
 using System.IO;\r
 using System.Text.RegularExpressions;\r
 \r
index 62a40d8..f0982a4 100644 (file)
@@ -1,14 +1,7 @@
 using System;\r
 using System.Collections.Generic;\r
-using System.ComponentModel;\r
-using System.Data;\r
-using System.Drawing;\r
-using System.Text;\r
-using System.Text.RegularExpressions; \r
 using System.Windows.Forms;\r
 using System.IO;\r
-using System.Threading;\r
-using System.Diagnostics;\r
 \r
 namespace Handbrake.Parsing\r
 {\r
index b3edc89..799e8a3 100644 (file)
@@ -1,6 +1,5 @@
 using System;\r
 using System.Collections.Generic;\r
-using System.Text;\r
 using System.IO;\r
 using System.Text.RegularExpressions;\r
 using System.Windows.Forms;\r
@@ -23,18 +22,6 @@ namespace Handbrake.Parsing
     public delegate void ScanProgressEventHandler(object Sender, int CurrentTitle, int TitleCount);\r
 \r
     /// <summary>\r
-    /// A delegate to handle encode progress updates\r
-    /// </summary>\r
-    /// <param name="Sender">The object which raised the event</param>\r
-    /// <param name="CurrentTask">The current task being processed from the queue</param>\r
-    /// <param name="TaskCount">The total number of tasks in queue</param>\r
-    /// <param name="PercentComplete">The percentage this task is complete</param>\r
-    /// <param name="CurrentFps">The current encoding fps</param>\r
-    /// <param name="AverageFps">The average encoding fps for this task</param>\r
-    /// <param name="TimeRemaining">The estimated time remaining for this task to complete</param>\r
-    public delegate void EncodeProgressEventHandler(object Sender, int CurrentTask, int TaskCount, float PercentComplete, float CurrentFps, float AverageFps, TimeSpan TimeRemaining);\r
-\r
-    /// <summary>\r
     /// A simple wrapper around a StreamReader to keep track of the entire output from a cli process\r
     /// </summary>\r
     internal class Parser : StreamReader\r
@@ -66,7 +53,6 @@ namespace Handbrake.Parsing
         /// </summary>\r
         public event ScanProgressEventHandler OnScanProgress;\r
 \r
-        public event EncodeProgressEventHandler OnEncodeProgress;\r
 \r
         /// <summary>\r
         /// Default constructor for this object\r
@@ -93,21 +79,6 @@ namespace Handbrake.Parsing
                 {\r
                     OnScanProgress(this, int.Parse(m.Groups[1].Value), int.Parse(m.Groups[2].Value));\r
                 }\r
-                m = Regex.Match(tmp, @"^Encoding: task ([0-9]*) of ([0-9]*), ([0-9]*\.[0-9]*) %( \(([0-9]*\.[0-9]*) fps, avg ([0-9]*\.[0-9]*) fps, ETA ([0-9]{2})h([0-9]{2})m([0-9]{2})s\))?");\r
-                if (m.Success && OnEncodeProgress != null)\r
-                {\r
-                    int currentTask = int.Parse(m.Groups[1].Value);\r
-                    int totalTasks = int.Parse(m.Groups[2].Value);\r
-                    float percent = float.Parse(m.Groups[3].Value, Functions.CLI.Culture);\r
-                    float currentFps = m.Groups[5].Value == string.Empty ? 0.0F : float.Parse(m.Groups[5].Value, Functions.CLI.Culture);\r
-                    float avgFps = m.Groups[6].Value == string.Empty ? 0.0F : float.Parse(m.Groups[6].Value, Functions.CLI.Culture);\r
-                    TimeSpan remaining = TimeSpan.Zero;\r
-                    if (m.Groups[7].Value != string.Empty)\r
-                    {\r
-                        remaining = TimeSpan.Parse(m.Groups[7].Value + ":" + m.Groups[8].Value + ":" + m.Groups[9].Value);\r
-                    }\r
-                    OnEncodeProgress(this, currentTask, totalTasks, percent, currentFps, avgFps, remaining);\r
-                }\r
             }\r
             catch (Exception exc)\r
             {\r
index 8fb889f..6d83d26 100644 (file)
@@ -1,6 +1,5 @@
 using System;\r
 using System.Collections.Generic;\r
-using System.Text;\r
 using System.IO;\r
 using System.Text.RegularExpressions;\r
 \r
index 744e5b6..b1f02d9 100644 (file)
@@ -1,6 +1,5 @@
 using System;\r
 using System.Collections.Generic;\r
-using System.Text;\r
 using System.Drawing;\r
 using System.IO;\r
 using System.Windows.Forms;\r
index 9fea5a3..7c112d8 100644 (file)
@@ -158,7 +158,7 @@ namespace Handbrake.Properties {
         \r
         [global::System.Configuration.UserScopedSettingAttribute()]\r
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\r
-        [global::System.Configuration.DefaultSettingValueAttribute("1101")]\r
+        [global::System.Configuration.DefaultSettingValueAttribute("1000")]\r
         public int build {\r
             get {\r
                 return ((int)(this["build"]));\r
index 40cb829..2479d16 100644 (file)
@@ -36,7 +36,7 @@
       <Value Profile="(Default)" />\r
     </Setting>\r
     <Setting Name="build" Type="System.Int32" Scope="User">\r
-      <Value Profile="(Default)">1101</Value>\r
+      <Value Profile="(Default)">1000</Value>\r
     </Setting>\r
     <Setting Name="skipversion" Type="System.Int32" Scope="User">\r
       <Value Profile="(Default)">0</Value>\r
index 1b1b519..e019fd4 100644 (file)
@@ -41,7 +41,7 @@
                 <value />\r
             </setting>\r
             <setting name="build" serializeAs="String">\r
-                <value>1101</value>\r
+                <value>1000</value>\r
             </setting>\r
             <setting name="skipversion" serializeAs="String">\r
                 <value>0</value>\r
index 407d00b..863fb62 100644 (file)
@@ -14,7 +14,6 @@ using System.Runtime.InteropServices;
 using System.Globalization;\r
 using System.Text.RegularExpressions;\r
 \r
-\r
 namespace Handbrake\r
 {\r
     public partial class frmMain : Form\r
@@ -1207,8 +1206,6 @@ namespace Handbrake
         public string GenerateTheQuery()\r
         {\r
             \r
-\r
-\r
             // Source tab\r
             #region source\r
             string source = text_source.Text;\r
@@ -1859,6 +1856,7 @@ namespace Handbrake
             this.thisDVD = dvd;\r
         }\r
 \r
+        // Automatic File Naming\r
         public void autoName()\r
         {\r
             if (Properties.Settings.Default.autoNaming == "Checked")\r
@@ -1921,6 +1919,7 @@ namespace Handbrake
             }\r
         }\r
 \r
+        // Chapter Marker Tab\r
         private void chapterNaming()\r
         {\r
             try\r