summaryrefslogtreecommitdiffstats
path: root/win/C#/Functions/QueryGenerator.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2009-06-13 19:55:49 +0000
committersr55 <[email protected]>2009-06-13 19:55:49 +0000
commit5cfad5e676367d676220e75c2da3a72bc0732459 (patch)
treeb8c8e3b113510891c978b99584c3b27a849a6033 /win/C#/Functions/QueryGenerator.cs
parent61ee3250a66a273d3bf7b7594b5b8656993bc33f (diff)
WinGui:
- New subtitle tab. All complaints to j45 please. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2531 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/Functions/QueryGenerator.cs')
-rw-r--r--win/C#/Functions/QueryGenerator.cs76
1 files changed, 66 insertions, 10 deletions
diff --git a/win/C#/Functions/QueryGenerator.cs b/win/C#/Functions/QueryGenerator.cs
index c90d7dbb0..2f6e474fa 100644
--- a/win/C#/Functions/QueryGenerator.cs
+++ b/win/C#/Functions/QueryGenerator.cs
@@ -391,18 +391,74 @@ namespace Handbrake.Functions
if (audioItems.Trim() != String.Empty)
query += " -D " + audioItems;
- // Subtitles
- string subtitles = mainWindow.drp_subtitle.Text;
- if (subtitles == "Autoselect")
- query += " -U ";
- else if (subtitles != "" && subtitles != "None")
+ #endregion
+
+ #region Subtitles Tab
+
+ if (mainWindow.Subtitles.lv_subList.Items.Count != 0) // If we have subtitle tracks
{
- string[] tempSub = subtitles.Split(' ');
- query += " -s " + tempSub[0];
- }
+ // Find --subtitle <string>
+ query += " --subtitle ";
+ String subtitleTracks = "";
+ String itemToAdd;
+ foreach (ListViewItem item in mainWindow.Subtitles.lv_subList.Items)
+ {
+ if (item.SubItems[1].Text.Contains("Foreign Audio Search"))
+ itemToAdd = "scan";
+ else
+ {
+ string[] tempSub = item.SubItems[1].Text.Split(' ');
+ itemToAdd = tempSub[0];
+ }
+
+ subtitleTracks += subtitleTracks == "" ? itemToAdd : "," + itemToAdd;
+ }
+ query += subtitleTracks;
+
+
+ // Find --subtitle-forced
+ String forcedTrack = "";
+ foreach (ListViewItem item in mainWindow.Subtitles.lv_subList.Items)
+ {
+ itemToAdd = "";
+ string[] tempSub = item.SubItems[1].Text.Split(' ');
+ string trackID = tempSub[0];
+
+ if (item.SubItems[2].Text == "Yes")
+ itemToAdd = trackID;
- if (mainWindow.check_forced.Checked)
- query += " -F ";
+ if (itemToAdd != "")
+ forcedTrack += forcedTrack == "" ? itemToAdd : "," + itemToAdd;
+ }
+ if (forcedTrack != "")
+ query += " --subtitle-forced " + forcedTrack;
+
+
+ // Find --subtitle-burn and --subtitle-default
+ String burned = "";
+ String defaultTrack = "";
+ foreach (ListViewItem item in mainWindow.Subtitles.lv_subList.Items)
+ {
+ string[] tempSub = item.SubItems[1].Text.Split(' ');
+ string trackID = tempSub[0];
+
+ if (trackID.Trim() == "Foreign")
+ trackID = "scan";
+
+ if (item.SubItems[3].Text == "Yes") // Burned
+ burned = trackID;
+
+ if (item.SubItems[4].Text == "Yes") // Burned
+ defaultTrack = trackID;
+
+ }
+ if (burned != "")
+ query += " --subtitle-burn " + burned;
+
+ if (defaultTrack != "")
+ query += " --subtitle-default " + defaultTrack;
+
+ }
#endregion