}\r
\r
// Logic\r
- string forcedVal = check_forced.CheckState == CheckState.Checked ? "Yes" : "No";\r
- string defaultSub = check_default.CheckState == CheckState.Checked ? "Yes" : "No";\r
- string burnedVal = check_burned.CheckState == CheckState.Checked &&\r
- (drp_subtitleTracks.Text.Contains("(VOBSUB)") || drp_subtitleTracks.Text.Contains("(SSA)"))\r
- ? "Yes"\r
- : "No";\r
string srtCode = "-", srtLangVal = "-", srtPath = "-", srtFile = "-";\r
int srtOffsetMs = 0;\r
\r
+ // Make sure we only have 1 burned track. We'll always give the latest track added burned in.\r
+ if (check_burned.Checked)\r
+ this.SetBurnedToOffForAllTracks();\r
+\r
+ // Make sure we only have 1 default track\r
+ if (check_default.Checked)\r
+ this.SetDefaultToOffForAllTracks();\r
+\r
if (drp_subtitleTracks.SelectedItem.ToString().Contains(".srt"))\r
{\r
srtFiles.TryGetValue(drp_subtitleTracks.SelectedItem.ToString(), out srtPath);\r
srtLangVal = srt_lang.SelectedItem.ToString();\r
srtCode = srt_charcode.SelectedItem.ToString();\r
srtOffsetMs = (int)srt_offset.Value;\r
- if (defaultSub == "Yes") this.SetDefaultToOffForAllSRTTracks();\r
- }\r
- else\r
- {\r
- if (defaultSub == "Yes") this.SetDefaultToOffForAllTracks();\r
- if (burnedVal == "Yes") this.SetBurnedToOffForAllTracks();\r
}\r
\r
string trackName = (drp_subtitleTracks.SelectedItem.ToString().Contains(".srt"))\r
if (lv_subList.Items.Count == 0 || lv_subList.SelectedIndices.Count == 0) return;\r
\r
if (check_default.Checked) // Make sure we only have 1 default track\r
- if (lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[0].Text.Contains(".srt"))\r
- this.SetDefaultToOffForAllSRTTracks();\r
- else\r
- this.SetDefaultToOffForAllTracks();\r
+ this.SetDefaultToOffForAllTracks();\r
\r
lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[3].Text = check_default.Checked ? "Yes" : "No";\r
lv_subList.Select();\r
int c = 0;\r
foreach (ListViewItem item in lv_subList.Items)\r
{\r
- if (subList[c].SrtPath == "-")\r
- {\r
- if (item.SubItems[3].Text == "Yes")\r
- {\r
- item.SubItems[3].Text = "No";\r
- subList[c].Default = false;\r
- }\r
- }\r
- c++;\r
- }\r
- }\r
-\r
- /// <summary>\r
- /// Set all subtitle tracks so that they have no default.\r
- /// </summary>\r
- private void SetDefaultToOffForAllSRTTracks()\r
- {\r
- int c = 0;\r
- foreach (ListViewItem item in lv_subList.Items)\r
- {\r
- if (!subList[c].IsSrtSubtitle)\r
+ if (item.SubItems[3].Text == "Yes")\r
{\r
- if (item.SubItems[3].Text == "Yes")\r
- {\r
- item.SubItems[3].Text = "No";\r
- subList[c].Default = false;\r
- }\r
+ item.SubItems[3].Text = "No";\r
+ subList[c].Default = false;\r
}\r
c++;\r
}\r