diff options
Diffstat (limited to 'win')
-rw-r--r-- | win/C#/Parsing/Title.cs | 83 | ||||
-rw-r--r-- | win/C#/Properties/Settings.Designer.cs | 4 | ||||
-rw-r--r-- | win/C#/Properties/Settings.settings | 4 | ||||
-rw-r--r-- | win/C#/app.config | 4 |
4 files changed, 65 insertions, 30 deletions
diff --git a/win/C#/Parsing/Title.cs b/win/C#/Parsing/Title.cs index 3c3aaca74..1611f5c23 100644 --- a/win/C#/Parsing/Title.cs +++ b/win/C#/Parsing/Title.cs @@ -130,8 +130,8 @@ namespace Handbrake.Parsing /// <returns>A string representing this track in the format: {title #} (00:00:00)</returns>
public override string ToString()
{
- return string.Format("{0} ({1:00}:{2:00}:{3:00})", this.m_titleNumber, this.m_duration.Hours,
- this.m_duration.Minutes, this.m_duration.Seconds);
+ return string.Format("{0} ({1:00}:{2:00}:{3:00})", this.m_titleNumber, this.m_duration.Hours,
+ this.m_duration.Minutes, this.m_duration.Seconds);
}
public static Title Parse(StringReader output)
@@ -139,42 +139,77 @@ namespace Handbrake.Parsing Title thisTitle = new Title();
try
{
- // Match track number for this title
Match m = Regex.Match(output.ReadLine(), @"^\+ title ([0-9]*):");
- if (m.Success)
+ try
{
- thisTitle.m_titleNumber = int.Parse(m.Groups[1].Value);
+ // Match track number for this title
+ if (m.Success)
+ {
+ thisTitle.m_titleNumber = int.Parse(m.Groups[1].Value);
+ }
+ output.ReadLine();
}
- output.ReadLine();
+ catch (Exception exc)
+ {
+ MessageBox.Show("Title.cs - Track Number " + exc.ToString());
+ }
+
// Get duration for this title
-
- m = Regex.Match(output.ReadLine(), @"^ \+ duration: ([0-9]{2}:[0-9]{2}:[0-9]{2})");
- if (m.Success)
+ try
{
- thisTitle.m_duration = TimeSpan.Parse(m.Groups[1].Value);
+ m = Regex.Match(output.ReadLine(), @"^ \+ duration: ([0-9]{2}:[0-9]{2}:[0-9]{2})");
+ if (m.Success)
+ {
+ thisTitle.m_duration = TimeSpan.Parse(m.Groups[1].Value);
+ }
+ }
+ catch (Exception exc)
+ {
+ MessageBox.Show("Title.cs - Duration " + exc.ToString());
}
-
- // Get resolution, aspect ratio and FPS for this title
- m = Regex.Match(output.ReadLine(), @"^ \+ size: ([0-9]*)x([0-9]*), aspect: ([0-9]*\.[0-9]*), ([0-9]*\.[0-9]*) fps");
- if (m.Success)
+ try
+ {
+ // Get resolution, aspect ratio and FPS for this title
+ m = Regex.Match(output.ReadLine(), @"^ \+ size: ([0-9]*)x([0-9]*), aspect: ([0-9]*\.[0-9]*), ([0-9]*\.[0-9]*) fps");
+ if (m.Success)
+ {
+ thisTitle.m_resolution = new Size(int.Parse(m.Groups[1].Value), int.Parse(m.Groups[2].Value));
+ thisTitle.m_aspectRatio = m.Groups[3].ToString(); // Converted to a String from float. Caused issue on french systems
+ // French system floats are 1,78 not 1.78 and the CLI always outputs a .
+ }
+ }
+ catch (Exception exc)
{
- thisTitle.m_resolution = new Size(int.Parse(m.Groups[1].Value), int.Parse(m.Groups[2].Value));
- thisTitle.m_aspectRatio = m.Groups[3].ToString(); // Converted to a String from float. Caused issue on french systems
- // French system floats are 1,78 not 1.78 and the CLI always outputs a .
+ MessageBox.Show("Title.cs - Resolution and Aspect " + exc.ToString());
}
- // Get autocrop region for this title
- m = Regex.Match(output.ReadLine(), @"^ \+ autocrop: ([0-9]*)/([0-9]*)/([0-9]*)/([0-9]*)");
- if (m.Success)
+ try
{
- thisTitle.m_autoCrop = new int[4] { int.Parse(m.Groups[1].Value), int.Parse(m.Groups[2].Value), int.Parse(m.Groups[3].Value), int.Parse(m.Groups[4].Value) };
+ // Get autocrop region for this title
+ m = Regex.Match(output.ReadLine(), @"^ \+ autocrop: ([0-9]*)/([0-9]*)/([0-9]*)/([0-9]*)");
+ if (m.Success)
+ {
+ thisTitle.m_autoCrop = new int[4] { int.Parse(m.Groups[1].Value), int.Parse(m.Groups[2].Value), int.Parse(m.Groups[3].Value), int.Parse(m.Groups[4].Value) };
+ }
+ }
+ catch (Exception exc)
+ {
+ MessageBox.Show("Title.cs - Auto Crop " + exc.ToString());
}
- thisTitle.m_chapters.AddRange(Chapter.ParseList(output));
- thisTitle.m_audioTracks.AddRange(AudioTrack.ParseList(output));
- thisTitle.m_subtitles.AddRange(Subtitle.ParseList(output));
+
+ try
+ {
+ thisTitle.m_chapters.AddRange(Chapter.ParseList(output));
+ thisTitle.m_audioTracks.AddRange(AudioTrack.ParseList(output));
+ thisTitle.m_subtitles.AddRange(Subtitle.ParseList(output));
+ }
+ catch (Exception exc)
+ {
+ MessageBox.Show("Title.cs - Chapters / Audio / Subtitles " + exc.ToString());
+ }
}
catch (Exception exc)
{
diff --git a/win/C#/Properties/Settings.Designer.cs b/win/C#/Properties/Settings.Designer.cs index c85849e3f..fb25c386e 100644 --- a/win/C#/Properties/Settings.Designer.cs +++ b/win/C#/Properties/Settings.Designer.cs @@ -25,7 +25,7 @@ namespace Handbrake.Properties { [global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("2.40")]
+ [global::System.Configuration.DefaultSettingValueAttribute("2.41")]
public string GuiVersion {
get {
return ((string)(this["GuiVersion"]));
@@ -528,7 +528,7 @@ namespace Handbrake.Properties { [global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("0.9.0")]
+ [global::System.Configuration.DefaultSettingValueAttribute("0.9.1")]
public string CliVersion {
get {
return ((string)(this["CliVersion"]));
diff --git a/win/C#/Properties/Settings.settings b/win/C#/Properties/Settings.settings index 4c573b0ec..8cdfa64e9 100644 --- a/win/C#/Properties/Settings.settings +++ b/win/C#/Properties/Settings.settings @@ -3,7 +3,7 @@ <Profiles />
<Settings>
<Setting Name="GuiVersion" Type="System.String" Scope="User">
- <Value Profile="(Default)">2.40</Value>
+ <Value Profile="(Default)">2.41</Value>
</Setting>
<Setting Name="updateFile" Type="System.String" Scope="User">
<Value Profile="(Default)">http://download.m0k.org/handbrake/windows/update.txt</Value>
@@ -129,7 +129,7 @@ <Value Profile="(Default)" />
</Setting>
<Setting Name="CliVersion" Type="System.String" Scope="User">
- <Value Profile="(Default)">0.9.0</Value>
+ <Value Profile="(Default)">0.9.1</Value>
</Setting>
</Settings>
</SettingsFile>
\ No newline at end of file diff --git a/win/C#/app.config b/win/C#/app.config index cbddc2c98..9453e432b 100644 --- a/win/C#/app.config +++ b/win/C#/app.config @@ -8,7 +8,7 @@ <userSettings>
<Handbrake.Properties.Settings>
<setting name="GuiVersion" serializeAs="String">
- <value>2.40</value>
+ <value>2.41</value>
</setting>
<setting name="updateFile" serializeAs="String">
<value>http://download.m0k.org/handbrake/windows/update.txt</value>
@@ -131,7 +131,7 @@ <value />
</setting>
<setting name="CliVersion" serializeAs="String">
- <value>0.9.0</value>
+ <value>0.9.1</value>
</setting>
</Handbrake.Properties.Settings>
</userSettings>
|