this.DRC = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
this.Gain = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
this.ToolTips = new System.Windows.Forms.ToolTip(this.components);\r
+ this.drp_passthruFallback = new System.Windows.Forms.ComboBox();\r
this.btn_AdvancedAudio = new System.Windows.Forms.Button();\r
this.btn_addAudioTrack = new wyDay.Controls.SplitButton();\r
this.AddTrackMenu = new System.Windows.Forms.ContextMenuStrip(this.components);\r
this.btn_RemoveTrack = new wyDay.Controls.SplitButton();\r
this.RemoveTrackMenu = new System.Windows.Forms.ContextMenuStrip(this.components);\r
this.mnu_ClearAll = new System.Windows.Forms.ToolStripMenuItem();\r
+ this.groupBox1 = new System.Windows.Forms.GroupBox();\r
+ this.label1 = new System.Windows.Forms.Label();\r
+ this.check_dtshd = new System.Windows.Forms.CheckBox();\r
+ this.check_dts = new System.Windows.Forms.CheckBox();\r
+ this.check_ac3 = new System.Windows.Forms.CheckBox();\r
+ this.check_aac = new System.Windows.Forms.CheckBox();\r
+ this.check_mp3 = new System.Windows.Forms.CheckBox();\r
this.audioMenu.SuspendLayout();\r
((System.ComponentModel.ISupportInitialize)(this.audioList)).BeginInit();\r
this.AddTrackMenu.SuspendLayout();\r
this.RemoveTrackMenu.SuspendLayout();\r
+ this.groupBox1.SuspendLayout();\r
this.SuspendLayout();\r
// \r
// audioMenu\r
this.Gain.ReadOnly = true;\r
this.Gain.Width = 60;\r
// \r
+ // ToolTips\r
+ // \r
+ this.ToolTips.AutomaticDelay = 1500;\r
+ // \r
+ // drp_passthruFallback\r
+ // \r
+ this.drp_passthruFallback.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;\r
+ this.drp_passthruFallback.Font = new System.Drawing.Font("Tahoma", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+ this.drp_passthruFallback.FormattingEnabled = true;\r
+ this.drp_passthruFallback.Location = new System.Drawing.Point(327, 15);\r
+ this.drp_passthruFallback.Name = "drp_passthruFallback";\r
+ this.drp_passthruFallback.Size = new System.Drawing.Size(111, 19);\r
+ this.drp_passthruFallback.TabIndex = 75;\r
+ this.ToolTips.SetToolTip(this.drp_passthruFallback, "The Audio Encoder that will be used, if there is no suitable passthru option.");\r
+ this.drp_passthruFallback.SelectedIndexChanged += new System.EventHandler(this.drp_passthruFallback_SelectedIndexChanged);\r
+ // \r
// btn_AdvancedAudio\r
// \r
this.btn_AdvancedAudio.BackColor = System.Drawing.Color.Transparent;\r
this.mnu_ClearAll.Text = "Clear All";\r
this.mnu_ClearAll.Click += new System.EventHandler(this.Mnu_clear_all_click);\r
// \r
+ // groupBox1\r
+ // \r
+ this.groupBox1.Controls.Add(this.label1);\r
+ this.groupBox1.Controls.Add(this.drp_passthruFallback);\r
+ this.groupBox1.Controls.Add(this.check_dtshd);\r
+ this.groupBox1.Controls.Add(this.check_dts);\r
+ this.groupBox1.Controls.Add(this.check_ac3);\r
+ this.groupBox1.Controls.Add(this.check_aac);\r
+ this.groupBox1.Controls.Add(this.check_mp3);\r
+ this.groupBox1.Font = new System.Drawing.Font("Tahoma", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+ this.groupBox1.Location = new System.Drawing.Point(256, 19);\r
+ this.groupBox1.Name = "groupBox1";\r
+ this.groupBox1.Size = new System.Drawing.Size(445, 40);\r
+ this.groupBox1.TabIndex = 74;\r
+ this.groupBox1.TabStop = false;\r
+ this.groupBox1.Text = "Auto Passthru";\r
+ this.ToolTips.SetToolTip(this.groupBox1, resources.GetString("groupBox1.ToolTip"));\r
+ // \r
+ // label1\r
+ // \r
+ this.label1.AutoSize = true;\r
+ this.label1.Font = new System.Drawing.Font("Tahoma", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+ this.label1.Location = new System.Drawing.Point(279, 18);\r
+ this.label1.Name = "label1";\r
+ this.label1.Size = new System.Drawing.Size(42, 11);\r
+ this.label1.TabIndex = 76;\r
+ this.label1.Text = "Fallback:";\r
+ // \r
+ // check_dtshd\r
+ // \r
+ this.check_dtshd.AutoSize = true;\r
+ this.check_dtshd.Font = new System.Drawing.Font("Tahoma", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+ this.check_dtshd.Location = new System.Drawing.Point(214, 17);\r
+ this.check_dtshd.Name = "check_dtshd";\r
+ this.check_dtshd.Size = new System.Drawing.Size(60, 15);\r
+ this.check_dtshd.TabIndex = 4;\r
+ this.check_dtshd.Text = "DTS-HD";\r
+ this.ToolTips.SetToolTip(this.check_dtshd, "Allow DTS-HD Passthru");\r
+ this.check_dtshd.UseVisualStyleBackColor = true;\r
+ this.check_dtshd.CheckedChanged += new System.EventHandler(this.autoPassthru_CheckedChanged);\r
+ // \r
+ // check_dts\r
+ // \r
+ this.check_dts.AutoSize = true;\r
+ this.check_dts.Font = new System.Drawing.Font("Tahoma", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+ this.check_dts.Location = new System.Drawing.Point(163, 17);\r
+ this.check_dts.Name = "check_dts";\r
+ this.check_dts.Size = new System.Drawing.Size(43, 15);\r
+ this.check_dts.TabIndex = 3;\r
+ this.check_dts.Text = "DTS";\r
+ this.ToolTips.SetToolTip(this.check_dts, "Allow DTS Passthru");\r
+ this.check_dts.UseVisualStyleBackColor = true;\r
+ this.check_dts.CheckedChanged += new System.EventHandler(this.autoPassthru_CheckedChanged);\r
+ // \r
+ // check_ac3\r
+ // \r
+ this.check_ac3.AutoSize = true;\r
+ this.check_ac3.Font = new System.Drawing.Font("Tahoma", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+ this.check_ac3.Location = new System.Drawing.Point(111, 17);\r
+ this.check_ac3.Name = "check_ac3";\r
+ this.check_ac3.Size = new System.Drawing.Size(43, 15);\r
+ this.check_ac3.TabIndex = 2;\r
+ this.check_ac3.Text = "AC3";\r
+ this.ToolTips.SetToolTip(this.check_ac3, "Allow AC3 Passthru");\r
+ this.check_ac3.UseVisualStyleBackColor = true;\r
+ this.check_ac3.CheckedChanged += new System.EventHandler(this.autoPassthru_CheckedChanged);\r
+ // \r
+ // check_aac\r
+ // \r
+ this.check_aac.AutoSize = true;\r
+ this.check_aac.Font = new System.Drawing.Font("Tahoma", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+ this.check_aac.Location = new System.Drawing.Point(58, 17);\r
+ this.check_aac.Name = "check_aac";\r
+ this.check_aac.Size = new System.Drawing.Size(45, 15);\r
+ this.check_aac.TabIndex = 1;\r
+ this.check_aac.Text = "AAC";\r
+ this.ToolTips.SetToolTip(this.check_aac, "Allow AAC Passthru");\r
+ this.check_aac.UseVisualStyleBackColor = true;\r
+ this.check_aac.CheckedChanged += new System.EventHandler(this.autoPassthru_CheckedChanged);\r
+ // \r
+ // check_mp3\r
+ // \r
+ this.check_mp3.AutoSize = true;\r
+ this.check_mp3.Font = new System.Drawing.Font("Tahoma", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+ this.check_mp3.Location = new System.Drawing.Point(6, 17);\r
+ this.check_mp3.Name = "check_mp3";\r
+ this.check_mp3.Size = new System.Drawing.Size(43, 15);\r
+ this.check_mp3.TabIndex = 0;\r
+ this.check_mp3.Text = "MP3";\r
+ this.ToolTips.SetToolTip(this.check_mp3, "Allow MP3 Passthru");\r
+ this.check_mp3.UseVisualStyleBackColor = true;\r
+ this.check_mp3.CheckedChanged += new System.EventHandler(this.autoPassthru_CheckedChanged);\r
+ // \r
// AudioPanel\r
// \r
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;\r
this.BackColor = System.Drawing.Color.Transparent;\r
+ this.Controls.Add(this.groupBox1);\r
this.Controls.Add(this.drp_audioTrack);\r
this.Controls.Add(this.btn_AdvancedAudio);\r
this.Controls.Add(this.drp_audioSample);\r
((System.ComponentModel.ISupportInitialize)(this.audioList)).EndInit();\r
this.AddTrackMenu.ResumeLayout(false);\r
this.RemoveTrackMenu.ResumeLayout(false);\r
+ this.groupBox1.ResumeLayout(false);\r
+ this.groupBox1.PerformLayout();\r
this.ResumeLayout(false);\r
this.PerformLayout();\r
\r
private System.Windows.Forms.DataGridViewTextBoxColumn Bitrate;\r
private System.Windows.Forms.DataGridViewTextBoxColumn DRC;\r
private System.Windows.Forms.DataGridViewTextBoxColumn Gain;\r
+ private System.Windows.Forms.GroupBox groupBox1;\r
+ private System.Windows.Forms.CheckBox check_dtshd;\r
+ private System.Windows.Forms.CheckBox check_dts;\r
+ private System.Windows.Forms.CheckBox check_ac3;\r
+ private System.Windows.Forms.CheckBox check_aac;\r
+ private System.Windows.Forms.CheckBox check_mp3;\r
+ private System.Windows.Forms.Label label1;\r
+ internal System.Windows.Forms.ComboBox drp_passthruFallback;\r
}\r
}\r
drp_audioEncoder.SelectedItem = "AAC (faac)";\r
\r
drp_audioTrack.DataSource = this.ScannedTracks;\r
+\r
+ // Setup Auto-Passthru Settings\r
+ this.PassthruSettings = new AllowedPassthru();\r
+ this.SetPassthruSettings(this.PassthruSettings);\r
}\r
\r
/// <summary>\r
}\r
}\r
\r
+ /// <summary>\r
+ /// Gets or sets PassthruSettings.\r
+ /// </summary>\r
+ public AllowedPassthru PassthruSettings { get; set; }\r
+\r
#endregion\r
\r
#region Public Methods\r
public void SetContainer(string path)\r
{\r
string oldval = drp_audioEncoder.Text;\r
+ string fallbackOldVal = drp_passthruFallback.Text;\r
\r
drp_audioEncoder.Items.Clear();\r
drp_audioEncoder.Items.Add(EnumHelper<AudioEncoder>.GetDisplay(AudioEncoder.Faac));\r
drp_audioEncoder.Items.Add(EnumHelper<AudioEncoder>.GetDisplay(AudioEncoder.DtsPassthrough));\r
drp_audioEncoder.Items.Add(EnumHelper<AudioEncoder>.GetDisplay(AudioEncoder.DtsHDPassthrough));\r
\r
+ drp_passthruFallback.Items.Clear();\r
+ drp_passthruFallback.Items.Add(EnumHelper<AudioEncoder>.GetDisplay(AudioEncoder.Faac));\r
+ drp_passthruFallback.Items.Add(EnumHelper<AudioEncoder>.GetDisplay(AudioEncoder.ffaac));\r
+ drp_passthruFallback.Items.Add(EnumHelper<AudioEncoder>.GetDisplay(AudioEncoder.Lame));\r
+ drp_passthruFallback.Items.Add(EnumHelper<AudioEncoder>.GetDisplay(AudioEncoder.Ac3));\r
+\r
if (path.Contains("MKV"))\r
{\r
drp_audioEncoder.Items.Add(EnumHelper<AudioEncoder>.GetDisplay(AudioEncoder.Vorbis));\r
drp_audioEncoder.Items.Add(EnumHelper<AudioEncoder>.GetDisplay(AudioEncoder.ffflac));\r
+\r
+ drp_passthruFallback.Items.Add(EnumHelper<AudioEncoder>.GetDisplay(AudioEncoder.Vorbis));\r
+ drp_passthruFallback.Items.Add(EnumHelper<AudioEncoder>.GetDisplay(AudioEncoder.ffflac));\r
}\r
\r
+\r
if (!drp_audioEncoder.Items.Contains(oldval))\r
drp_audioEncoder.SelectedIndex = 0;\r
else\r
drp_audioEncoder.SelectedItem = oldval;\r
+\r
+ if (!drp_passthruFallback.Items.Contains(fallbackOldVal))\r
+ drp_passthruFallback.SelectedIndex = 3;\r
+ else\r
+ drp_passthruFallback.SelectedItem = fallbackOldVal;\r
}\r
\r
/// <summary>\r
/// <summary>\r
/// Load an arraylist of AudioTrack items into the list.\r
/// </summary>\r
- /// <param name="tracks">List of audio tracks</param>\r
- public void LoadTracks(ObservableCollection<AudioTrack> tracks)\r
+ /// <param name="preset">\r
+ /// The preset.\r
+ /// </param>\r
+ public void LoadTracks(Preset preset)\r
{\r
ClearAudioList();\r
\r
+ ObservableCollection<AudioTrack> tracks = preset.Task.AudioTracks;\r
+ this.PassthruSettings = preset.AudioPassthruSettings ?? new AllowedPassthru(false);\r
+ this.SetPassthruSettings(this.PassthruSettings);\r
+\r
if (tracks == null || (drp_audioTrack.SelectedItem != null && drp_audioTrack.SelectedItem.ToString() == AudioHelper.NoneFound.Description))\r
return;\r
\r
this.AudioTracks.Clear();\r
this.ScannedTracks.Clear();\r
\r
+ // Setup the passthru options\r
+ this.PassthruSettings = preset.AudioPassthruSettings ?? new AllowedPassthru(false);\r
+ this.SetPassthruSettings(this.PassthruSettings);\r
+\r
if (selectedTitle.AudioTracks.Count == 0)\r
{ \r
this.ScannedTracks.Add(AudioHelper.NoneFound);\r
/// </returns>\r
private AudioEncoder GetCompatiblePassthru(AudioTrack track)\r
{\r
- if (track.ScannedTrack.Format.Contains("AC3"))\r
+ if (track.ScannedTrack.Format.Contains("AC3") && this.check_ac3.Checked)\r
{\r
return AudioEncoder.Ac3Passthrough;\r
}\r
\r
- if (track.ScannedTrack.Format.Contains("DTS"))\r
+ if (track.ScannedTrack.Format.Contains("DTS") && this.check_dts.Checked)\r
+ {\r
+ return AudioEncoder.DtsPassthrough;\r
+ }\r
+\r
+ if (track.ScannedTrack.Format.Contains("DTS-HD") && this.check_dtshd.Checked)\r
{\r
return AudioEncoder.DtsPassthrough;\r
}\r
\r
- if (track.ScannedTrack.Format.Contains("aac"))\r
+ if (track.ScannedTrack.Format.Contains("aac") && this.check_aac.Checked)\r
{\r
return AudioEncoder.AacPassthru;\r
}\r
\r
- if (track.ScannedTrack.Format.Contains("mp3"))\r
+ if (track.ScannedTrack.Format.Contains("mp3") && this.check_mp3.Checked)\r
{\r
return AudioEncoder.Mp3Passthru;\r
}\r
\r
- return AudioEncoder.Faac;\r
+ return EnumHelper<AudioEncoder>.GetValue(drp_passthruFallback.SelectedItem.ToString()); \r
+ }\r
+\r
+ /// <summary>\r
+ /// Setup the Passthru Settings Panel\r
+ /// </summary>\r
+ /// <param name="settings">\r
+ /// The settings.\r
+ /// </param>\r
+ private void SetPassthruSettings(AllowedPassthru settings)\r
+ {\r
+ if (settings == null)\r
+ {\r
+ settings = this.PassthruSettings;\r
+ }\r
+\r
+ this.check_aac.Checked = settings.AudioAllowAACPass;\r
+ this.check_mp3.Checked = settings.AudioAllowMP3Pass;\r
+ this.check_ac3.Checked = settings.AudioAllowAC3Pass;\r
+ this.check_dts.Checked = settings.AudioAllowDTSPass;\r
+ this.check_dtshd.Checked = settings.AudioAllowDTSHDPass;\r
+ this.drp_passthruFallback.SelectedItem = EnumHelper<AudioEncoder>.GetDisplay(settings.AudioEncoderFallback); \r
}\r
\r
#endregion\r
\r
+ /// <summary>\r
+ /// Open the Advanced Audio Settings UI\r
+ /// </summary>\r
+ /// <param name="sender">\r
+ /// The sender.\r
+ /// </param>\r
+ /// <param name="e">\r
+ /// The e.\r
+ /// </param>\r
private void btn_AdvancedAudio_Click(object sender, EventArgs e)\r
{\r
if (audioList.SelectedRows.Count == 0)\r
\r
advancedAudio.Show();\r
}\r
+\r
+ /// <summary>\r
+ /// Handle changes in the Checked Passthru Options\r
+ /// </summary>\r
+ /// <param name="sender">\r
+ /// The sender.\r
+ /// </param>\r
+ /// <param name="e">\r
+ /// The EventArgs.\r
+ /// </param>\r
+ private void autoPassthru_CheckedChanged(object sender, EventArgs e)\r
+ {\r
+ if (sender == this.check_mp3)\r
+ {\r
+ this.PassthruSettings.AudioAllowMP3Pass = this.check_mp3.Checked;\r
+ }\r
+\r
+ if (sender == this.check_aac)\r
+ {\r
+ this.PassthruSettings.AudioAllowAACPass = this.check_aac.Checked;\r
+ }\r
+\r
+ if (sender == this.check_ac3)\r
+ {\r
+ this.PassthruSettings.AudioAllowAC3Pass = this.check_ac3.Checked;\r
+ }\r
+\r
+ if (sender == this.check_dts)\r
+ {\r
+ this.PassthruSettings.AudioAllowDTSPass = this.check_dts.Checked;\r
+ }\r
+\r
+ if (sender == this.check_dtshd)\r
+ {\r
+ this.PassthruSettings.AudioAllowDTSHDPass = this.check_dtshd.Checked;\r
+ }\r
+ }\r
+\r
+ /// <summary>\r
+ /// Set the fallback encoder\r
+ /// </summary>\r
+ /// <param name="sender">\r
+ /// The sender.\r
+ /// </param>\r
+ /// <param name="e">\r
+ /// The e.\r
+ /// </param>\r
+ private void drp_passthruFallback_SelectedIndexChanged(object sender, EventArgs e)\r
+ {\r
+ this.PassthruSettings.AudioEncoderFallback =\r
+ EnumHelper<AudioEncoder>.GetValue(drp_passthruFallback.SelectedItem.ToString());\r
+ }\r
}\r
}
\ No newline at end of file
<metadata name="RemoveTrackMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
<value>561, 16</value>\r
</metadata>\r
+ <data name="groupBox1.ToolTip" xml:space="preserve">\r
+ <value>Controls the behaviour of the Audio Codec dropdown when passthru options are selected.\r
+\r
+When an incorrect passthru option is selected, it will try to fall back to the correct one if the\r
+format checkbox in the "Auto Passthru" section is checked.\r
+\r
+If there is no suitable passthru option, it will use the "Fallkback" encoder.\r
+\r
+These settings are global to all Audio Tracks.\r
+These settings are stored in the presets.</value>\r
+ </data>\r
</root>
\ No newline at end of file
/// The encode task.\r
/// </param>\r
public static void LoadPreset(frmMain mainWindow, EncodeTask encodeTask)\r
- {\r
- Preset preset = new Preset { Name = "Unknown", Task = encodeTask };\r
- LoadPreset(mainWindow, preset);\r
- }\r
+ {\r
+ Preset preset = new Preset { Name = "Unknown", Task = encodeTask };\r
+ LoadPreset(mainWindow, preset);\r
+ }\r
\r
/// <summary>\r
/// This function takes in a Query which has been parsed by QueryParser and\r
/// <param name="preset">\r
/// The preset.\r
/// </param>\r
- public static void LoadPreset(frmMain mainWindow, Preset preset)\r
+ public static void LoadPreset(frmMain mainWindow, Preset preset)\r
{\r
// Send the query from the file to the Query Parser class\r
EncodeTask presetQuery = preset.Task ?? QueryParserUtility.Parse(preset.Query);\r
+ if (preset.Task == null)\r
+ {\r
+ preset.Task = presetQuery;\r
+ }\r
\r
#region Source\r
\r
mainWindow.PictureSettings.text_height.Value = presetQuery.MaxHeight.Value;\r
}\r
\r
- mainWindow.PictureSettings.PresetMaximumResolution = new Size(\r
- presetQuery.MaxWidth.HasValue ? presetQuery.MaxWidth.Value : 0,\r
- presetQuery.MaxHeight.HasValue ? presetQuery.MaxHeight.Value : 0);\r
+ mainWindow.PictureSettings.PresetMaximumResolution = new Size(\r
+ presetQuery.MaxWidth.HasValue ? presetQuery.MaxWidth.Value : 0,\r
+ presetQuery.MaxHeight.HasValue ? presetQuery.MaxHeight.Value : 0);\r
\r
// Case where both height and max height are 0 - For built-in presets\r
if (presetQuery.MaxHeight == 0 && presetQuery.Height == 0)\r
mainWindow.text_bitrate.Text = presetQuery.VideoBitrate.ToString();\r
mainWindow.check_2PassEncode.CheckState = presetQuery.TwoPass ? CheckState.Checked : CheckState.Unchecked;\r
mainWindow.check_turbo.CheckState = presetQuery.TurboFirstPass ? CheckState.Checked : CheckState.Unchecked;\r
- } \r
+ }\r
\r
if (presetQuery.Framerate != null)\r
{\r
\r
#region Audio\r
\r
- mainWindow.AudioSettings.LoadTracks(presetQuery.AudioTracks);\r
+ mainWindow.AudioSettings.LoadTracks(preset);\r
\r
#endregion\r
\r
<Compile Include="Functions\Win32.cs" />\r
<Compile Include="Functions\Win7.cs" />\r
<Compile Include="Model\DriveInformation.cs" />\r
+ <Compile Include="Model\Encoding\AllowedPassthru.cs" />\r
<Compile Include="Model\Encoding\AudioTrack.cs" />\r
<Compile Include="Model\Encoding\ChapterMarker.cs" />\r
<Compile Include="Model\Encoding\FramerateMode.cs" />\r
--- /dev/null
+/* AllowedPassthru.cs $\r
+ This file is part of the HandBrake source code.\r
+ Homepage: <http://handbrake.fr>.\r
+ It may be used under the terms of the GNU General Public License. */\r
+\r
+namespace HandBrake.ApplicationServices.Model.Encoding\r
+{\r
+ using Interop.Model.Encoding;\r
+\r
+ /// <summary>\r
+ /// Allowed Passthru Options\r
+ /// </summary>\r
+ public class AllowedPassthru\r
+ {\r
+ /// <summary>\r
+ /// Initializes a new instance of the <see cref="AllowedPassthru"/> class. \r
+ /// </summary>\r
+ public AllowedPassthru()\r
+ {\r
+ this.AudioAllowAACPass = true;\r
+ this.AudioAllowAC3Pass = true;\r
+ this.AudioAllowDTSHDPass = true;\r
+ this.AudioAllowDTSPass = true;\r
+ this.AudioAllowMP3Pass = true;\r
+ this.AudioEncoderFallback = AudioEncoder.Ac3;\r
+ }\r
+\r
+ /// <summary>\r
+ /// Initializes a new instance of the <see cref="AllowedPassthru"/> class. \r
+ /// </summary>\r
+ /// <param name="initialValue">\r
+ /// The initial Value.\r
+ /// </param>\r
+ public AllowedPassthru(bool initialValue)\r
+ {\r
+ this.AudioAllowAACPass = initialValue;\r
+ this.AudioAllowAC3Pass = initialValue;\r
+ this.AudioAllowDTSHDPass = initialValue;\r
+ this.AudioAllowDTSPass = initialValue;\r
+ this.AudioAllowMP3Pass = initialValue;\r
+ this.AudioEncoderFallback = AudioEncoder.Ac3;\r
+ }\r
+\r
+ /// <summary>\r
+ /// Gets or sets a value indicating whether AudioAllowAACPass.\r
+ /// </summary>\r
+ public bool AudioAllowAACPass { get; set; }\r
+\r
+ /// <summary>\r
+ /// Gets or sets a value indicating whether AudioAllowAC3Pass.\r
+ /// </summary>\r
+ public bool AudioAllowAC3Pass { get; set; }\r
+\r
+ /// <summary>\r
+ /// Gets or sets a value indicating whether AudioAllowDTSHDPass.\r
+ /// </summary>\r
+ public bool AudioAllowDTSHDPass { get; set; }\r
+\r
+ /// <summary>\r
+ /// Gets or sets a value indicating whether AudioAllowDTSPass.\r
+ /// </summary>\r
+ public bool AudioAllowDTSPass { get; set; }\r
+\r
+ /// <summary>\r
+ /// Gets or sets a value indicating whether AudioAllowMP3Pass.\r
+ /// </summary>\r
+ public bool AudioAllowMP3Pass { get; set; }\r
+\r
+ /// <summary>\r
+ /// Gets or sets AudioEncoderFallback.\r
+ /// </summary>\r
+ public AudioEncoder AudioEncoderFallback { get; set; }\r
+ }\r
+}\r
\r
namespace HandBrake.ApplicationServices.Model\r
{\r
+ using Encoding;\r
+\r
/// <summary>\r
/// A Preset for encoding with.\r
/// </summary>\r
/// </summary>\r
public EncodeTask Task { get; set; }\r
\r
+ /// <summary>\r
+ /// Gets or sets AudioPassthruSettings.\r
+ /// </summary>\r
+ public AllowedPassthru AudioPassthruSettings { get; set; }\r
+\r
/// <summary>\r
/// Override the ToString Method\r
/// </summary>\r
Homepage: <http://handbrake.fr>.\r
It may be used under the terms of the GNU General Public License. */\r
\r
+using HandBrake.ApplicationServices.Model.Encoding;\r
+using HandBrake.ApplicationServices.Utilities;\r
+\r
namespace HandBrake.ApplicationServices.Services\r
{\r
using System;\r
Regex r = new Regex("(: )"); // Split on hyphens. \r
string[] presetName = r.Split(line);\r
\r
- bool pic = false;\r
- if (presetName[2].Contains("crop"))\r
- {\r
- pic = true;\r
- }\r
+ bool pic = presetName[2].Contains("crop");\r
\r
Preset newPreset = new Preset\r
{\r
Version = this.userSettingService.GetUserSetting<string>(ASUserSettingConstants.HandBrakeVersion),\r
CropSettings = pic,\r
Description = string.Empty, // Maybe one day we will populate this.\r
- IsBuildIn = true\r
+ IsBuildIn = true,\r
+ Task = QueryParserUtility.Parse(presetName[2])\r
};\r
\r
+ newPreset.AudioPassthruSettings = new AllowedPassthru(false); // We don't want to override the built-in preset\r
+ \r
if (newPreset.Name == "Normal")\r
{\r
newPreset.IsDefault = true;\r
Name = this.txt_preset_name.Text,\r
Query = query,\r
CropSettings = pictureSettingsMode != QueryPictureSettingsMode.None,\r
- Description = string.Empty\r
+ Description = string.Empty,\r
+ AudioPassthruSettings = mainWindow.AudioSettings.PassthruSettings \r
};\r
\r
if (presetCode.Add(preset))\r
Homepage: <http://handbrake.fr/>.\r
It may be used under the terms of the GNU General Public License. */\r
\r
+using HandBrake.ApplicationServices.Model.Encoding;\r
+\r
namespace Handbrake\r
{\r
using System;\r
{\r
Name = parsed.PresetName,\r
Query = QueryGenerator.GenerateFullQuery(this).Query,\r
- CropSettings = parsed.UsesPictureSettings\r
+ CropSettings = parsed.UsesPictureSettings,\r
+ Task = parsed,\r
+ AudioPassthruSettings = new AllowedPassthru(false), // TODO at a future point, support this.\r
};\r
\r
presetHandler.Update(preset);\r
else\r
{\r
\r
- Preset preset = new Preset\r
+ Preset preset = new Preset \r
{\r
Name = parsed.PresetName,\r
Query = QueryGenerator.GenerateFullQuery(this).Query,\r
CropSettings = parsed.UsesPictureSettings,\r
+ Task = parsed,\r
+ AudioPassthruSettings = new AllowedPassthru(false), // TODO at a future point, support this.\r
};\r
\r
if (presetHandler.Add(preset))\r
\r
// Now load the preset\r
PresetLoader.LoadPreset(this, preset);\r
- this.AudioSettings.LoadTracks(queueEdit.Task.AudioTracks);\r
+ preset.Task = queueEdit.Task;\r
+ this.AudioSettings.LoadTracks(preset);\r
\r
// Set the destination path);\r
this.text_destination.Text = queueEdit.Destination;\r