summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--win/C#/Controls/AudioPanel.cs12
-rw-r--r--win/C#/Controls/Subtitles.cs18
-rw-r--r--win/C#/frmMain.cs1
3 files changed, 28 insertions, 3 deletions
diff --git a/win/C#/Controls/AudioPanel.cs b/win/C#/Controls/AudioPanel.cs
index c846f5055..ef8d87048 100644
--- a/win/C#/Controls/AudioPanel.cs
+++ b/win/C#/Controls/AudioPanel.cs
@@ -244,8 +244,16 @@ namespace Handbrake.Controls
i++;
}
- foreach (ListViewItem item in lv_audioList.Items)
- item.SubItems[1].Text = drp_audioTrack.SelectedItem.ToString();
+ if (drp_audioTrack.SelectedItem != null)
+ foreach (ListViewItem item in lv_audioList.Items)
+ item.SubItems[1].Text = drp_audioTrack.SelectedItem.ToString();
+ else
+ {
+ drp_audioTrack.SelectedIndex = 0;
+ if (drp_audioTrack.SelectedItem != null)
+ foreach (ListViewItem item in lv_audioList.Items)
+ item.SubItems[1].Text = drp_audioTrack.SelectedItem.ToString();
+ }
}
else
drp_audioTrack.SelectedIndex = 0; // "Use Foreign language audio and Subtitles"
diff --git a/win/C#/Controls/Subtitles.cs b/win/C#/Controls/Subtitles.cs
index 9036a6c72..e4142bd44 100644
--- a/win/C#/Controls/Subtitles.cs
+++ b/win/C#/Controls/Subtitles.cs
@@ -24,7 +24,23 @@ namespace Handbrake.Controls
private int FileContainer;
public void setSubtitleTrackAuto()
{
- //TODO
+ // 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.
+ {
+ int i = 0;
+ foreach (object item in drp_subtitleTracks.Items)
+ {
+ if (item.ToString().Contains(Properties.Settings.Default.NativeLanguage))
+ drp_subtitleTracks.SelectedIndex = i;
+
+ i++;
+ }
+
+ btn_addSubTrack_Click(this, new EventArgs());
+ }
+ }
}
public void setContainer(int value)
{
diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs
index a25aa5633..62e0bc698 100644
--- a/win/C#/frmMain.cs
+++ b/win/C#/frmMain.cs
@@ -956,6 +956,7 @@ namespace Handbrake
Subtitles.drp_subtitleTracks.Items.Add("Foreign Audio Search (Bitmap)");
Subtitles.drp_subtitleTracks.Items.AddRange(selectedTitle.Subtitles.ToArray());
Subtitles.drp_subtitleTracks.SelectedIndex = 0;
+ Subtitles.setSubtitleTrackAuto();
}
// Run the autoName & chapterNaming functions