\r
using HandBrake.ApplicationServices;\r
using HandBrake.ApplicationServices.Model.Encoding;\r
+ using HandBrake.ApplicationServices.Parsing;\r
using HandBrake.ApplicationServices.Services.Interfaces;\r
using HandBrake.ApplicationServices.Utilities;\r
\r
/// </summary>\r
private static readonly IUserSettingService UserSettingService = ServiceManager.UserSettingService;\r
\r
+ /// <summary>\r
+ /// The current output extension\r
+ /// </summary>\r
+ private string currentOutputExtension;\r
#endregion\r
\r
/// <summary>\r
return this.subList.Any(track => track.SubtitleType != SubtitleType.VobSub);\r
}\r
\r
+ /// <summary>\r
+ /// Set the current extension to allow this window to behave correctly based on extension.\r
+ /// </summary>\r
+ /// <param name="extension">\r
+ /// The extension.\r
+ /// </param>\r
+ public void SetExtension(string extension)\r
+ {\r
+ currentOutputExtension = extension.Replace(".", string.Empty);\r
+ }\r
+\r
/// <summary>\r
/// Automatically setup the subtitle tracks.\r
/// This handles the automatic setup of subitles which the user can control from the program options\r
SrtFileName = srtFile\r
};\r
\r
+ track.SubtitleType = ((Subtitle)drp_subtitleTracks.SelectedItem).SubtitleType;\r
+\r
+ if (currentOutputExtension.Equals("mp4", StringComparison.InvariantCultureIgnoreCase) ||\r
+ currentOutputExtension.Equals("m4v", StringComparison.CurrentCultureIgnoreCase))\r
+ {\r
+ // Default it to burned as mp4 doesn't allow PGS\r
+ track.Burned = true;\r
+\r
+ // Check to make sure we don't have more than one PGS. Fail if we do.\r
+ if (this.subList.Any(item => item.SubtitleType == SubtitleType.PGS))\r
+ {\r
+ MessageBox.Show(\r
+ "You can only burn-in one PGS subtitle track into an MP4 file. You must first remove the current track to add a new one.",\r
+ "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
+ return;\r
+ }\r
+ }\r
+\r
lv_subList.Items.Add(track.ListView);\r
subList.Add(track);\r
}\r
private void mnu_AddAll_Click(object sender, EventArgs e)\r
{\r
// TODO - Might need to be a bit more clever with this. Will wait and see if this causes any problems.\r
+ bool addedPGS = false;\r
foreach (object item in drp_subtitleTracks.Items)\r
{\r
+ Subtitle sub = item as Subtitle;\r
+\r
+ // PGS Handling.\r
+ if (addedPGS)\r
+ {\r
+ // Skip over any pgs tracks after we've added the first.\r
+ continue;\r
+ }\r
+\r
+ if (currentOutputExtension.Equals("mp4", StringComparison.InvariantCultureIgnoreCase) ||\r
+ currentOutputExtension.Equals("m4v", StringComparison.CurrentCultureIgnoreCase))\r
+ {\r
+ if (sub != null && sub.SubtitleType == SubtitleType.PGS)\r
+ {\r
+ addedPGS = true;\r
+ }\r
+ }\r
+\r
if (!item.ToString().Contains("Foreign Audio Search"))\r
{\r
drp_subtitleTracks.SelectedItem = item;\r
btn_addSubtitleTrack_Click(this, EventArgs.Empty);\r
}\r
}\r
+\r
+\r
}\r
\r
/// <summary>\r
// \r
// text_destination\r
// \r
- this.text_destination.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) \r
- | System.Windows.Forms.AnchorStyles.Right)));\r
+ this.text_destination.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)\r
+ | System.Windows.Forms.AnchorStyles.Right)));\r
this.text_destination.Location = new System.Drawing.Point(36, 3);\r
this.text_destination.Name = "text_destination";\r
this.text_destination.Size = new System.Drawing.Size(603, 21);\r
this.check_largeFile.TabIndex = 2;\r
this.check_largeFile.Text = "Large file size";\r
this.ToolTip.SetToolTip(this.check_largeFile, "Caution: This option will likely break device compatibility with all but the Appl" +\r
- "eTV Take 2.\r\nChecking this box enables a 64bit mp4 file which can be over 4GB.");\r
+ "eTV Take 2.\r\nChecking this box enables a 64bit mp4 file which can be over 4GB.");\r
this.check_largeFile.UseVisualStyleBackColor = false;\r
// \r
// check_turbo\r
this.check_turbo.Enabled = false;\r
this.check_turbo.Location = new System.Drawing.Point(495, 134);\r
this.check_turbo.Name = "check_turbo";\r
- this.check_turbo.Size = new System.Drawing.Size(101, 17);\r
+ this.check_turbo.Size = new System.Drawing.Size(99, 17);\r
this.check_turbo.TabIndex = 9;\r
this.check_turbo.Text = "Turbo first Pass";\r
this.ToolTip.SetToolTip(this.check_turbo, "Makes the first pass of a 2 pass encode faster.");\r
this.check_optimiseMP4.TabIndex = 3;\r
this.check_optimiseMP4.Text = "Web optimized";\r
this.ToolTip.SetToolTip(this.check_optimiseMP4, "MP4 files can be optimized for progressive downloads over the Web,\r\nbut note that" +\r
- " QuickTime can only read the files as long as the file extension is .mp4\r\nCan on" +\r
- "ly be used with H.264 ");\r
+ " QuickTime can only read the files as long as the file extension is .mp4\r\nCan on" +\r
+ "ly be used with H.264 ");\r
this.check_optimiseMP4.UseVisualStyleBackColor = false;\r
// \r
// check_iPodAtom\r
this.check_iPodAtom.TabIndex = 4;\r
this.check_iPodAtom.Text = "iPod 5G support";\r
this.ToolTip.SetToolTip(this.check_iPodAtom, "Support for legacy 5th Generation iPods.\r\nEncodes will not sync if this option is" +\r
- " not enabled for H.264 encodes.");\r
+ " not enabled for H.264 encodes.");\r
this.check_iPodAtom.UseVisualStyleBackColor = false;\r
// \r
// data_chpt\r
this.drp_dvdtitle.Size = new System.Drawing.Size(119, 21);\r
this.drp_dvdtitle.TabIndex = 1;\r
this.ToolTip.SetToolTip(this.drp_dvdtitle, "Select the title you wish to encode.\r\n\r\nWhen a DVD is in use, HandBrake will try " +\r
- "to determine the \"Main Feature\" title automatically.\r\nPlease note, this is not a" +\r
- "lways accurate and should be checked.");\r
+ "to determine the \"Main Feature\" title automatically.\r\nPlease note, this is not a" +\r
+ "lways accurate and should be checked.");\r
this.drp_dvdtitle.SelectedIndexChanged += new System.EventHandler(this.drp_dvdtitle_SelectedIndexChanged);\r
this.drp_dvdtitle.Click += new System.EventHandler(this.drp_dvdtitle_Click);\r
// \r
this.btn_generate_Query.TabIndex = 2;\r
this.btn_generate_Query.Text = "Generate Query";\r
this.ToolTip.SetToolTip(this.btn_generate_Query, "This will allow you to override the generated query.\r\nNote, The query in the box " +\r
- "below will always override any automatically generated query, even if you change" +\r
- " title or source.");\r
+ "below will always override any automatically generated query, even if you change" +\r
+ " title or source.");\r
this.btn_generate_Query.UseVisualStyleBackColor = true;\r
this.btn_generate_Query.Click += new System.EventHandler(this.btn_generate_Query_Click);\r
// \r
this.radio_cq.BackColor = System.Drawing.Color.Transparent;\r
this.radio_cq.Location = new System.Drawing.Point(366, 37);\r
this.radio_cq.Name = "radio_cq";\r
- this.radio_cq.Size = new System.Drawing.Size(110, 17);\r
+ this.radio_cq.Size = new System.Drawing.Size(105, 17);\r
this.radio_cq.TabIndex = 3;\r
this.radio_cq.Text = "Constant Quality:";\r
this.ToolTip.SetToolTip(this.radio_cq, resources.GetString("radio_cq.ToolTip"));\r
this.radio_avgBitrate.Checked = true;\r
this.radio_avgBitrate.Location = new System.Drawing.Point(367, 108);\r
this.radio_avgBitrate.Name = "radio_avgBitrate";\r
- this.radio_avgBitrate.Size = new System.Drawing.Size(116, 17);\r
+ this.radio_avgBitrate.Size = new System.Drawing.Size(112, 17);\r
this.radio_avgBitrate.TabIndex = 4;\r
this.radio_avgBitrate.TabStop = true;\r
this.radio_avgBitrate.Text = "Avg Bitrate (kbps):";\r
this.check_2PassEncode.BackColor = System.Drawing.Color.Transparent;\r
this.check_2PassEncode.Location = new System.Drawing.Point(385, 134);\r
this.check_2PassEncode.Name = "check_2PassEncode";\r
- this.check_2PassEncode.Size = new System.Drawing.Size(104, 17);\r
+ this.check_2PassEncode.Size = new System.Drawing.Size(106, 17);\r
this.check_2PassEncode.TabIndex = 10;\r
this.check_2PassEncode.Text = "2-Pass Encoding";\r
this.ToolTip.SetToolTip(this.check_2PassEncode, resources.GetString("check_2PassEncode.ToolTip"));\r
allowedPassthru1.AudioAllowDTSPass = true;\r
allowedPassthru1.AudioAllowMP3Pass = true;\r
allowedPassthru1.AudioEncoderFallback = HandBrake.Interop.Model.Encoding.AudioEncoder.Ac3;\r
+ allowedPassthru1.IsEnabled = false;\r
this.AudioSettings.PassthruSettings = allowedPassthru1;\r
this.AudioSettings.Size = new System.Drawing.Size(720, 310);\r
this.AudioSettings.TabIndex = 0;\r
this.radio_constantFramerate.Checked = true;\r
this.radio_constantFramerate.Location = new System.Drawing.Point(0, 0);\r
this.radio_constantFramerate.Name = "radio_constantFramerate";\r
- this.radio_constantFramerate.Size = new System.Drawing.Size(122, 17);\r
+ this.radio_constantFramerate.Size = new System.Drawing.Size(117, 17);\r
this.radio_constantFramerate.TabIndex = 17;\r
this.radio_constantFramerate.TabStop = true;\r
this.radio_constantFramerate.Text = "Constant Framerate";\r
this.radio_peakAndVariable.BackColor = System.Drawing.Color.Transparent;\r
this.radio_peakAndVariable.Location = new System.Drawing.Point(0, 23);\r
this.radio_peakAndVariable.Name = "radio_peakAndVariable";\r
- this.radio_peakAndVariable.Size = new System.Drawing.Size(116, 17);\r
+ this.radio_peakAndVariable.Size = new System.Drawing.Size(113, 17);\r
this.radio_peakAndVariable.TabIndex = 19;\r
this.radio_peakAndVariable.Text = "Variable Framerate";\r
this.radio_peakAndVariable.UseVisualStyleBackColor = false;\r
this.Check_ChapterMarkers.BackColor = System.Drawing.Color.Transparent;\r
this.Check_ChapterMarkers.Location = new System.Drawing.Point(16, 32);\r
this.Check_ChapterMarkers.Name = "Check_ChapterMarkers";\r
- this.Check_ChapterMarkers.Size = new System.Drawing.Size(140, 17);\r
+ this.Check_ChapterMarkers.Size = new System.Drawing.Size(136, 17);\r
this.Check_ChapterMarkers.TabIndex = 4;\r
this.Check_ChapterMarkers.Text = "Create chapter markers";\r
this.Check_ChapterMarkers.UseVisualStyleBackColor = false;\r
this.btn_dvd_source.Image = global::Handbrake.Properties.Resources.folder;\r
this.btn_dvd_source.ImageTransparentColor = System.Drawing.Color.Magenta;\r
this.btn_dvd_source.Name = "btn_dvd_source";\r
- this.btn_dvd_source.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) \r
- | System.Windows.Forms.Keys.O)));\r
+ this.btn_dvd_source.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)\r
+ | System.Windows.Forms.Keys.O)));\r
this.btn_dvd_source.Size = new System.Drawing.Size(182, 22);\r
this.btn_dvd_source.Text = "Folder";\r
this.btn_dvd_source.Click += new System.EventHandler(this.BtnFolderScanClicked);\r
this.mnu_AddAllTitles.Size = new System.Drawing.Size(192, 22);\r
this.mnu_AddAllTitles.Text = "Add All (Experimental)";\r
this.mnu_AddAllTitles.ToolTipText = "Add all titles to the queue.\r\nUse caution with this feature as incorrect usage ma" +\r
- "y result in a queue of failed encodes.";\r
+ "y result in a queue of failed encodes.";\r
this.mnu_AddAllTitles.Click += new System.EventHandler(this.mnu_AddAllTitles_Click);\r
// \r
// mnu_AddTittleRange\r
this.btn_ActivityWindow.Size = new System.Drawing.Size(130, 36);\r
this.btn_ActivityWindow.Text = "Activity Window";\r
this.btn_ActivityWindow.ToolTipText = "Displays the activity window which displays the log of the last completed or curr" +\r
- "ently running encode.";\r
+ "ently running encode.";\r
this.btn_ActivityWindow.Click += new System.EventHandler(this.btn_ActivityWindow_Click);\r
// \r
// toolStripSeparator8\r