this.AudioTrackGroup = new System.Windows.Forms.GroupBox();\r
this.AudioMenuRowHeightHack = new System.Windows.Forms.ImageList(this.components);\r
this.audioList = new System.Windows.Forms.DataGridView();\r
- this.Track = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
- this.Source = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
- this.AudioCodec = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
- this.Mixdown = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
- this.Samplerate = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
- this.Bitrate = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
this.DRC = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
+ this.Bitrate = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
+ this.Samplerate = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
+ this.Mixdown = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
+ this.AudioCodec = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
+ this.Source = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
+ this.Track = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
this.audioMenu.SuspendLayout();\r
((System.ComponentModel.ISupportInitialize)(this.tb_drc)).BeginInit();\r
this.AudioTrackGroup.SuspendLayout();\r
this.audioList.TabIndex = 67;\r
this.audioList.SelectionChanged += new System.EventHandler(this.audioList_SelectionChanged);\r
// \r
- // Track\r
+ // DRC\r
// \r
- this.Track.FillWeight = 304.2808F;\r
- this.Track.HeaderText = "Track";\r
- this.Track.Name = "Track";\r
- this.Track.ReadOnly = true;\r
- this.Track.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;\r
- this.Track.Width = 50;\r
+ this.DRC.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;\r
+ this.DRC.FillWeight = 96.36334F;\r
+ this.DRC.HeaderText = "DRC";\r
+ this.DRC.Name = "DRC";\r
+ this.DRC.ReadOnly = true;\r
+ this.DRC.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;\r
// \r
- // Source\r
+ // Bitrate\r
// \r
- this.Source.FillWeight = 49.69727F;\r
- this.Source.HeaderText = "Source";\r
- this.Source.Name = "Source";\r
- this.Source.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;\r
- this.Source.Width = 150;\r
+ this.Bitrate.FillWeight = 49.69727F;\r
+ this.Bitrate.HeaderText = "Bitrate";\r
+ this.Bitrate.Name = "Bitrate";\r
+ this.Bitrate.ReadOnly = true;\r
+ this.Bitrate.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;\r
+ this.Bitrate.Width = 75;\r
// \r
- // AudioCodec\r
+ // Samplerate\r
// \r
- this.AudioCodec.HeaderText = "Audio Codec";\r
- this.AudioCodec.Name = "AudioCodec";\r
- this.AudioCodec.ReadOnly = true;\r
- this.AudioCodec.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;\r
+ this.Samplerate.FillWeight = 49.69727F;\r
+ this.Samplerate.HeaderText = "Samplerate";\r
+ this.Samplerate.Name = "Samplerate";\r
+ this.Samplerate.ReadOnly = true;\r
+ this.Samplerate.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;\r
+ this.Samplerate.Width = 75;\r
// \r
// Mixdown\r
// \r
this.Mixdown.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;\r
this.Mixdown.Width = 150;\r
// \r
- // Samplerate\r
+ // AudioCodec\r
// \r
- this.Samplerate.FillWeight = 49.69727F;\r
- this.Samplerate.HeaderText = "Samplerate";\r
- this.Samplerate.Name = "Samplerate";\r
- this.Samplerate.ReadOnly = true;\r
- this.Samplerate.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;\r
- this.Samplerate.Width = 75;\r
+ this.AudioCodec.HeaderText = "Audio Codec";\r
+ this.AudioCodec.Name = "AudioCodec";\r
+ this.AudioCodec.ReadOnly = true;\r
+ this.AudioCodec.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;\r
// \r
- // Bitrate\r
+ // Source\r
// \r
- this.Bitrate.FillWeight = 49.69727F;\r
- this.Bitrate.HeaderText = "Bitrate";\r
- this.Bitrate.Name = "Bitrate";\r
- this.Bitrate.ReadOnly = true;\r
- this.Bitrate.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;\r
- this.Bitrate.Width = 75;\r
+ this.Source.FillWeight = 49.69727F;\r
+ this.Source.HeaderText = "Source";\r
+ this.Source.Name = "Source";\r
+ this.Source.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;\r
+ this.Source.Width = 150;\r
// \r
- // DRC\r
+ // Track\r
// \r
- this.DRC.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;\r
- this.DRC.FillWeight = 96.36334F;\r
- this.DRC.HeaderText = "DRC";\r
- this.DRC.Name = "DRC";\r
- this.DRC.ReadOnly = true;\r
- this.DRC.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;\r
+ this.Track.FillWeight = 304.2808F;\r
+ this.Track.HeaderText = "Track";\r
+ this.Track.Name = "Track";\r
+ this.Track.ReadOnly = true;\r
+ this.Track.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;\r
+ this.Track.Width = 50;\r
// \r
// AudioPanel\r
// \r
newTrack.Cells[2].Value = track.Encoder;\r
newTrack.Cells[3].Value = track.MixDown;\r
newTrack.Cells[4].Value = track.SampleRate;\r
- newTrack.Cells[5].Value = track.Encoder.Contains("AC3") ? "Auto" : track.Bitrate;\r
+ newTrack.Cells[5].Value = track.Encoder.Contains("AC3") || track.Encoder.Contains("DTS") ? "Auto" : track.Bitrate;\r
newTrack.Cells[6].Value = track.DRC;\r
AddTrackForPreset(newTrack);\r
}\r
+\r
+ this.AutomaticTrackSelection();\r
}\r
\r
/// <summary>\r
/// </summary>\r
/// <param name="selectedTitle">The selected title</param>\r
/// <param name="preset">A preset</param>\r
- public void SetTrackList(Title selectedTitle, Preset preset)\r
+ public void SetTrackListFromPreset(Title selectedTitle, Preset preset)\r
{\r
if (selectedTitle.AudioTracks.Count == 0)\r
{\r
return;\r
}\r
\r
- // The Source Information for the title will have changed, so set all the tracks to Automatic.\r
+ // Setup the Audio track source dropdown with the new audio tracks.\r
+ drp_audioTrack.Items.Clear();\r
+ drp_audioTrack.Items.AddRange(selectedTitle.AudioTracks.ToArray());\r
+\r
+ // Reset the Audio Track Selection to the first audio track of the source, or Audiomatic if that fails\r
foreach (DataGridViewRow row in this.audioList.Rows)\r
{\r
row.Cells[1].Value = "Automatic";\r
}\r
\r
- // Setup the Audio track source dropdown with the new audio tracks.\r
- drp_audioTrack.Items.Clear();\r
- drp_audioTrack.Items.Add("Automatic");\r
- drp_audioTrack.Items.AddRange(selectedTitle.AudioTracks.ToArray());\r
-\r
- // Re-add any audio tracks that the preset has.\r
+ // Add any tracks the preset has, if there is a preset and no audio tracks in the list currently\r
if (audioList.Rows.Count == 0 && preset != null)\r
{\r
QueryParser parsed = QueryParser.Parse(preset.Query);\r
}\r
}\r
\r
+ this.AutomaticTrackSelection();\r
+ }\r
+\r
+ private void AutomaticTrackSelection()\r
+ {\r
// Handle Native Language and "Dub Foreign language audio" and "Use Foreign language audio and Subtitles" Options\r
if (Properties.Settings.Default.NativeLanguage == "Any")\r
- drp_audioTrack.SelectedIndex = drp_audioTrack.Items.Count >= 2 ? 1 : 0;\r
- else\r
{\r
- if (Properties.Settings.Default.DubMode > 1) // "Dub Foreign language audio" \r
+ drp_audioTrack.SelectedIndex = 0;\r
+ foreach (DataGridViewRow item in audioList.Rows)\r
{\r
- int i = 0;\r
- foreach (object item in drp_audioTrack.Items)\r
+ if (this.drp_audioTrack.SelectedItem != null)\r
{\r
- if (item.ToString().Contains(Properties.Settings.Default.NativeLanguage))\r
+ item.Cells[1].Value = this.drp_audioTrack.SelectedItem.ToString();\r
+ }\r
+ }\r
+ }\r
+ else\r
+ {\r
+ int mode = Properties.Settings.Default.DubMode;\r
+ switch (mode)\r
+ {\r
+ case 1:\r
+ case 3:\r
+ // Dub Foreign Language Audio \r
+ // Select the prefered language audio, or the first track if it doesn't exist.\r
+ int i = 0;\r
+ foreach (object item in drp_audioTrack.Items)\r
{\r
- drp_audioTrack.SelectedIndex = i;\r
- break;\r
+ if (item.ToString().Contains(Properties.Settings.Default.NativeLanguage))\r
+ {\r
+ drp_audioTrack.SelectedIndex = i;\r
+ break;\r
+ }\r
+\r
+ i++;\r
}\r
\r
- i++;\r
- }\r
+ if (drp_audioTrack.SelectedItem != null)\r
+ foreach (DataGridViewRow item in audioList.Rows)\r
+ item.Cells[1].Value = drp_audioTrack.SelectedItem.ToString();\r
+ else\r
+ {\r
+ drp_audioTrack.SelectedIndex = 0;\r
+ if (drp_audioTrack.SelectedItem != null)\r
+ foreach (DataGridViewRow item in audioList.Rows)\r
+ item.Cells[1].Value = drp_audioTrack.SelectedItem.ToString();\r
+ }\r
\r
- if (drp_audioTrack.SelectedItem != null)\r
- foreach (DataGridViewRow item in audioList.Rows)\r
- item.Cells[1].Value = drp_audioTrack.SelectedItem.ToString();\r
- else\r
- {\r
+ break;\r
+ case 2:\r
+ default:\r
+ // Select the first track which is hopefully the default and foreign track.\r
drp_audioTrack.SelectedIndex = 0;\r
+\r
if (drp_audioTrack.SelectedItem != null)\r
foreach (DataGridViewRow item in audioList.Rows)\r
item.Cells[1].Value = drp_audioTrack.SelectedItem.ToString();\r
- }\r
+ break;\r
}\r
- else\r
- drp_audioTrack.SelectedIndex = drp_audioTrack.Items.Count >= 3 ? 2 : 0;\r
- // "Use Foreign language audio and Subtitles"\r
}\r
}\r
\r
\r
if (up) index--;\r
else index++;\r
- \r
+\r
if (index < audioList.Rows.Count || (audioList.Rows.Count > index && index >= 0))\r
{\r
audioList.Rows.Remove(item);\r