diff options
author | sr55 <[email protected]> | 2009-01-03 20:34:11 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2009-01-03 20:34:11 +0000 |
commit | 6a22d98935aced40eef5279465f6cba645d04731 (patch) | |
tree | fb6286f29682c32921becc93811a12fc137c4862 /win/C# | |
parent | ff2720b7225779ef2ce592c0c9fc674c7d6eb76e (diff) |
WinGui:
- Just a small tidyup of title.cs and encode.cs
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2055 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#')
-rw-r--r-- | win/C#/Functions/Encode.cs | 25 | ||||
-rw-r--r-- | win/C#/Parsing/Title.cs | 5 |
2 files changed, 18 insertions, 12 deletions
diff --git a/win/C#/Functions/Encode.cs b/win/C#/Functions/Encode.cs index 471acb586..7c3f436fa 100644 --- a/win/C#/Functions/Encode.cs +++ b/win/C#/Functions/Encode.cs @@ -17,14 +17,18 @@ namespace Handbrake.Functions {
public class Encode
{
- /// <summary>
- /// CLI output is based on en-US locale,
- /// we use this CultureInfo as IFormatProvider to *.Parse() calls
- /// </summary>
- static readonly public CultureInfo Culture = new CultureInfo("en-US", false);
+ // DLL Imports
+ [DllImport("user32.dll")]
+ public static extern void LockWorkStation();
+ [DllImport("user32.dll")]
+ public static extern int ExitWindowsEx(int uFlags, int dwReason);
+ // Declarations
Process hbProc = new Process();
+ // CLI output is based on en-US locale,
+ static readonly private CultureInfo Culture = new CultureInfo("en-US", false);
+
/// <summary>
/// Execute a HandBrakeCLI process.
/// </summary>
@@ -73,12 +77,10 @@ namespace Handbrake.Functions }
return hbProc;
}
-
- [DllImport("user32.dll")]
- public static extern void LockWorkStation();
- [DllImport("user32.dll")]
- public static extern int ExitWindowsEx(int uFlags, int dwReason);
-
+
+ /// <summary>
+ /// Perform an action after an encode. e.g a shutdown, standby, restart etc.
+ /// </summary>
public void afterEncodeAction()
{
// Do something whent he encode ends.
@@ -165,5 +167,6 @@ namespace Handbrake.Functions }
}
}
+
}
}
diff --git a/win/C#/Parsing/Title.cs b/win/C#/Parsing/Title.cs index 05521c027..6f0f6ffc3 100644 --- a/win/C#/Parsing/Title.cs +++ b/win/C#/Parsing/Title.cs @@ -10,6 +10,7 @@ using System.Drawing; using System.IO;
using System.Windows.Forms;
using System.Text.RegularExpressions;
+using System.Globalization;
namespace Handbrake.Parsing
{
@@ -139,6 +140,8 @@ namespace Handbrake.Parsing this.m_duration.Minutes, this.m_duration.Seconds);
}
+ static readonly private CultureInfo Culture = new CultureInfo("en-US", false);
+
public static Title Parse(StringReader output)
{
Title thisTitle = new Title();
@@ -161,7 +164,7 @@ namespace Handbrake.Parsing if (m.Success)
{
thisTitle.m_resolution = new Size(int.Parse(m.Groups[1].Value), int.Parse(m.Groups[2].Value));
- thisTitle.m_aspectRatio = float.Parse(m.Groups[3].Value, Functions.Encode.Culture);
+ thisTitle.m_aspectRatio = float.Parse(m.Groups[3].Value, Culture);
}
// Get autocrop region for this title
|