summaryrefslogtreecommitdiffstats
path: root/win/C#/Controls
diff options
context:
space:
mode:
authorsr55 <[email protected]>2010-08-20 19:15:16 +0000
committersr55 <[email protected]>2010-08-20 19:15:16 +0000
commita2fd1bd46d791f0fb85651955965aa124cb01f8f (patch)
tree014cbad8558b16801f10b38250544c9a22c2ccc0 /win/C#/Controls
parentc000040c0837325b5081e699a17743e1eb74c3eb (diff)
WinGui:
- Added new audio/subs option: "Use Preferred Language for Audio and Subtitles" and "Add Closed Captions when available" Thanks to Shatian for the Patch! git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3485 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/Controls')
-rw-r--r--win/C#/Controls/AudioPanel.cs2
-rw-r--r--win/C#/Controls/Subtitles.cs56
2 files changed, 34 insertions, 24 deletions
diff --git a/win/C#/Controls/AudioPanel.cs b/win/C#/Controls/AudioPanel.cs
index 6d4b00804..cca75d41a 100644
--- a/win/C#/Controls/AudioPanel.cs
+++ b/win/C#/Controls/AudioPanel.cs
@@ -174,7 +174,7 @@ namespace Handbrake.Controls
drp_audioTrack.SelectedIndex = drp_audioTrack.Items.Count >= 2 ? 1 : 0;
else
{
- if (Properties.Settings.Default.DubAudio) // "Dub Foreign language audio"
+ if (Properties.Settings.Default.DubMode > 1) // "Dub Foreign language audio"
{
int i = 0;
foreach (object item in drp_audioTrack.Items)
diff --git a/win/C#/Controls/Subtitles.cs b/win/C#/Controls/Subtitles.cs
index e923598e7..e5acf0789 100644
--- a/win/C#/Controls/Subtitles.cs
+++ b/win/C#/Controls/Subtitles.cs
@@ -195,7 +195,7 @@ namespace Handbrake.Controls
srtFile = drp_subtitleTracks.SelectedItem.ToString();
srtLangVal = srt_lang.SelectedItem.ToString();
srtCode = srt_charcode.SelectedItem.ToString();
- srtOffsetMs = (int) srt_offset.Value;
+ srtOffsetMs = (int)srt_offset.Value;
if (defaultSub == "Yes") SetNoSrtDefault();
}
else
@@ -210,14 +210,14 @@ namespace Handbrake.Controls
SubtitleInfo track = new SubtitleInfo
{
- Track = trackName,
- Forced = forcedVal,
- Burned = burnedVal,
- Default = defaultSub,
- SrtLang = srtLangVal,
- SrtCharCode = srtCode,
- SrtOffset = srtOffsetMs,
- SrtPath = srtPath,
+ Track = trackName,
+ Forced = forcedVal,
+ Burned = burnedVal,
+ Default = defaultSub,
+ SrtLang = srtLangVal,
+ SrtCharCode = srtCode,
+ SrtOffset = srtOffsetMs,
+ SrtPath = srtPath,
SrtFileName = srtFile
};
@@ -286,7 +286,7 @@ namespace Handbrake.Controls
int c = 0;
if (lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[0].Text.ToLower().Contains(".srt"))
- // We have an SRT
+ // We have an SRT
{
foreach (var item in drp_subtitleTracks.Items)
{
@@ -388,7 +388,7 @@ namespace Handbrake.Controls
lv_subList.Select();
subList[lv_subList.SelectedIndices[0]].Forced = check_forced.Checked ? "Yes" : "No";
- // Update SubList List<SubtitleInfo>
+ // Update SubList List<SubtitleInfo>
}
/// <summary>
@@ -411,7 +411,7 @@ namespace Handbrake.Controls
lv_subList.Select();
subList[lv_subList.SelectedIndices[0]].Burned = check_burned.Checked ? "Yes" : "No";
- // Update SubList List<SubtitleInfo>
+ // Update SubList List<SubtitleInfo>
}
/// <summary>
@@ -437,7 +437,7 @@ namespace Handbrake.Controls
lv_subList.Select();
subList[lv_subList.SelectedIndices[0]].Default = check_default.Checked ? "Yes" : "No";
- // Update SubList List<SubtitleInfo>
+ // Update SubList List<SubtitleInfo>
}
/// <summary>
@@ -458,8 +458,8 @@ namespace Handbrake.Controls
lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[6].Text = srt_offset.Value.ToString();
lv_subList.Select();
- subList[lv_subList.SelectedIndices[0]].SrtOffset = (int) srt_offset.Value;
- // Update SubList List<SubtitleInfo>
+ subList[lv_subList.SelectedIndices[0]].SrtOffset = (int)srt_offset.Value;
+ // Update SubList List<SubtitleInfo>
}
/// <summary>
@@ -479,7 +479,7 @@ namespace Handbrake.Controls
lv_subList.Select();
subList[lv_subList.SelectedIndices[0]].SrtCharCode = srt_charcode.SelectedItem.ToString();
- // Update SubList List<SubtitleInfo>
+ // Update SubList List<SubtitleInfo>
}
/// <summary>
@@ -499,7 +499,7 @@ namespace Handbrake.Controls
lv_subList.Select();
subList[lv_subList.SelectedIndices[0]].SrtLang = srt_lang.SelectedItem.ToString();
- // Update SubList List<SubtitleInfo>
+ // Update SubList List<SubtitleInfo>
}
/* Right Click Menu */
@@ -693,18 +693,28 @@ namespace Handbrake.Controls
// 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.DubAudio) // We need to add a subtitle track if this is false.
+ if (Properties.Settings.Default.DubMode != 1) // We need to add a subtitle track if this is false.
{
- int i = 0;
foreach (object item in drp_subtitleTracks.Items)
{
if (item.ToString().Contains(Properties.Settings.Default.NativeLanguage))
- drp_subtitleTracks.SelectedIndex = i;
-
- i++;
+ {
+ drp_subtitleTracks.SelectedItem = item;
+ BtnAddSubTrackClick(this, new EventArgs());
+ }
}
- 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());
+ }
+ }
+ }
}
}
}