diff options
author | sr55 <[email protected]> | 2010-10-10 14:12:22 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2010-10-10 14:12:22 +0000 |
commit | 8019891f41076f6eb1f2ed6ae535103b392662e2 (patch) | |
tree | 2d8ba5771ea46fa6c52adb9c63e1b0b38dfed659 /win/C#/Controls | |
parent | 5f381b10a35af1530f2711cd23b3445cbf3d1470 (diff) |
WinGui:
- Add support for the new AC3 Encoder.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3595 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/Controls')
-rw-r--r-- | win/C#/Controls/AudioPanel.Designer.cs | 106 | ||||
-rw-r--r-- | win/C#/Controls/AudioPanel.cs | 96 |
2 files changed, 105 insertions, 97 deletions
diff --git a/win/C#/Controls/AudioPanel.Designer.cs b/win/C#/Controls/AudioPanel.Designer.cs index 0931d2a3f..3349ab488 100644 --- a/win/C#/Controls/AudioPanel.Designer.cs +++ b/win/C#/Controls/AudioPanel.Designer.cs @@ -59,13 +59,13 @@ namespace Handbrake.Controls this.AudioTrackGroup = new System.Windows.Forms.GroupBox();
this.AudioMenuRowHeightHack = new System.Windows.Forms.ImageList(this.components);
this.audioList = new System.Windows.Forms.DataGridView();
- this.DRC = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.Bitrate = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.Samplerate = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.Mixdown = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.AudioCodec = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.Source = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Track = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.Source = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.AudioCodec = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.Mixdown = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.Samplerate = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.Bitrate = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.DRC = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.audioMenu.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.tb_drc)).BeginInit();
this.AudioTrackGroup.SuspendLayout();
@@ -166,7 +166,7 @@ namespace Handbrake.Controls this.tb_drc.Size = new System.Drawing.Size(57, 45);
this.tb_drc.TabIndex = 60;
this.tb_drc.TickFrequency = 10;
- this.tb_drc.Scroll += new System.EventHandler(this.controlChanged);
+ this.tb_drc.Scroll += new System.EventHandler(this.ControlChanged);
//
// label68
//
@@ -227,12 +227,14 @@ namespace Handbrake.Controls "AAC (faac)",
"MP3 (lame)",
"Vorbis (vorbis)",
- "AC3 Passthru"});
+ "AC3 Passthru",
+ "AC3 (ffmpeg)",
+ "DTS Passthru"});
this.drp_audioEncoder.Location = new System.Drawing.Point(215, 34);
this.drp_audioEncoder.Name = "drp_audioEncoder";
this.drp_audioEncoder.Size = new System.Drawing.Size(111, 21);
this.drp_audioEncoder.TabIndex = 52;
- this.drp_audioEncoder.SelectedIndexChanged += new System.EventHandler(this.controlChanged);
+ this.drp_audioEncoder.SelectedIndexChanged += new System.EventHandler(this.ControlChanged);
//
// label27
//
@@ -259,7 +261,7 @@ namespace Handbrake.Controls this.drp_audioMix.Name = "drp_audioMix";
this.drp_audioMix.Size = new System.Drawing.Size(129, 21);
this.drp_audioMix.TabIndex = 54;
- this.drp_audioMix.SelectedIndexChanged += new System.EventHandler(this.controlChanged);
+ this.drp_audioMix.SelectedIndexChanged += new System.EventHandler(this.ControlChanged);
//
// drp_audioTrack
//
@@ -271,7 +273,7 @@ namespace Handbrake.Controls this.drp_audioTrack.Name = "drp_audioTrack";
this.drp_audioTrack.Size = new System.Drawing.Size(194, 21);
this.drp_audioTrack.TabIndex = 50;
- this.drp_audioTrack.SelectedIndexChanged += new System.EventHandler(this.controlChanged);
+ this.drp_audioTrack.SelectedIndexChanged += new System.EventHandler(this.ControlChanged);
//
// drp_audioBitrate
//
@@ -292,7 +294,7 @@ namespace Handbrake.Controls this.drp_audioBitrate.Name = "drp_audioBitrate";
this.drp_audioBitrate.Size = new System.Drawing.Size(70, 21);
this.drp_audioBitrate.TabIndex = 58;
- this.drp_audioBitrate.SelectedIndexChanged += new System.EventHandler(this.controlChanged);
+ this.drp_audioBitrate.SelectedIndexChanged += new System.EventHandler(this.ControlChanged);
//
// drp_audioSample
//
@@ -309,7 +311,7 @@ namespace Handbrake.Controls this.drp_audioSample.Name = "drp_audioSample";
this.drp_audioSample.Size = new System.Drawing.Size(55, 21);
this.drp_audioSample.TabIndex = 56;
- this.drp_audioSample.SelectedIndexChanged += new System.EventHandler(this.controlChanged);
+ this.drp_audioSample.SelectedIndexChanged += new System.EventHandler(this.ControlChanged);
//
// AudioTrackGroup
//
@@ -371,32 +373,29 @@ namespace Handbrake.Controls this.audioList.TabIndex = 67;
this.audioList.SelectionChanged += new System.EventHandler(this.audioList_SelectionChanged);
//
- // DRC
+ // Track
//
- this.DRC.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
- this.DRC.FillWeight = 96.36334F;
- this.DRC.HeaderText = "DRC";
- this.DRC.Name = "DRC";
- this.DRC.ReadOnly = true;
- this.DRC.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+ this.Track.FillWeight = 304.2808F;
+ this.Track.HeaderText = "Track";
+ this.Track.Name = "Track";
+ this.Track.ReadOnly = true;
+ this.Track.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+ this.Track.Width = 50;
//
- // Bitrate
+ // Source
//
- this.Bitrate.FillWeight = 49.69727F;
- this.Bitrate.HeaderText = "Bitrate";
- this.Bitrate.Name = "Bitrate";
- this.Bitrate.ReadOnly = true;
- this.Bitrate.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
- this.Bitrate.Width = 75;
+ this.Source.FillWeight = 49.69727F;
+ this.Source.HeaderText = "Source";
+ this.Source.Name = "Source";
+ this.Source.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+ this.Source.Width = 150;
//
- // Samplerate
+ // AudioCodec
//
- this.Samplerate.FillWeight = 49.69727F;
- this.Samplerate.HeaderText = "Samplerate";
- this.Samplerate.Name = "Samplerate";
- this.Samplerate.ReadOnly = true;
- this.Samplerate.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
- this.Samplerate.Width = 75;
+ this.AudioCodec.HeaderText = "Audio Codec";
+ this.AudioCodec.Name = "AudioCodec";
+ this.AudioCodec.ReadOnly = true;
+ this.AudioCodec.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Mixdown
//
@@ -407,29 +406,32 @@ namespace Handbrake.Controls this.Mixdown.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.Mixdown.Width = 150;
//
- // AudioCodec
+ // Samplerate
//
- this.AudioCodec.HeaderText = "Audio Codec";
- this.AudioCodec.Name = "AudioCodec";
- this.AudioCodec.ReadOnly = true;
- this.AudioCodec.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+ this.Samplerate.FillWeight = 49.69727F;
+ this.Samplerate.HeaderText = "Samplerate";
+ this.Samplerate.Name = "Samplerate";
+ this.Samplerate.ReadOnly = true;
+ this.Samplerate.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+ this.Samplerate.Width = 75;
//
- // Source
+ // Bitrate
//
- this.Source.FillWeight = 49.69727F;
- this.Source.HeaderText = "Source";
- this.Source.Name = "Source";
- this.Source.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
- this.Source.Width = 150;
+ this.Bitrate.FillWeight = 49.69727F;
+ this.Bitrate.HeaderText = "Bitrate";
+ this.Bitrate.Name = "Bitrate";
+ this.Bitrate.ReadOnly = true;
+ this.Bitrate.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+ this.Bitrate.Width = 75;
//
- // Track
+ // DRC
//
- this.Track.FillWeight = 304.2808F;
- this.Track.HeaderText = "Track";
- this.Track.Name = "Track";
- this.Track.ReadOnly = true;
- this.Track.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
- this.Track.Width = 50;
+ this.DRC.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+ this.DRC.FillWeight = 96.36334F;
+ this.DRC.HeaderText = "DRC";
+ this.DRC.Name = "DRC";
+ this.DRC.ReadOnly = true;
+ this.DRC.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// AudioPanel
//
diff --git a/win/C#/Controls/AudioPanel.cs b/win/C#/Controls/AudioPanel.cs index 3555dcd28..888c91c9f 100644 --- a/win/C#/Controls/AudioPanel.cs +++ b/win/C#/Controls/AudioPanel.cs @@ -21,6 +21,11 @@ namespace Handbrake.Controls /// </summary>
public partial class AudioPanel : UserControl
{
+
+ private const string AC3Passthru = "AC3 Passthru";
+
+ private const string DTSPassthru = "DTS Passthru";
+
/// <summary>
/// Initializes a new instance of the <see cref="AudioPanel"/> class.
/// Create a new instance of the Audio Panel
@@ -55,32 +60,26 @@ namespace Handbrake.Controls public void SetContainer(string path)
{
string oldval = drp_audioEncoder.Text;
- if ((path.Contains("MP4")) || (path.Contains("M4V")))
- {
- drp_audioEncoder.Items.Clear();
- drp_audioEncoder.Items.Add("AAC (faac)");
- drp_audioEncoder.Items.Add("MP3 (lame)");
- drp_audioEncoder.Items.Add("AC3 Passthru");
- if ((oldval != "AAC (faac)") && (oldval != "AC3 Passthru"))
- drp_audioEncoder.SelectedIndex = 0;
- else
- drp_audioEncoder.SelectedItem = oldval;
- }
- else if (path.Contains("MKV"))
+
+ drp_audioEncoder.Items.Clear();
+ drp_audioEncoder.Items.Add("AAC (faac)");
+ drp_audioEncoder.Items.Add("MP3 (lame)");
+ drp_audioEncoder.Items.Add(AC3Passthru);
+ drp_audioEncoder.Items.Add("AC3 (ffmpeg)");
+
+ if (path.Contains("MKV"))
{
- drp_audioEncoder.Items.Clear();
- drp_audioEncoder.Items.Add("AAC (faac)");
- drp_audioEncoder.Items.Add("MP3 (lame)");
- drp_audioEncoder.Items.Add("AC3 Passthru");
- drp_audioEncoder.Items.Add("DTS Passthru");
+ drp_audioEncoder.Items.Add(DTSPassthru);
drp_audioEncoder.Items.Add("Vorbis (vorbis)");
- drp_audioEncoder.SelectedItem = oldval;
-
- if (drp_audioEncoder.Text == string.Empty)
- drp_audioEncoder.SelectedIndex = 0;
}
+ if (!drp_audioEncoder.Text.Contains(oldval))
+ drp_audioEncoder.SelectedIndex = 0;
+ else
+ drp_audioEncoder.SelectedItem = oldval;
+
// Make sure the table is updated with new audio codecs
+ // Defaults to AAC encoding.
foreach (DataGridViewRow row in audioList.Rows)
{
if (!drp_audioEncoder.Items.Contains(row.Cells[2].Value))
@@ -117,7 +116,7 @@ namespace Handbrake.Controls newTrack.Cells[2].Value = track.Encoder;
newTrack.Cells[3].Value = track.MixDown;
newTrack.Cells[4].Value = track.SampleRate;
- newTrack.Cells[5].Value = track.Encoder.Contains("AC3") || track.Encoder.Contains("DTS") ? "Auto" : track.Bitrate;
+ newTrack.Cells[5].Value = track.Encoder.Contains(AC3Passthru) || track.Encoder.Contains(DTSPassthru) ? "Auto" : track.Bitrate;
newTrack.Cells[6].Value = track.DRC;
AddTrackForPreset(newTrack);
}
@@ -145,12 +144,6 @@ namespace Handbrake.Controls drp_audioTrack.Items.Clear();
drp_audioTrack.Items.AddRange(selectedTitle.AudioTracks.ToArray());
- // Reset the Audio Track Selection to the first audio track of the source, or Audiomatic if that fails
- foreach (DataGridViewRow row in this.audioList.Rows)
- {
- row.Cells[1].Value = "Automatic";
- }
-
// Add any tracks the preset has, if there is a preset and no audio tracks in the list currently
if (audioList.Rows.Count == 0 && preset != null)
{
@@ -244,7 +237,7 @@ namespace Handbrake.Controls /// <param name="e">
/// The e.
/// </param>
- private void controlChanged(object sender, EventArgs e)
+ private void ControlChanged(object sender, EventArgs e)
{
Control ctl = (Control)sender;
@@ -256,14 +249,14 @@ namespace Handbrake.Controls audioList.SelectedRows[0].Cells[1].Value = drp_audioTrack.Text;
// If the track isn't AC3, and the encoder is, change it.
- if (audioList.SelectedRows[0].Cells[2].Value.ToString().Contains("AC3") && !audioList.SelectedRows[0].Cells[1].Value.ToString().Contains("AC3"))
+ if (audioList.SelectedRows[0].Cells[2].Value.ToString().Contains(AC3Passthru) && !audioList.SelectedRows[0].Cells[1].Value.ToString().Contains("(AC3)"))
{
// Switch to AAC
drp_audioEncoder.SelectedIndex = 0;
}
// If the track isn't DTS, and the encoder is, change it.
- if (audioList.SelectedRows[0].Cells[2].Value.ToString().Contains("DTS") && !audioList.SelectedRows[0].Cells[1].Value.ToString().Contains("DTS"))
+ if (audioList.SelectedRows[0].Cells[2].Value.ToString().Contains(DTSPassthru) && !audioList.SelectedRows[0].Cells[1].Value.ToString().Contains("DTS"))
{
// Switch to AAC
drp_audioEncoder.SelectedIndex = 0;
@@ -275,7 +268,7 @@ namespace Handbrake.Controls SetBitrate();
// Configure the widgets with values
- if (drp_audioEncoder.Text.Contains("AC3") || drp_audioEncoder.Text.Contains("DTS"))
+ if (drp_audioEncoder.Text.Contains(AC3Passthru) || drp_audioEncoder.Text.Contains(DTSPassthru))
{
drp_audioMix.Enabled =
drp_audioBitrate.Enabled = drp_audioSample.Enabled = tb_drc.Enabled = false;
@@ -592,6 +585,7 @@ namespace Handbrake.Controls drp_audioBitrate.Items.Remove("320");
drp_audioBitrate.Items.Remove("384");
drp_audioBitrate.Items.Remove("448");
+ drp_audioBitrate.Items.Remove("640");
drp_audioBitrate.Items.Remove("768");
switch (drp_audioEncoder.Text)
@@ -605,12 +599,15 @@ namespace Handbrake.Controls case "Vorbis (vorbis)":
max = 384;
break;
- case "AC3 Passthru":
+ case "AC3 (ffmpeg)":
+ max = 640;
+ break;
+ case AC3Passthru:
drp_audioBitrate.Items.Add("Auto");
drp_audioBitrate.SelectedItem = "Auto";
drp_audioSample.SelectedItem = "Auto";
break;
- case "DTS Passthru":
+ case DTSPassthru:
drp_audioBitrate.Items.Add("Auto");
drp_audioBitrate.SelectedItem = "Auto";
drp_audioSample.SelectedItem = "Auto";
@@ -630,9 +627,14 @@ namespace Handbrake.Controls drp_audioBitrate.Items.Add("384");
}
- if (max == 768)
+ if (max >= 640)
{
drp_audioBitrate.Items.Add("448");
+ drp_audioBitrate.Items.Add("640");
+ }
+
+ if (max == 768)
+ {
drp_audioBitrate.Items.Add("768");
}
@@ -651,31 +653,35 @@ namespace Handbrake.Controls drp_audioMix.Items.Add("Dolby Surround");
drp_audioMix.Items.Add("Dolby Pro Logic II");
drp_audioMix.Items.Add("6 Channel Discrete");
- drp_audioMix.Items.Add("AC3 Passthru");
- drp_audioMix.Items.Add("DTS Passthru");
+ drp_audioMix.Items.Add(AC3Passthru);
+ drp_audioMix.Items.Add(DTSPassthru);
drp_audioMix.SelectedItem = "Dolby Pro Logic II";
switch (drp_audioEncoder.Text)
{
case "AAC (faac)":
- drp_audioMix.Items.Remove("AC3 Passthru");
- drp_audioMix.Items.Remove("DTS Passthru");
+ drp_audioMix.Items.Remove(AC3Passthru);
+ drp_audioMix.Items.Remove(DTSPassthru);
break;
case "MP3 (lame)":
drp_audioMix.Items.Remove("6 Channel Discrete");
- drp_audioMix.Items.Remove("AC3 Passthru");
- drp_audioMix.Items.Remove("DTS Passthru");
+ drp_audioMix.Items.Remove(AC3Passthru);
+ drp_audioMix.Items.Remove(DTSPassthru);
break;
case "Vorbis (vorbis)":
- drp_audioMix.Items.Remove("AC3 Passthru");
- drp_audioMix.Items.Remove("DTS Passthru");
+ drp_audioMix.Items.Remove(AC3Passthru);
+ drp_audioMix.Items.Remove(DTSPassthru);
+ break;
+ case "AC3 (ffmpeg)":
+ drp_audioMix.Items.Remove(AC3Passthru);
+ drp_audioMix.Items.Remove(DTSPassthru);
break;
case "AC3 Passthru":
- drp_audioMix.SelectedItem = "AC3 Passthru";
+ drp_audioMix.SelectedItem = AC3Passthru;
break;
case "DTS Passthru":
- drp_audioMix.SelectedItem = "DTS Passthru";
+ drp_audioMix.SelectedItem = DTSPassthru;
break;
}
}
|