diff options
author | sr55 <[email protected]> | 2010-10-01 16:31:13 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2010-10-01 16:31:13 +0000 |
commit | 987a133a592c191ea0ec416da61faceb9b54f5ff (patch) | |
tree | 3df06d3faa2c3f872ccf4e560e7eac04ed3efce9 | |
parent | e4a8a2d7fbb5280613de16197524715316522e5e (diff) |
WinGui:
- Some refactoring of the Subtitle panel. Added support for subtitle type display to the subtitle dropdown and burn in support for SSA.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3560 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | win/C#/Controls/Subtitles.cs | 230 | ||||
-rw-r--r-- | win/C#/HandBrake.ApplicationServices/Model/SubtitleType.cs | 22 | ||||
-rw-r--r-- | win/C#/HandBrake.ApplicationServices/Parsing/Subtitle.cs | 42 | ||||
-rw-r--r-- | win/C#/HandBrake.Framework/HandBrake.Framework.csproj | 1 | ||||
-rw-r--r-- | win/C#/HandBrake.Framework/Helpers/EnumHelper.cs | 35 | ||||
-rw-r--r-- | win/C#/HandBrake10.5.1.ReSharper | 5 | ||||
-rw-r--r-- | win/C#/Model/Subtitle.cs | 19 | ||||
-rw-r--r-- | win/C#/frmMain.Designer.cs | 8 | ||||
-rw-r--r-- | win/C#/frmMain.resx | 21 |
9 files changed, 239 insertions, 144 deletions
diff --git a/win/C#/Controls/Subtitles.cs b/win/C#/Controls/Subtitles.cs index dec3ec11a..2a22dee52 100644 --- a/win/C#/Controls/Subtitles.cs +++ b/win/C#/Controls/Subtitles.cs @@ -11,6 +11,9 @@ namespace Handbrake.Controls using System.Linq;
using System.Windows.Forms;
using Functions;
+
+ using HandBrake.ApplicationServices.Model;
+
using Model;
/// <summary>
@@ -18,6 +21,8 @@ namespace Handbrake.Controls /// </summary>
public partial class Subtitles : UserControl
{
+ #region Priavate Variables and Collections
+
/// <summary>
/// Map of languages to language codes
/// </summary>
@@ -33,6 +38,8 @@ namespace Handbrake.Controls /// </summary>
private readonly List<SubtitleInfo> subList = new List<SubtitleInfo>();
+ #endregion
+
/// <summary>
/// Initializes a new instance of the <see cref="Subtitles"/> class.
/// </summary>
@@ -48,6 +55,7 @@ namespace Handbrake.Controls srt_lang.SelectedIndex = 40;
}
+ #region Public Methods
/// <summary>
/// Gets the CLI Query for this panel
/// </summary>
@@ -84,7 +92,7 @@ namespace Handbrake.Controls srtLang += srtLang == string.Empty ? langMap[item.SrtLang] : "," + langMap[item.SrtLang];
srtCodeset += srtCodeset == string.Empty ? item.SrtCharCode : "," + item.SrtCharCode;
- if (item.Default == "Yes")
+ if (item.Default)
srtDefault = srtCount.ToString();
itemToAdd = item.SrtPath;
@@ -113,7 +121,7 @@ namespace Handbrake.Controls tempSub = item.Track.Split(' ');
trackId = tempSub[0];
- if (item.Forced == "Yes")
+ if (item.Forced)
itemToAdd = trackId;
if (itemToAdd != string.Empty)
@@ -125,10 +133,10 @@ namespace Handbrake.Controls if (trackId.Trim() == "Foreign") // foreign audio search
trackId = "scan";
- if (item.Burned == "Yes") // burn
+ if (item.Burned) // burn
subtitleBurn = trackId;
- if (item.Default == "Yes") // default
+ if (item.Default) // default
subtitleDefault = trackId;
}
}
@@ -164,7 +172,76 @@ namespace Handbrake.Controls }
}
- /* Primary Controls */
+ /// <summary>
+ /// Checks of the current settings will require the m4v file extension
+ /// </summary>
+ /// <returns>True if Yes</returns>
+ public bool RequiresM4V()
+ {
+ return this.subList.Any(track => track.SubtitleType != SubtitleType.VobSub);
+ }
+
+ /// <summary>
+ /// Automatically setup the subtitle tracks.
+ /// This handles the automatic setup of subitles which the user can control from the program options
+ /// </summary>
+ /// <param name="subs">List of Subtitles</param>
+ public void SetSubtitleTrackAuto(object[] subs)
+ {
+ drp_subtitleTracks.Items.Clear();
+ drp_subtitleTracks.Items.Add("Foreign Audio Search (Bitmap)");
+ drp_subtitleTracks.Items.AddRange(subs);
+ drp_subtitleTracks.SelectedIndex = 0;
+ Clear();
+
+ this.AutomaticSubtitleSelection();
+ }
+
+ /// <summary>
+ /// Automatic Subtitle Selection based on user preferences.
+ /// </summary>
+ public void AutomaticSubtitleSelection()
+ {
+ // Handle Native Language and "Dub Foreign language audio" and "Use Foreign language audio and Subtitles" Options
+ if (Properties.Settings.Default.NativeLanguage != "Any")
+ {
+ if (Properties.Settings.Default.DubMode != 1) // We need to add a subtitle track if this is false.
+ {
+ foreach (object item in drp_subtitleTracks.Items)
+ {
+ if (item.ToString().Contains(Properties.Settings.Default.NativeLanguage))
+ {
+ drp_subtitleTracks.SelectedItem = item;
+ BtnAddSubTrackClick(this, new EventArgs());
+ }
+ }
+
+ if (drp_subtitleTracks.SelectedIndex == 0 && Properties.Settings.Default.useClosedCaption)
+ {
+ foreach (object item in drp_subtitleTracks.Items)
+ {
+ if (item.ToString().Contains("Closed"))
+ {
+ drp_subtitleTracks.SelectedItem = item;
+ BtnAddSubTrackClick(this, new EventArgs());
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Clear the Subtitle List
+ /// </summary>
+ public void Clear()
+ {
+ lv_subList.Items.Clear();
+ subList.Clear();
+ }
+ #endregion
+
+ #region Primary Controls
/// <summary>
/// Add a Subtitle track.
@@ -181,7 +258,7 @@ namespace Handbrake.Controls string forcedVal = check_forced.CheckState == CheckState.Checked ? "Yes" : "No";
string defaultSub = check_default.CheckState == CheckState.Checked ? "Yes" : "No";
string burnedVal = check_burned.CheckState == CheckState.Checked &&
- (!drp_subtitleTracks.Text.Contains("Text"))
+ (drp_subtitleTracks.Text.Contains("(VOBSUB)") || drp_subtitleTracks.Text.Contains("(SSA)"))
? "Yes"
: "No";
string srtCode = "-", srtLangVal = "-", srtPath = "-", srtFile = "-";
@@ -189,19 +266,17 @@ namespace Handbrake.Controls if (drp_subtitleTracks.SelectedItem.ToString().Contains(".srt"))
{
- burnedVal = "No";
- forcedVal = "No";
srtFiles.TryGetValue(drp_subtitleTracks.SelectedItem.ToString(), out srtPath);
srtFile = drp_subtitleTracks.SelectedItem.ToString();
srtLangVal = srt_lang.SelectedItem.ToString();
srtCode = srt_charcode.SelectedItem.ToString();
srtOffsetMs = (int)srt_offset.Value;
- if (defaultSub == "Yes") SetNoSrtDefault();
+ if (defaultSub == "Yes") this.SetDefaultToOffForAllSRTTracks();
}
else
{
- if (defaultSub == "Yes") SetNoDefault();
- if (burnedVal == "Yes") SetNoBurned();
+ if (defaultSub == "Yes") this.SetDefaultToOffForAllTracks();
+ if (burnedVal == "Yes") this.SetBurnedToOffForAllTracks();
}
string trackName = (drp_subtitleTracks.SelectedItem.ToString().Contains(".srt"))
@@ -211,9 +286,9 @@ namespace Handbrake.Controls SubtitleInfo track = new SubtitleInfo
{
Track = trackName,
- Forced = forcedVal,
- Burned = burnedVal,
- Default = defaultSub,
+ Forced = check_forced.Checked,
+ Burned = check_burned.Checked,
+ Default = check_default.Checked,
SrtLang = srtLangVal,
SrtCharCode = srtCode,
SrtOffset = srtOffsetMs,
@@ -265,7 +340,7 @@ namespace Handbrake.Controls /// </param>
private void BtnRemoveSubTrackClick(object sender, EventArgs e)
{
- RemoveTrack();
+ this.RemoveSelectedTrack();
}
/// <summary>
@@ -297,7 +372,7 @@ namespace Handbrake.Controls srt_lang.SelectedItem = track.SrtLang;
srt_offset.Value = track.SrtOffset;
srt_charcode.SelectedItem = track.SrtCharCode;
- check_default.CheckState = track.Default == "Yes" ? CheckState.Checked : CheckState.Unchecked;
+ check_default.CheckState = track.Default ? CheckState.Checked : CheckState.Unchecked;
SubGroupBox.Text = "Selected Track: " + track.Track;
}
else // We have Bitmap/CC
@@ -308,9 +383,9 @@ namespace Handbrake.Controls drp_subtitleTracks.SelectedIndex = c;
c++;
}
- check_forced.CheckState = track.Forced == "Yes" ? CheckState.Checked : CheckState.Unchecked;
- check_burned.CheckState = track.Burned == "Yes" ? CheckState.Checked : CheckState.Unchecked;
- check_default.CheckState = track.Default == "Yes" ? CheckState.Checked : CheckState.Unchecked;
+ check_forced.CheckState = track.Forced ? CheckState.Checked : CheckState.Unchecked;
+ check_burned.CheckState = track.Burned ? CheckState.Checked : CheckState.Unchecked;
+ check_default.CheckState = track.Default ? CheckState.Checked : CheckState.Unchecked;
SubGroupBox.Text = "Selected Track: " +
lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[0].Text;
}
@@ -319,7 +394,9 @@ namespace Handbrake.Controls SubGroupBox.Text = "Selected Track: None (Click \"Add\" to add another track to the list)";
}
- /* Bitmap / CC / SRT Controls */
+ #endregion
+
+ #region Subtitle Controls
/// <summary>
/// Handle the Subtitle track dropdown changed event
@@ -387,7 +464,7 @@ namespace Handbrake.Controls lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[1].Text = check_forced.Checked ? "Yes" : "No";
lv_subList.Select();
- subList[lv_subList.SelectedIndices[0]].Forced = check_forced.Checked ? "Yes" : "No";
+ subList[lv_subList.SelectedIndices[0]].Forced = check_forced.Checked;
// Update SubList List<SubtitleInfo>
}
@@ -405,12 +482,12 @@ namespace Handbrake.Controls if (lv_subList.Items.Count == 0 || lv_subList.SelectedIndices.Count == 0) return;
if (check_burned.Checked) // Make sure we only have 1 burned track
- SetNoBurned();
+ this.SetBurnedToOffForAllTracks();
lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[2].Text = check_burned.Checked ? "Yes" : "No";
lv_subList.Select();
- subList[lv_subList.SelectedIndices[0]].Burned = check_burned.Checked ? "Yes" : "No";
+ subList[lv_subList.SelectedIndices[0]].Burned = check_burned.Checked;
// Update SubList List<SubtitleInfo>
}
@@ -429,14 +506,14 @@ namespace Handbrake.Controls if (check_default.Checked) // Make sure we only have 1 default track
if (lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[0].Text.Contains(".srt"))
- SetNoSrtDefault();
+ this.SetDefaultToOffForAllSRTTracks();
else
- SetNoDefault();
+ this.SetDefaultToOffForAllTracks();
lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[3].Text = check_default.Checked ? "Yes" : "No";
lv_subList.Select();
- subList[lv_subList.SelectedIndices[0]].Default = check_default.Checked ? "Yes" : "No";
+ subList[lv_subList.SelectedIndices[0]].Default = check_default.Checked;
// Update SubList List<SubtitleInfo>
}
@@ -502,7 +579,9 @@ namespace Handbrake.Controls // Update SubList List<SubtitleInfo>
}
- /* Right Click Menu */
+ #endregion
+
+ #region Right Click Menu
/// <summary>
/// Move an item in the subtitle list up
@@ -569,15 +648,16 @@ namespace Handbrake.Controls /// </param>
private void MnuRemoveClick(object sender, EventArgs e)
{
- RemoveTrack();
+ this.RemoveSelectedTrack();
}
- /* Functions */
+ #endregion
+ #region Helpers
/// <summary>
/// Set all Non SRT tracks to Default = NO
/// </summary>
- private void SetNoDefault()
+ private void SetDefaultToOffForAllTracks()
{
int c = 0;
foreach (ListViewItem item in lv_subList.Items)
@@ -587,7 +667,7 @@ namespace Handbrake.Controls if (item.SubItems[3].Text == "Yes")
{
item.SubItems[3].Text = "No";
- subList[c].Default = "No";
+ subList[c].Default = false;
}
}
c++;
@@ -597,7 +677,7 @@ namespace Handbrake.Controls /// <summary>
/// Set all subtitle tracks so that they have no default.
/// </summary>
- private void SetNoSrtDefault()
+ private void SetDefaultToOffForAllSRTTracks()
{
int c = 0;
foreach (ListViewItem item in lv_subList.Items)
@@ -607,7 +687,7 @@ namespace Handbrake.Controls if (item.SubItems[3].Text == "Yes")
{
item.SubItems[3].Text = "No";
- subList[c].Default = "No";
+ subList[c].Default = false;
}
}
c++;
@@ -617,7 +697,7 @@ namespace Handbrake.Controls /// <summary>
/// Set all tracks to Burned = No
/// </summary>
- private void SetNoBurned()
+ private void SetBurnedToOffForAllTracks()
{
int c = 0;
foreach (ListViewItem item in lv_subList.Items)
@@ -625,7 +705,7 @@ namespace Handbrake.Controls if (item.SubItems[2].Text == "Yes")
{
item.SubItems[2].Text = "No";
- subList[c].Burned = "No";
+ subList[c].Burned = false;
}
c++;
}
@@ -634,7 +714,7 @@ namespace Handbrake.Controls /// <summary>
/// Remove a selected track
/// </summary>
- private void RemoveTrack()
+ private void RemoveSelectedTrack()
{
// Remove the Item and reselect the control if the following conditions are met.
if (lv_subList.SelectedItems.Count != 0)
@@ -658,82 +738,6 @@ namespace Handbrake.Controls }
}
}
-
- /// <summary>
- /// Clear the Subtitle List
- /// </summary>
- public void Clear()
- {
- lv_subList.Items.Clear();
- subList.Clear();
- }
-
- /// <summary>
- /// Checks of the current settings will require the m4v file extension
- /// </summary>
- /// <returns>True if Yes</returns>
- public bool RequiresM4V()
- {
- return this.lv_subList.Items.Cast<ListViewItem>().Any(item => item.SubItems.Count != 5 || item.SubItems[1].Text.Contains("(Text)"));
- }
-
- /// <summary>
- /// Automatically setup the subtitle tracks.
- /// This handles the automatic setup of subitles which the user can control from the program options
- /// </summary>
- /// <param name="subs">List of Subtitles</param>
- public void SetSubtitleTrackAuto(object[] subs)
- {
- drp_subtitleTracks.Items.Clear();
- drp_subtitleTracks.Items.Add("Foreign Audio Search (Bitmap)");
- drp_subtitleTracks.Items.AddRange(subs);
- drp_subtitleTracks.SelectedIndex = 0;
- Clear();
-
- this.AutomaticSubtitleSelection();
- }
-
- /// <summary>
- /// Automatic Subtitle Selection based on user preferences.
- /// </summary>
- public void AutomaticSubtitleSelection()
- {
- // Handle Native Language and "Dub Foreign language audio" and "Use Foreign language audio and Subtitles" Options
- if (Properties.Settings.Default.NativeLanguage != "Any")
- {
- if (Properties.Settings.Default.DubMode != 1) // We need to add a subtitle track if this is false.
- {
- foreach (object item in drp_subtitleTracks.Items)
- {
- if (item.ToString().Contains(Properties.Settings.Default.NativeLanguage))
- {
- drp_subtitleTracks.SelectedItem = item;
- BtnAddSubTrackClick(this, new EventArgs());
- }
- }
-
- if (drp_subtitleTracks.SelectedIndex == 0 && Properties.Settings.Default.useClosedCaption)
- {
- foreach (object item in drp_subtitleTracks.Items)
- {
- if (item.ToString().Contains("Closed"))
- {
- drp_subtitleTracks.SelectedItem = item;
- BtnAddSubTrackClick(this, new EventArgs());
- }
- }
- }
- }
- }
- }
-
- /// <summary>
- /// Get the list of subtitles.
- /// </summary>
- /// <returns>A List of SubtitleInfo Object</returns>
- public List<SubtitleInfo> GetSubtitleInfoList()
- {
- return subList;
- }
+ #endregion
}
}
\ No newline at end of file diff --git a/win/C#/HandBrake.ApplicationServices/Model/SubtitleType.cs b/win/C#/HandBrake.ApplicationServices/Model/SubtitleType.cs index b7ceabdbf..f362a4b74 100644 --- a/win/C#/HandBrake.ApplicationServices/Model/SubtitleType.cs +++ b/win/C#/HandBrake.ApplicationServices/Model/SubtitleType.cs @@ -5,14 +5,26 @@ namespace HandBrake.ApplicationServices.Model
{
+ using System.ComponentModel;
+
/// <summary>
/// Subtitle Type.
- /// 0: Picture
- /// 1: Text
/// </summary>
public enum SubtitleType
{
- Picture,
- Text
+ [Description("SSA")]
+ SSA,
+ [Description("SRT")]
+ SRT,
+ [Description("VobSub")]
+ VobSub,
+ [Description("CC")]
+ CC,
+ [Description("UTF8")]
+ UTF8Sub,
+ [Description("TX3G")]
+ TX3G,
+ [Description("Unknown")]
+ Unknown
}
-}
+}
\ No newline at end of file diff --git a/win/C#/HandBrake.ApplicationServices/Parsing/Subtitle.cs b/win/C#/HandBrake.ApplicationServices/Parsing/Subtitle.cs index f4cd65768..f6ecc1287 100644 --- a/win/C#/HandBrake.ApplicationServices/Parsing/Subtitle.cs +++ b/win/C#/HandBrake.ApplicationServices/Parsing/Subtitle.cs @@ -10,6 +10,7 @@ namespace HandBrake.ApplicationServices.Parsing using System.Text.RegularExpressions;
using HandBrake.ApplicationServices.Model;
+ using HandBrake.Framework.Helpers;
/// <summary>
/// An object that represents a subtitle associated with a Title, in a DVD
@@ -43,7 +44,7 @@ namespace HandBrake.ApplicationServices.Parsing {
get
{
- return this.SubtitleType == SubtitleType.Picture ? "Bitmap" : "Text";
+ return EnumHelper.GetDescription(this.SubtitleType);
}
}
@@ -60,16 +61,43 @@ namespace HandBrake.ApplicationServices.Parsing {
string curLine = output.ReadLine();
- Match m = Regex.Match(curLine, @"^ \+ ([0-9]*), ([A-Za-z, ]*) \((.*)\) \(([a-zA-Z]*)\)");
+ // + 1, English (iso639-2: eng) (Text)(SSA)
+ Match m = Regex.Match(curLine, @"^ \+ ([0-9]*), ([A-Za-z, ]*) \((.*)\) \(([a-zA-Z]*)\)\(([a-zA-Z]*)\)");
+
if (m.Success && !curLine.Contains("HandBrake has exited."))
{
var thisSubtitle = new Subtitle
{
- TrackNumber = int.Parse(m.Groups[1].Value.Trim()),
- Language = m.Groups[2].Value,
- LanguageCode = m.Groups[3].Value,
- SubtitleType = m.Groups[4].Value.Contains("Text") ? SubtitleType.Text : SubtitleType.Picture
+ TrackNumber = int.Parse(m.Groups[1].Value.Trim()),
+ Language = m.Groups[2].Value,
+ LanguageCode = m.Groups[3].Value,
};
+
+ switch (m.Groups[5].Value)
+ {
+ case "VOBSUB":
+ thisSubtitle.SubtitleType = SubtitleType.VobSub;
+ break;
+ case "SRT":
+ thisSubtitle.SubtitleType = SubtitleType.SRT;
+ break;
+ case "CC":
+ thisSubtitle.SubtitleType = SubtitleType.CC;
+ break;
+ case "UTF-8":
+ thisSubtitle.SubtitleType = SubtitleType.UTF8Sub;
+ break;
+ case "TX3G":
+ thisSubtitle.SubtitleType = SubtitleType.TX3G;
+ break;
+ case "SSA":
+ thisSubtitle.SubtitleType = SubtitleType.SSA;
+ break;
+ default:
+ thisSubtitle.SubtitleType = SubtitleType.Unknown;
+ break;
+ }
+
return thisSubtitle;
}
return null;
@@ -87,7 +115,7 @@ namespace HandBrake.ApplicationServices.Parsing public static IEnumerable<Subtitle> ParseList(StringReader output)
{
var subtitles = new List<Subtitle>();
- while ((char) output.Peek() != '+')
+ while ((char)output.Peek() != '+')
{
Subtitle thisSubtitle = Parse(output);
diff --git a/win/C#/HandBrake.Framework/HandBrake.Framework.csproj b/win/C#/HandBrake.Framework/HandBrake.Framework.csproj index 9ef6a51c6..ef4246d6a 100644 --- a/win/C#/HandBrake.Framework/HandBrake.Framework.csproj +++ b/win/C#/HandBrake.Framework/HandBrake.Framework.csproj @@ -55,6 +55,7 @@ </ItemGroup>
<ItemGroup>
<Compile Include="Helpers\AppcastReader.cs" />
+ <Compile Include="Helpers\EnumHelper.cs" />
<Compile Include="Model\UpdateCheckResult.cs" />
<Compile Include="Model\UpdateCheckInformation.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
diff --git a/win/C#/HandBrake.Framework/Helpers/EnumHelper.cs b/win/C#/HandBrake.Framework/Helpers/EnumHelper.cs new file mode 100644 index 000000000..74953c37a --- /dev/null +++ b/win/C#/HandBrake.Framework/Helpers/EnumHelper.cs @@ -0,0 +1,35 @@ +/* EnumHelper.cs $
+ This file is part of the HandBrake source code.
+ Homepage: <http://handbrake.fr>.
+ It may be used under the terms of the GNU General Public License. */
+
+namespace HandBrake.Framework.Helpers
+{
+ using System.ComponentModel;
+ using System.Reflection;
+ using System;
+
+ /// <summary>
+ /// Enum Helpers
+ /// </summary>
+ public class EnumHelper
+ {
+ /// <summary>
+ /// Get the description of an Enum
+ /// </summary>
+ /// <param name="value">
+ /// The value.
+ /// </param>
+ /// <returns>
+ /// The Description string
+ /// </returns>
+ public static string GetDescription(Enum value)
+ {
+ FieldInfo fi = value.GetType().GetField(value.ToString());
+ DescriptionAttribute[] attributes =
+ (DescriptionAttribute[])fi.GetCustomAttributes(
+ typeof(DescriptionAttribute), false);
+ return (attributes.Length > 0) ? attributes[0].Description : value.ToString();
+ }
+ }
+}
diff --git a/win/C#/HandBrake10.5.1.ReSharper b/win/C#/HandBrake10.5.1.ReSharper index 22ca79976..42cfee806 100644 --- a/win/C#/HandBrake10.5.1.ReSharper +++ b/win/C#/HandBrake10.5.1.ReSharper @@ -81,6 +81,11 @@ <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="aaBb" ElementKind="PrivateStaticFields" />
<PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="PrivateConstants" />
<PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="PrivateStaticReadonly" />
+ <Abbreviation Text="SSA" />
+ <Abbreviation Text="CC" />
+ <Abbreviation Text="UTF" />
+ <Abbreviation Text="TX" />
+ <Abbreviation Text="SRT" />
</Naming2>
<CustomMemberReorderingPatterns><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<Patterns xmlns="urn:shemas-jetbrains-com:member-reordering-patterns">
diff --git a/win/C#/Model/Subtitle.cs b/win/C#/Model/Subtitle.cs index 9254ab438..605e3da23 100644 --- a/win/C#/Model/Subtitle.cs +++ b/win/C#/Model/Subtitle.cs @@ -7,6 +7,8 @@ namespace Handbrake.Model {
using System.Windows.Forms;
+ using HandBrake.ApplicationServices.Model;
+
/// <summary>
/// Subtitle Information
/// </summary>
@@ -20,17 +22,17 @@ namespace Handbrake.Model /// <summary>
/// Gets or sets the Forced Subtitle
/// </summary>
- public string Forced { get; set; }
+ public bool Forced { get; set; }
/// <summary>
/// Gets or sets the Burned In Subtitle
/// </summary>
- public string Burned { get; set; }
+ public bool Burned { get; set; }
/// <summary>
/// Gets or sets the Default Subtitle Track
/// </summary>
- public string Default { get; set; }
+ public bool Default { get; set; }
/// <summary>
/// Gets or sets the SRT Language
@@ -66,6 +68,11 @@ namespace Handbrake.Model }
/// <summary>
+ /// Gets or sets the type of the subtitle
+ /// </summary>
+ public SubtitleType SubtitleType { get; set; }
+
+ /// <summary>
/// Gets A ListViewItem Containing information about this subitlte
/// </summary>
public ListViewItem ListView
@@ -73,9 +80,9 @@ namespace Handbrake.Model get
{
var listTrack = new ListViewItem(this.Track);
- listTrack.SubItems.Add(this.Forced);
- listTrack.SubItems.Add(this.Burned);
- listTrack.SubItems.Add(this.Default);
+ listTrack.SubItems.Add(this.Forced ? "Yes" : "No");
+ listTrack.SubItems.Add(this.Burned ? "Yes" : "No");
+ listTrack.SubItems.Add(this.Default ? "Yes" : "No");
listTrack.SubItems.Add(this.SrtLang);
listTrack.SubItems.Add(this.SrtCharCode);
listTrack.SubItems.Add(this.SrtOffset.ToString());
diff --git a/win/C#/frmMain.Designer.cs b/win/C#/frmMain.Designer.cs index b42649b43..f4dee1681 100644 --- a/win/C#/frmMain.Designer.cs +++ b/win/C#/frmMain.Designer.cs @@ -39,7 +39,7 @@ namespace Handbrake this.components = new System.ComponentModel.Container();
System.Windows.Forms.ContextMenuStrip notifyIconMenu;
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMain));
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
this.btn_restore = new System.Windows.Forms.ToolStripMenuItem();
this.DVD_Save = new System.Windows.Forms.SaveFileDialog();
this.ToolTip = new System.Windows.Forms.ToolTip(this.components);
@@ -407,9 +407,9 @@ namespace Handbrake //
// number
//
- dataGridViewCellStyle1.Format = "N0";
- dataGridViewCellStyle1.NullValue = null;
- this.number.DefaultCellStyle = dataGridViewCellStyle1;
+ dataGridViewCellStyle2.Format = "N0";
+ dataGridViewCellStyle2.NullValue = null;
+ this.number.DefaultCellStyle = dataGridViewCellStyle2;
this.number.Frozen = true;
this.number.HeaderText = "Chapter Number";
this.number.MaxInputLength = 3;
diff --git a/win/C#/frmMain.resx b/win/C#/frmMain.resx index ef0cad28a..dc017b2cd 100644 --- a/win/C#/frmMain.resx +++ b/win/C#/frmMain.resx @@ -583,6 +583,18 @@ Clear the text box below to return to the internal query generation.</value> <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>98</value>
</metadata>
+ <metadata name="File_Save.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>664, 15</value>
+ </metadata>
+ <metadata name="openPreset.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>680, 54</value>
+ </metadata>
+ <metadata name="File_ChapterImport.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>787, 54</value>
+ </metadata>
+ <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>98</value>
+ </metadata>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAYAMDAAAAEACACoDgAAZgAAACAgAAABAAgAqAgAAA4PAAAQEAAAAQAIAGgFAAC2FwAAMDAAAAEA
@@ -962,13 +974,4 @@ Clear the text box below to return to the internal query generation.</value> AAD6AQAA4AEAAMABAACAAQAAgAEAAMBBAADAYQAAjGEAAIRhAADc+wAA3/8AAA==
</value>
</data>
- <metadata name="File_Save.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>664, 15</value>
- </metadata>
- <metadata name="openPreset.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>680, 54</value>
- </metadata>
- <metadata name="File_ChapterImport.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>787, 54</value>
- </metadata>
</root>
\ No newline at end of file |