summaryrefslogtreecommitdiffstats
path: root/win/C#
diff options
context:
space:
mode:
authorsr55 <[email protected]>2009-06-12 19:35:23 +0000
committersr55 <[email protected]>2009-06-12 19:35:23 +0000
commitc9987f3bb7a178159687e53edc88bc55ccb5cfd3 (patch)
tree1aee9e5161f8cf9d0480ac946e8ce34b06c0657a /win/C#
parentcf35c076ee44d65de63ff83cbda910be2c7a6232 (diff)
WinGui:
- Added support for the new subtitle information in the log format. Will deal with the new GUI elements later. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2525 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#')
-rw-r--r--win/C#/HandBrakeCS.csproj10
-rw-r--r--win/C#/Parsing/Subtitle.cs26
2 files changed, 34 insertions, 2 deletions
diff --git a/win/C#/HandBrakeCS.csproj b/win/C#/HandBrakeCS.csproj
index 8e294d90d..d0082e299 100644
--- a/win/C#/HandBrakeCS.csproj
+++ b/win/C#/HandBrakeCS.csproj
@@ -142,6 +142,12 @@
<Compile Include="Controls\PictureSettings.Designer.cs">
<DependentUpon>PictureSettings.cs</DependentUpon>
</Compile>
+ <Compile Include="Controls\Subtitles.cs">
+ <SubType>UserControl</SubType>
+ </Compile>
+ <Compile Include="Controls\Subtitles.Designer.cs">
+ <DependentUpon>Subtitles.cs</DependentUpon>
+ </Compile>
<Compile Include="Controls\x264Panel.cs">
<SubType>UserControl</SubType>
</Compile>
@@ -251,6 +257,10 @@
<DependentUpon>PictureSettings.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
+ <EmbeddedResource Include="Controls\Subtitles.resx">
+ <DependentUpon>Subtitles.cs</DependentUpon>
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
<EmbeddedResource Include="Controls\x264Panel.resx">
<DependentUpon>x264Panel.cs</DependentUpon>
<SubType>Designer</SubType>
diff --git a/win/C#/Parsing/Subtitle.cs b/win/C#/Parsing/Subtitle.cs
index e3ff72af0..1fe45c27f 100644
--- a/win/C#/Parsing/Subtitle.cs
+++ b/win/C#/Parsing/Subtitle.cs
@@ -17,6 +17,8 @@ namespace Handbrake.Parsing
{
private string m_language;
private int m_trackNumber;
+ private string m_type;
+ private string m_typecode;
/// <summary>
/// The track number of this Subtitle
@@ -35,6 +37,24 @@ namespace Handbrake.Parsing
}
/// <summary>
+ /// Langauage Code
+ /// </summary>
+ public string LanguageCode
+ {
+ get { return m_typecode; }
+ }
+
+
+ /// <summary>
+ /// Subtitle Type
+ /// </summary>
+ public string Type
+ {
+ get { return m_type; }
+ }
+
+
+ /// <summary>
/// Override of the ToString method to make this object easier to use in the UI
/// </summary>
/// <returns>A string formatted as: {track #} {language}</returns>
@@ -47,13 +67,15 @@ namespace Handbrake.Parsing
{
string curLine = output.ReadLine();
- Match m = Regex.Match(curLine, @"^ \+ ([0-9]*), ([A-Za-z, ]*) \((.*)\)");
+ Match m = Regex.Match(curLine, @"^ \+ ([0-9]*), ([A-Za-z, ]*) \((.*)\) \(([a-zA-Z]*)\)");
if (m.Success && !curLine.Contains("HandBrake has exited."))
{
var thisSubtitle = new Subtitle
{
m_trackNumber = int.Parse(m.Groups[1].Value.Trim()),
- m_language = m.Groups[2].Value
+ m_language = m.Groups[2].Value,
+ m_typecode = m.Groups[3].Value,
+ m_type = m.Groups[4].Value
};
return thisSubtitle;
}