diff options
author | sr55 <[email protected]> | 2009-06-13 19:55:49 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2009-06-13 19:55:49 +0000 |
commit | 5cfad5e676367d676220e75c2da3a72bc0732459 (patch) | |
tree | b8c8e3b113510891c978b99584c3b27a849a6033 /win/C# | |
parent | 61ee3250a66a273d3bf7b7594b5b8656993bc33f (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#')
-rw-r--r-- | win/C#/Controls/AudioPanel.cs | 24 | ||||
-rw-r--r-- | win/C#/EncodeQueue/Encode.cs | 15 | ||||
-rw-r--r-- | win/C#/Functions/Main.cs | 77 | ||||
-rw-r--r-- | win/C#/Functions/PresetLoader.cs | 4 | ||||
-rw-r--r-- | win/C#/Functions/QueryGenerator.cs | 76 | ||||
-rw-r--r-- | win/C#/Functions/QueryParser.cs | 4 | ||||
-rw-r--r-- | win/C#/HandBrakeCS.csproj | 10 | ||||
-rw-r--r-- | win/C#/Parsing/Subtitle.cs | 2 | ||||
-rw-r--r-- | win/C#/frmMain.Designer.cs | 98 | ||||
-rw-r--r-- | win/C#/frmMain.cs | 33 | ||||
-rw-r--r-- | win/C#/frmMain.resx | 8 | ||||
-rw-r--r-- | win/C#/frmTestWindow.Designer.cs | 107 | ||||
-rw-r--r-- | win/C#/frmTestWindow.cs | 98 | ||||
-rw-r--r-- | win/C#/frmTestWindow.resx | 120 |
14 files changed, 98 insertions, 578 deletions
diff --git a/win/C#/Controls/AudioPanel.cs b/win/C#/Controls/AudioPanel.cs index f65710670..57a258322 100644 --- a/win/C#/Controls/AudioPanel.cs +++ b/win/C#/Controls/AudioPanel.cs @@ -137,27 +137,7 @@ namespace Handbrake.Controls }
private void btn_RemoveAudioTrack_Click(object sender, EventArgs e)
{
- // Remove the Item and reselect the control if the following conditions are met.
- if (lv_audioList.SelectedItems.Count != 0)
- {
- // Record the current selected index.
- int currentPosition = lv_audioList.SelectedIndices[0];
-
- lv_audioList.Items.RemoveAt(lv_audioList.SelectedIndices[0]);
-
- // Now reslect the correct item and give focus to the audio list.
- if (lv_audioList.Items.Count != 0)
- {
- if (currentPosition <= (lv_audioList.Items.Count - 1))
- lv_audioList.Items[currentPosition].Selected = true;
- else if (currentPosition > (lv_audioList.Items.Count - 1))
- lv_audioList.Items[lv_audioList.Items.Count - 1].Selected = true;
-
- lv_audioList.Select();
- }
- // Regenerate the ID numers
- reGenerateListIDs();
- }
+ removeAudioTrack();
}
// Audio List Menu
@@ -219,6 +199,8 @@ namespace Handbrake.Controls lv_audioList.Select();
}
+ // Regenerate the ID numers
+ reGenerateListIDs();
}
}
diff --git a/win/C#/EncodeQueue/Encode.cs b/win/C#/EncodeQueue/Encode.cs index 22518bfb2..c0e0b7c3e 100644 --- a/win/C#/EncodeQueue/Encode.cs +++ b/win/C#/EncodeQueue/Encode.cs @@ -86,18 +86,9 @@ namespace Handbrake.EncodeQueue /// </summary>
public void closeCLI(EncodeProcess ep)
{
- Process[] prs = Process.GetProcesses();
- foreach (Process process in prs)
- {
- if (process.Id == ep.processID)
- {
- process.Refresh();
- if (!process.HasExited)
- process.Kill();
-
- process.WaitForExit();
- }
- }
+ Process cli = Process.GetProcessById(ep.processID);
+ if (!cli.HasExited)
+ cli.Kill();
}
/// <summary>
diff --git a/win/C#/Functions/Main.cs b/win/C#/Functions/Main.cs index be46465d4..84ba26398 100644 --- a/win/C#/Functions/Main.cs +++ b/win/C#/Functions/Main.cs @@ -54,62 +54,6 @@ namespace Handbrake.Functions }
/// <summary>
- /// Calculate the non-anamorphic resoltuion of the source
- /// </summary>
- /// <param name="width"></param>
- /// <param name="top"></param>
- /// <param name="bottom"></param>
- /// <param name="left"></param>
- /// <param name="right"></param>
- /// <param name="selectedTitle"></param>
- /// <returns></returns>
- public static int cacluateNonAnamorphicHeight(int width, decimal top, decimal bottom, decimal left, decimal right, Parsing.Title selectedTitle)
- {
- float aspect = selectedTitle.AspectRatio;
- int aw = 0;
- int ah = 0;
- if (aspect.ToString() == "1.78")
- {
- aw = 16;
- ah = 9;
- }
- else if (aspect.ToString() == "1.33")
- {
- aw = 4;
- ah = 3;
- }
-
- if (aw != 0)
- {
- double a = width * selectedTitle.Resolution.Width * ah * (selectedTitle.Resolution.Height - (double)top - (double)bottom);
- double b = selectedTitle.Resolution.Height * aw * (selectedTitle.Resolution.Width - (double)left - (double)right);
-
- double y = a / b;
-
- // If it's not Mod 16, make it mod 16
- if ((y % 16) != 0)
- {
- double mod16 = y % 16;
- if (mod16 >= 8)
- {
- mod16 = 16 - mod16;
- y = y + mod16;
- }
- else
- {
- y = y - mod16;
- }
- }
-
- //16 * (421 / 16)
- //double z = ( 16 * (( y + 8 ) / 16 ) );
- int x = int.Parse(y.ToString());
- return x;
- }
- return 0;
- }
-
- /// <summary>
/// Select the longest title in the DVD title dropdown menu on frmMain
/// </summary>
public static Parsing.Title selectLongestTitle(ComboBox drp_dvdtitle)
@@ -315,8 +259,7 @@ namespace Handbrake.Functions Properties.Settings.Default.hb_version = arr[0];
}
if (cliProcess.TotalProcessorTime.Seconds > 10) // Don't wait longer than 10 seconds.
- killCLI();
-
+ killCLI(cliProcess.Id);
}
}
catch (Exception e)
@@ -328,21 +271,11 @@ namespace Handbrake.Functions /// <summary>
/// Search through the running processes on the system and kill HandBrakeCLI
/// </summary>
- private static void killCLI()
+ private static void killCLI(int id)
{
- string AppName = "HandBrakeCLI";
- AppName = AppName.ToUpper();
-
- Process[] prs = Process.GetProcesses();
- foreach (Process proces in prs)
- {
- if (proces.ProcessName.ToUpper() == AppName)
- {
- proces.Refresh();
- if (!proces.HasExited)
- proces.Kill();
- }
- }
+ Process cli = Process.GetProcessById(id);
+ if (!cli.HasExited)
+ cli.Kill();
}
/// <summary>
diff --git a/win/C#/Functions/PresetLoader.cs b/win/C#/Functions/PresetLoader.cs index 44f9016ee..15eb741a8 100644 --- a/win/C#/Functions/PresetLoader.cs +++ b/win/C#/Functions/PresetLoader.cs @@ -246,7 +246,7 @@ namespace Handbrake.Functions mainWindow.audioPanel.addTrackForPreset(newTrack);
}
- // Subtitle Stuff
+ /*/ Subtitle Stuff
mainWindow.drp_subtitle.Text = presetQuery.Subtitles;
if (presetQuery.ForcedSubtitles)
@@ -255,7 +255,7 @@ namespace Handbrake.Functions mainWindow.check_forced.Enabled = true;
}
else
- mainWindow.check_forced.CheckState = CheckState.Unchecked;
+ mainWindow.check_forced.CheckState = CheckState.Unchecked;*/
#endregion
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
diff --git a/win/C#/Functions/QueryParser.cs b/win/C#/Functions/QueryParser.cs index 659073adf..5c1576cd4 100644 --- a/win/C#/Functions/QueryParser.cs +++ b/win/C#/Functions/QueryParser.cs @@ -97,10 +97,6 @@ namespace Handbrake.Functions #region Regular Expressions
- // Useful Destination Finder
- //Regex r1 = new Regex(@"(-i)(?:\s\"")([a-zA-Z0-9?';!^%&*()_\-:\\\s\.]+)(?:\"")");
- //Match source = r1.Match(input.Replace('"', '\"'));
-
//Source
Match title = Regex.Match(input, @"-t ([0-9]*)");
Match chapters = Regex.Match(input, @"-c ([0-9-]*)");
diff --git a/win/C#/HandBrakeCS.csproj b/win/C#/HandBrakeCS.csproj index d0082e299..a65f0c2d7 100644 --- a/win/C#/HandBrakeCS.csproj +++ b/win/C#/HandBrakeCS.csproj @@ -211,12 +211,6 @@ <Compile Include="Functions\PresetLoader.cs" />
<Compile Include="Functions\QueryGenerator.cs" />
<Compile Include="Functions\Main.cs" />
- <Compile Include="frmTestWindow.cs">
- <SubType>Form</SubType>
- </Compile>
- <Compile Include="frmTestWindow.Designer.cs">
- <DependentUpon>frmTestWindow.cs</DependentUpon>
- </Compile>
<Compile Include="Functions\Win32.cs" />
<Compile Include="Presets\preset.cs" />
<Compile Include="Presets\PresetsHandler.cs" />
@@ -301,10 +295,6 @@ <DependentUpon>frmUpdater.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
- <EmbeddedResource Include="frmTestWindow.resx">
- <DependentUpon>frmTestWindow.cs</DependentUpon>
- <SubType>Designer</SubType>
- </EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
diff --git a/win/C#/Parsing/Subtitle.cs b/win/C#/Parsing/Subtitle.cs index 1fe45c27f..a765f1de4 100644 --- a/win/C#/Parsing/Subtitle.cs +++ b/win/C#/Parsing/Subtitle.cs @@ -60,7 +60,7 @@ namespace Handbrake.Parsing /// <returns>A string formatted as: {track #} {language}</returns>
public override string ToString()
{
- return string.Format("{0} {1}", m_trackNumber, m_language);
+ return string.Format("{0} {1} ({2})", m_trackNumber, m_language, m_type);
}
public static Subtitle Parse(StringReader output)
diff --git a/win/C#/frmMain.Designer.cs b/win/C#/frmMain.Designer.cs index 912b49faa..11d50ff25 100644 --- a/win/C#/frmMain.Designer.cs +++ b/win/C#/frmMain.Designer.cs @@ -56,7 +56,6 @@ namespace Handbrake this.slider_videoQuality = new System.Windows.Forms.TrackBar();
this.text_filesize = new System.Windows.Forms.TextBox();
this.text_bitrate = new System.Windows.Forms.TextBox();
- this.drp_subtitle = new System.Windows.Forms.ComboBox();
this.btn_setDefault = new System.Windows.Forms.Button();
this.check_optimiseMP4 = new System.Windows.Forms.CheckBox();
this.check_iPodAtom = new System.Windows.Forms.CheckBox();
@@ -97,8 +96,6 @@ namespace Handbrake this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();
this.mnu_about = new System.Windows.Forms.ToolStripMenuItem();
this.frmMainMenu = new System.Windows.Forms.MenuStrip();
- this.debugToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.mnu_qptest = new System.Windows.Forms.ToolStripMenuItem();
this.gb_source = new System.Windows.Forms.GroupBox();
this.lbl_angle = new System.Windows.Forms.Label();
this.Label13 = new System.Windows.Forms.Label();
@@ -112,9 +109,6 @@ namespace Handbrake this.tab_audio = new System.Windows.Forms.TabPage();
this.audioPanel = new Handbrake.Controls.AudioPanel();
this.AudioMenuRowHeightHack = new System.Windows.Forms.ImageList(this.components);
- this.check_forced = new System.Windows.Forms.CheckBox();
- this.Label19 = new System.Windows.Forms.Label();
- this.Label20 = new System.Windows.Forms.Label();
this.tab_video = new System.Windows.Forms.TabPage();
this.radio_cq = new System.Windows.Forms.RadioButton();
this.radio_avgBitrate = new System.Windows.Forms.RadioButton();
@@ -139,6 +133,7 @@ namespace Handbrake this.ctl_decomb = new Handbrake.Decomb();
this.ctl_detelecine = new Handbrake.Detelecine();
this.tab_subtitles = new System.Windows.Forms.TabPage();
+ this.Subtitles = new Handbrake.Controls.Subtitles();
this.tab_chapters = new System.Windows.Forms.TabPage();
this.label31 = new System.Windows.Forms.Label();
this.tab_advanced = new System.Windows.Forms.TabPage();
@@ -383,21 +378,6 @@ namespace Handbrake this.text_bitrate.TabIndex = 10;
this.ToolTip.SetToolTip(this.text_bitrate, "Set the bitrate of the video");
//
- // drp_subtitle
- //
- this.drp_subtitle.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.drp_subtitle.FormattingEnabled = true;
- this.drp_subtitle.Items.AddRange(new object[] {
- "None",
- "Autoselect"});
- this.drp_subtitle.Location = new System.Drawing.Point(79, 39);
- this.drp_subtitle.Name = "drp_subtitle";
- this.drp_subtitle.Size = new System.Drawing.Size(138, 21);
- this.drp_subtitle.TabIndex = 43;
- this.drp_subtitle.Text = "None";
- this.ToolTip.SetToolTip(this.drp_subtitle, resources.GetString("drp_subtitle.ToolTip"));
- this.drp_subtitle.SelectedIndexChanged += new System.EventHandler(this.drp_subtitle_SelectedIndexChanged);
- //
// btn_setDefault
//
this.btn_setDefault.FlatAppearance.BorderColor = System.Drawing.Color.Black;
@@ -771,8 +751,7 @@ namespace Handbrake this.FileToolStripMenuItem,
this.ToolsToolStripMenuItem,
this.PresetsToolStripMenuItem,
- this.HelpToolStripMenuItem,
- this.debugToolStripMenuItem});
+ this.HelpToolStripMenuItem});
this.frmMainMenu.Location = new System.Drawing.Point(0, 0);
this.frmMainMenu.Name = "frmMainMenu";
this.frmMainMenu.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional;
@@ -780,22 +759,6 @@ namespace Handbrake this.frmMainMenu.TabIndex = 0;
this.frmMainMenu.Text = "MenuStrip";
//
- // debugToolStripMenuItem
- //
- this.debugToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.mnu_qptest});
- this.debugToolStripMenuItem.Name = "debugToolStripMenuItem";
- this.debugToolStripMenuItem.Size = new System.Drawing.Size(56, 20);
- this.debugToolStripMenuItem.Text = "Debug";
- this.debugToolStripMenuItem.Visible = false;
- //
- // mnu_qptest
- //
- this.mnu_qptest.Name = "mnu_qptest";
- this.mnu_qptest.Size = new System.Drawing.Size(201, 22);
- this.mnu_qptest.Text = "Query Parser Tester";
- this.mnu_qptest.Click += new System.EventHandler(this.mnu_qptest_Click);
- //
// gb_source
//
this.gb_source.Controls.Add(this.drop_angle);
@@ -941,7 +904,6 @@ namespace Handbrake this.audioPanel.Name = "audioPanel";
this.audioPanel.Size = new System.Drawing.Size(715, 310);
this.audioPanel.TabIndex = 0;
-
//
// AudioMenuRowHeightHack
//
@@ -949,40 +911,6 @@ namespace Handbrake this.AudioMenuRowHeightHack.ImageSize = new System.Drawing.Size(1, 18);
this.AudioMenuRowHeightHack.TransparentColor = System.Drawing.Color.Transparent;
//
- // check_forced
- //
- this.check_forced.AutoSize = true;
- this.check_forced.BackColor = System.Drawing.Color.Transparent;
- this.check_forced.Enabled = false;
- this.check_forced.Location = new System.Drawing.Point(223, 42);
- this.check_forced.Name = "check_forced";
- this.check_forced.Size = new System.Drawing.Size(147, 17);
- this.check_forced.TabIndex = 44;
- this.check_forced.Text = "Forced Subtitles Only";
- this.check_forced.UseVisualStyleBackColor = false;
- //
- // Label19
- //
- this.Label19.AutoSize = true;
- this.Label19.BackColor = System.Drawing.Color.Transparent;
- this.Label19.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.Label19.Location = new System.Drawing.Point(13, 13);
- this.Label19.Name = "Label19";
- this.Label19.Size = new System.Drawing.Size(64, 13);
- this.Label19.TabIndex = 40;
- this.Label19.Text = "Subtitles";
- //
- // Label20
- //
- this.Label20.AutoSize = true;
- this.Label20.BackColor = System.Drawing.Color.Transparent;
- this.Label20.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.Label20.Location = new System.Drawing.Point(13, 42);
- this.Label20.Name = "Label20";
- this.Label20.Size = new System.Drawing.Size(61, 13);
- this.Label20.TabIndex = 42;
- this.Label20.Text = "Subtitles:";
- //
// tab_video
//
this.tab_video.BackColor = System.Drawing.Color.Transparent;
@@ -1269,10 +1197,7 @@ namespace Handbrake //
// tab_subtitles
//
- this.tab_subtitles.Controls.Add(this.drp_subtitle);
- this.tab_subtitles.Controls.Add(this.check_forced);
- this.tab_subtitles.Controls.Add(this.Label20);
- this.tab_subtitles.Controls.Add(this.Label19);
+ this.tab_subtitles.Controls.Add(this.Subtitles);
this.tab_subtitles.Location = new System.Drawing.Point(4, 22);
this.tab_subtitles.Name = "tab_subtitles";
this.tab_subtitles.Padding = new System.Windows.Forms.Padding(3);
@@ -1281,6 +1206,15 @@ namespace Handbrake this.tab_subtitles.Text = "Subtitles";
this.tab_subtitles.UseVisualStyleBackColor = true;
//
+ // Subtitles
+ //
+ this.Subtitles.BackColor = System.Drawing.Color.Transparent;
+ this.Subtitles.Location = new System.Drawing.Point(0, 0);
+ this.Subtitles.Name = "Subtitles";
+ this.Subtitles.setContainer = 0;
+ this.Subtitles.Size = new System.Drawing.Size(722, 310);
+ this.Subtitles.TabIndex = 0;
+ //
// tab_chapters
//
this.tab_chapters.BackColor = System.Drawing.Color.Transparent;
@@ -1723,7 +1657,6 @@ namespace Handbrake this.tab_filters.ResumeLayout(false);
this.tab_filters.PerformLayout();
this.tab_subtitles.ResumeLayout(false);
- this.tab_subtitles.PerformLayout();
this.tab_chapters.ResumeLayout(false);
this.tab_chapters.PerformLayout();
this.tab_advanced.ResumeLayout(false);
@@ -1791,9 +1724,6 @@ namespace Handbrake internal System.Windows.Forms.TabControl tabs_panel;
internal System.Windows.Forms.Label Label46;
private System.Windows.Forms.GroupBox groupBox_dest;
- internal System.Windows.Forms.ComboBox drp_subtitle;
- internal System.Windows.Forms.Label Label19;
- internal System.Windows.Forms.Label Label20;
internal System.Windows.Forms.CheckBox check_grayscale;
internal System.Windows.Forms.Label label24;
private System.Windows.Forms.GroupBox groupBox2;
@@ -1808,7 +1738,6 @@ namespace Handbrake private System.Windows.Forms.TabPage tab_chapters;
internal System.Windows.Forms.Label label31;
internal System.Windows.Forms.CheckBox check_optimiseMP4;
- internal System.Windows.Forms.CheckBox check_forced;
internal System.Windows.Forms.DataGridView data_chpt;
private System.Windows.Forms.TabPage tab_query;
private System.Windows.Forms.Label label34;
@@ -1862,8 +1791,6 @@ namespace Handbrake private System.Windows.Forms.ImageList AudioMenuRowHeightHack;
private System.Windows.Forms.ToolStripMenuItem pmnu_saveChanges;
private System.Windows.Forms.ToolStripMenuItem mnu_killCLI;
- private System.Windows.Forms.ToolStripMenuItem debugToolStripMenuItem;
- private System.Windows.Forms.ToolStripMenuItem mnu_qptest;
private System.Windows.Forms.TabPage tab_filters;
internal Deinterlace ctl_deinterlace;
internal Denoise ctl_denoise;
@@ -1883,6 +1810,7 @@ namespace Handbrake private TabPage tab_subtitles;
internal Handbrake.Controls.AudioPanel audioPanel;
internal Handbrake.Controls.PictureSettings pictureSettings;
+ internal Handbrake.Controls.Subtitles Subtitles;
}
diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs index 33a177a1f..b74499ef3 100644 --- a/win/C#/frmMain.cs +++ b/win/C#/frmMain.cs @@ -337,14 +337,6 @@ namespace Handbrake }
#endregion
- #region Debug Menu
- private void mnu_qptest_Click(object sender, EventArgs e)
- {
- QueryParserTester qptest = new QueryParserTester();
- qptest.Show();
- }
- #endregion
-
#region Preset Bar
// Right Click Menu Code
private void pmnu_expandAll_Click(object sender, EventArgs e)
@@ -797,13 +789,10 @@ namespace Handbrake audioPanel.setTrackList(selectedTitle);
// Populate the Subtitles dropdown
- drp_subtitle.Items.Clear();
- drp_subtitle.Items.Add("None");
- drp_subtitle.Items.Add("Autoselect");
- drp_subtitle.Items.AddRange(selectedTitle.Subtitles.ToArray());
- if (drp_subtitle.Items.Count > 0)
- drp_subtitle.Text = drp_subtitle.Items[0].ToString();
-
+ Subtitles.drp_subtitleTracks.Items.Clear();
+ Subtitles.drp_subtitleTracks.Items.Add("Foreign Audio Search (Bitmap)");
+ Subtitles.drp_subtitleTracks.Items.AddRange(selectedTitle.Subtitles.ToArray());
+ Subtitles.drp_subtitleTracks.SelectedIndex = 0;
}
// Run the autoName & chapterNaming functions
@@ -988,6 +977,7 @@ namespace Handbrake setExtension(".mkv");
audioPanel.setAudioByContainer(drop_format.Text);
+ Subtitles.setContainer = drop_format.SelectedIndex;
string oldval;
if ((drop_format.Text.Contains("MP4")) || (drop_format.Text.Contains("M4V")))
@@ -1200,18 +1190,6 @@ namespace Handbrake lbl_deblockVal.Text = slider_deblock.Value == 4 ? "Off" : slider_deblock.Value.ToString();
}
- //Subtitles Tab
- private void drp_subtitle_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (drp_subtitle.Text.Contains("None"))
- {
- check_forced.Enabled = false;
- check_forced.Checked = false;
- }
- else
- check_forced.Enabled = true;
- }
-
// Chapter Marker Tab
private void Check_ChapterMarkers_CheckedChanged(object sender, EventArgs e)
{
@@ -1614,7 +1592,6 @@ namespace Handbrake #endregion
-
// This is the END of the road ****************************************
}
}
\ No newline at end of file diff --git a/win/C#/frmMain.resx b/win/C#/frmMain.resx index a76ccfd0f..400badbaa 100644 --- a/win/C#/frmMain.resx +++ b/win/C#/frmMain.resx @@ -132,14 +132,6 @@ <metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>18, 15</value>
</metadata>
- <data name="drp_subtitle.ToolTip" xml:space="preserve">
- <value>Select the subtitle language you require from this dropdown.
- - or -
-Autoselect: Scan for subtitles in an extra 1st pass, and choose
-the one that's only used 10 percent of the time or less.
-This should locate subtitles for short foreign language segments.
-Best used in conjunction with forced subtitles.</value>
- </data>
<metadata name="number.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
diff --git a/win/C#/frmTestWindow.Designer.cs b/win/C#/frmTestWindow.Designer.cs deleted file mode 100644 index 9a3691cf5..000000000 --- a/win/C#/frmTestWindow.Designer.cs +++ /dev/null @@ -1,107 +0,0 @@ -namespace Handbrake.Functions
-{
- partial class QueryParserTester
- {
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.IContainer components = null;
-
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.rtf_testContent = new System.Windows.Forms.RichTextBox();
- this.btn_test = new System.Windows.Forms.Button();
- this.rtf_query = new System.Windows.Forms.RichTextBox();
- this.label1 = new System.Windows.Forms.Label();
- this.label2 = new System.Windows.Forms.Label();
- this.SuspendLayout();
- //
- // rtf_testContent
- //
- this.rtf_testContent.Location = new System.Drawing.Point(111, 164);
- this.rtf_testContent.Name = "rtf_testContent";
- this.rtf_testContent.Size = new System.Drawing.Size(641, 420);
- this.rtf_testContent.TabIndex = 0;
- this.rtf_testContent.Text = "";
- //
- // btn_test
- //
- this.btn_test.Location = new System.Drawing.Point(405, 115);
- this.btn_test.Name = "btn_test";
- this.btn_test.Size = new System.Drawing.Size(75, 23);
- this.btn_test.TabIndex = 1;
- this.btn_test.Text = "Test";
- this.btn_test.UseVisualStyleBackColor = true;
- this.btn_test.Click += new System.EventHandler(this.btn_test_Click);
- //
- // rtf_query
- //
- this.rtf_query.Location = new System.Drawing.Point(111, 12);
- this.rtf_query.Name = "rtf_query";
- this.rtf_query.Size = new System.Drawing.Size(641, 77);
- this.rtf_query.TabIndex = 2;
- this.rtf_query.Text = "";
- //
- // label1
- //
- this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(37, 43);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(38, 13);
- this.label1.TabIndex = 3;
- this.label1.Text = "Query:";
- //
- // label2
- //
- this.label2.AutoSize = true;
- this.label2.Location = new System.Drawing.Point(37, 327);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(40, 13);
- this.label2.TabIndex = 4;
- this.label2.Text = "Result:";
- //
- // QueryParserTester
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(780, 625);
- this.Controls.Add(this.label2);
- this.Controls.Add(this.label1);
- this.Controls.Add(this.rtf_query);
- this.Controls.Add(this.btn_test);
- this.Controls.Add(this.rtf_testContent);
- this.Name = "QueryParserTester";
- this.Text = "QueryParserTester";
- this.ResumeLayout(false);
- this.PerformLayout();
-
- }
-
- #endregion
-
- private System.Windows.Forms.RichTextBox rtf_testContent;
- private System.Windows.Forms.Button btn_test;
- private System.Windows.Forms.RichTextBox rtf_query;
- private System.Windows.Forms.Label label1;
- private System.Windows.Forms.Label label2;
- }
-}
\ No newline at end of file diff --git a/win/C#/frmTestWindow.cs b/win/C#/frmTestWindow.cs deleted file mode 100644 index a7dd567ba..000000000 --- a/win/C#/frmTestWindow.cs +++ /dev/null @@ -1,98 +0,0 @@ -using System;
-using System.Windows.Forms;
-
-namespace Handbrake.Functions
-{
- public partial class QueryParserTester : Form
- {
- public QueryParserTester()
- {
- InitializeComponent();
-
- }
-
- private void btn_test_Click(object sender, EventArgs e)
- {
- QueryParser parsed = QueryParser.Parse(rtf_query.Text);
-
- rtf_testContent.Clear();
-
- //Source
- rtf_testContent.Text += "## Source " + Environment.NewLine;
- if (parsed.DVDTitle != 0)
- rtf_testContent.Text += "Title: " + parsed.DVDTitle + Environment.NewLine;
- if (parsed.DVDChapterStart != 0)
- rtf_testContent.Text += "Start Chapter: " + parsed.DVDChapterStart + Environment.NewLine;
- if (parsed.DVDChapterFinish != 0)
- rtf_testContent.Text += "End Chapter: " + parsed.DVDChapterFinish + Environment.NewLine;
-
- //Output Settings
- rtf_testContent.Text += Environment.NewLine + "## Output Settings " + Environment.NewLine;
- if (parsed.Format != null)
- rtf_testContent.Text += "Format: " + parsed.Format + Environment.NewLine;
- if (parsed.LargeMP4)
- rtf_testContent.Text += "Large File Size: " + parsed.LargeMP4 + Environment.NewLine;
- if (parsed.OptimizeMP4)
- rtf_testContent.Text += "Web Optimized: " + parsed.OptimizeMP4 + Environment.NewLine;
- if (parsed.IpodAtom)
- rtf_testContent.Text += "iPod 5G Support " + parsed.IpodAtom + Environment.NewLine;
-
- //Picture Settings
- rtf_testContent.Text += Environment.NewLine + "## Picture Settings " + Environment.NewLine;
- if (parsed.CropValues != null)
- rtf_testContent.Text += "Cropping: " + parsed.CropValues + Environment.NewLine;
- if (parsed.Width != 0)
- rtf_testContent.Text += "Width: " + parsed.Width + Environment.NewLine;
- if (parsed.Height != 0)
- rtf_testContent.Text += "Height: " + parsed.Height + Environment.NewLine;
- if (parsed.MaxWidth != 0)
- rtf_testContent.Text += "Max Width: " + parsed.MaxWidth + Environment.NewLine;
- if (parsed.MaxHeight != 0)
- rtf_testContent.Text += "Max Height: " + parsed.MaxHeight + Environment.NewLine;
- rtf_testContent.Text += "Anamorphic Mode: " + parsed.AnamorphicMode + Environment.NewLine;
-
- //Picture Settings - Filters
- rtf_testContent.Text += Environment.NewLine + "## Filters " + Environment.NewLine;
- rtf_testContent.Text += "Detelecine: " + parsed.DeTelecine + Environment.NewLine;
- rtf_testContent.Text += "Decomb: " + parsed.Decomb + Environment.NewLine;
- rtf_testContent.Text += "Deinterlace: " + parsed.DeInterlace + Environment.NewLine;
- rtf_testContent.Text += "Denoise: " + parsed.DeNoise + Environment.NewLine;
- rtf_testContent.Text += "Deblock: " + parsed.DeBlock + Environment.NewLine;
-
- //Video
- rtf_testContent.Text += Environment.NewLine + "## Video " + Environment.NewLine;
- rtf_testContent.Text += "Video Codec: " + parsed.VideoEncoder + Environment.NewLine;
- rtf_testContent.Text += "Video Framerate: " + parsed.VideoFramerate + Environment.NewLine;
- if (parsed.Grayscale)
- rtf_testContent.Text += "Grayscale: " + parsed.Grayscale + Environment.NewLine;
- if (parsed.TwoPass)
- rtf_testContent.Text += "2-Pass Encoding: " + parsed.TwoPass + Environment.NewLine;
- if (parsed.TurboFirstPass)
- rtf_testContent.Text += "Turbo first pass: " + parsed.TurboFirstPass + Environment.NewLine;
- if (parsed.VideoTargetSize != null)
- rtf_testContent.Text += "Target Size: " + parsed.VideoTargetSize + Environment.NewLine;
- if (parsed.AverageVideoBitrate != null)
- rtf_testContent.Text += "Avg Bitrate: " + parsed.AverageVideoBitrate + Environment.NewLine;
- if (parsed.VideoQuality != 0)
- rtf_testContent.Text += "Constant Quality: " + parsed.VideoQuality + Environment.NewLine;
-
- //Audio
- // TODO
-
- //Chapters
- if (parsed.ChapterMarkers)
- {
- rtf_testContent.Text += Environment.NewLine + "## Chapers " + Environment.NewLine;
- rtf_testContent.Text += "Chapters: " + parsed.ChapterMarkers + Environment.NewLine;
- }
-
- //Advanced
- if (parsed.H264Query != null)
- {
- rtf_testContent.Text += Environment.NewLine + "## x264 " + Environment.NewLine;
- rtf_testContent.Text += "x264: " + parsed.H264Query + Environment.NewLine;
- }
- }
-
- }
-}
diff --git a/win/C#/frmTestWindow.resx b/win/C#/frmTestWindow.resx deleted file mode 100644 index ff31a6db5..000000000 --- a/win/C#/frmTestWindow.resx +++ /dev/null @@ -1,120 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
-</root>
\ No newline at end of file |