OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 3 Jan 2009 20:34:11 +0000 (20:34 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 3 Jan 2009 20:34:11 +0000 (20:34 +0000)
- Just a small tidyup of title.cs and encode.cs

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

win/C#/Functions/Encode.cs
win/C#/Parsing/Title.cs

index 471acb5..7c3f436 100644 (file)
@@ -17,14 +17,18 @@ namespace Handbrake.Functions
 {\r
     public class Encode\r
     {\r
-        /// <summary>\r
-        /// CLI output is based on en-US locale,\r
-        /// we use this CultureInfo as IFormatProvider to *.Parse() calls\r
-        /// </summary>\r
-        static readonly public CultureInfo Culture = new CultureInfo("en-US", false);\r
+        // DLL Imports\r
+        [DllImport("user32.dll")]\r
+        public static extern void LockWorkStation();\r
+        [DllImport("user32.dll")]\r
+        public static extern int ExitWindowsEx(int uFlags, int dwReason);\r
 \r
+        // Declarations\r
         Process hbProc = new Process();\r
 \r
+        // CLI output is based on en-US locale,\r
+        static readonly private CultureInfo Culture = new CultureInfo("en-US", false);\r
+\r
         /// <summary>\r
         /// Execute a HandBrakeCLI process.\r
         /// </summary>\r
@@ -73,12 +77,10 @@ namespace Handbrake.Functions
             }\r
             return hbProc;\r
         }\r
-\r
-        [DllImport("user32.dll")]\r
-        public static extern void LockWorkStation();\r
-        [DllImport("user32.dll")]\r
-        public static extern int ExitWindowsEx(int uFlags, int dwReason);\r
-\r
+        \r
+        /// <summary>\r
+        /// Perform an action after an encode. e.g a shutdown, standby, restart etc.\r
+        /// </summary>\r
         public void afterEncodeAction()\r
         {\r
             // Do something whent he encode ends.\r
@@ -165,5 +167,6 @@ namespace Handbrake.Functions
                 }\r
             }\r
         }\r
+\r
     }\r
 }\r
index 05521c0..6f0f6ff 100644 (file)
@@ -10,6 +10,7 @@ using System.Drawing;
 using System.IO;\r
 using System.Windows.Forms;\r
 using System.Text.RegularExpressions;\r
+using System.Globalization;\r
 \r
 namespace Handbrake.Parsing\r
 {\r
@@ -139,6 +140,8 @@ namespace Handbrake.Parsing
              this.m_duration.Minutes, this.m_duration.Seconds);\r
         }\r
 \r
+        static readonly private CultureInfo Culture = new CultureInfo("en-US", false);\r
+\r
         public static Title Parse(StringReader output)\r
         {\r
             Title thisTitle = new Title();\r
@@ -161,7 +164,7 @@ namespace Handbrake.Parsing
             if (m.Success)\r
             {\r
                 thisTitle.m_resolution = new Size(int.Parse(m.Groups[1].Value), int.Parse(m.Groups[2].Value));\r
-                thisTitle.m_aspectRatio = float.Parse(m.Groups[3].Value, Functions.Encode.Culture);\r
+                thisTitle.m_aspectRatio = float.Parse(m.Groups[3].Value, Culture);\r
             }\r
 \r
             // Get autocrop region for this title\r