summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;
}