summaryrefslogtreecommitdiffstats
path: root/win/C#/Functions/QueryGenerator.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2009-07-17 15:22:07 +0000
committersr55 <[email protected]>2009-07-17 15:22:07 +0000
commita8acbe50c4fef4efd39d83e8052f1012fae7232a (patch)
tree0d87d8041fb84248c45325ee47f9616f6f16becb /win/C#/Functions/QueryGenerator.cs
parent69faa2de07f1d0e488830ebec3fcc9b52fad6b99 (diff)
WinGui:
- Option to set an External SRT as default. - Import preset now adds the preset to the preset list. Includes a few UI/QueryGenerator.cs fixes for this. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2703 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/Functions/QueryGenerator.cs')
-rw-r--r--win/C#/Functions/QueryGenerator.cs17
1 files changed, 12 insertions, 5 deletions
diff --git a/win/C#/Functions/QueryGenerator.cs b/win/C#/Functions/QueryGenerator.cs
index a6c59ee81..ed2b3b2d6 100644
--- a/win/C#/Functions/QueryGenerator.cs
+++ b/win/C#/Functions/QueryGenerator.cs
@@ -28,7 +28,7 @@ namespace Handbrake.Functions
if (mainWindow.sourcePath.Trim() != "Select \"Source\" to continue")
query = " -i " + '"' + mainWindow.sourcePath + '"';
- if (mainWindow.drp_dvdtitle.Text != "Automatic")
+ if (mainWindow.drp_dvdtitle.Text != "")
{
string[] titleInfo = mainWindow.drp_dvdtitle.Text.Split(' ');
query += " -t " + titleInfo[0];
@@ -38,11 +38,11 @@ namespace Handbrake.Functions
if (mainWindow.drop_angle.Items.Count != 0)
query += " --angle " + mainWindow.drop_angle.SelectedItem;
- if (mainWindow.drop_chapterFinish.Text == mainWindow.drop_chapterStart.Text && mainWindow.drop_chapterStart.Text != "Auto")
+ if (mainWindow.drop_chapterFinish.Text == mainWindow.drop_chapterStart.Text && mainWindow.drop_chapterStart.Text != "")
query += " -c " + mainWindow.drop_chapterStart.Text;
else if (mainWindow.drop_chapterStart.Text == "Auto" && mainWindow.drop_chapterFinish.Text != "Auto")
query += " -c " + "0-" + mainWindow.drop_chapterFinish.Text;
- else if (mainWindow.drop_chapterStart.Text != "Auto" && mainWindow.drop_chapterFinish.Text != "Auto")
+ else if (mainWindow.drop_chapterStart.Text != "Auto" && mainWindow.drop_chapterFinish.Text != "Auto" && mainWindow.drop_chapterStart.Text != "")
query += " -c " + mainWindow.drop_chapterStart.Text + "-" + mainWindow.drop_chapterFinish.Text;
// Destination tab
@@ -398,7 +398,9 @@ namespace Handbrake.Functions
string srtFile = String.Empty;
string srtCodeset = String.Empty;
string srtOffset = String.Empty;
- string srtLang = String.Empty;
+ string srtLang = String.Empty;
+ string srtDefault = String.Empty;
+ int srtCount = 0;
foreach (ListViewItem item in mainWindow.Subtitles.lv_subList.Items)
{
@@ -406,6 +408,7 @@ namespace Handbrake.Functions
if (item.SubItems.Count != 5) // We have an SRT file
{
+ srtCount++; // SRT track id.
string[] trackData = item.SubItems[1].Text.Split(',');
if (trackData != null)
{
@@ -415,7 +418,9 @@ namespace Handbrake.Functions
srtLang += srtLang == "" ? realLangCode : "," + realLangCode;
srtCodeset += srtCodeset == "" ? charCode : "," + charCode;
}
-
+ if (item.SubItems[4].Text == "Yes") // default
+ srtDefault = srtCount.ToString();
+
itemToAdd = item.SubItems[5].Text;
srtFile += srtFile == "" ? itemToAdd : "," + itemToAdd;
@@ -486,6 +491,8 @@ namespace Handbrake.Functions
query += " --srt-offset " + srtOffset;
if (srtLang != "")
query += " --srt-lang " + srtLang;
+ if (srtDefault != "")
+ query += " --subtitle-default " + srtDefault;
}
}