summaryrefslogtreecommitdiffstats
path: root/win/CS
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS')
-rw-r--r--win/CS/Controls/AudioPanel.cs33
-rw-r--r--win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs7
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/PresetService.cs14
-rw-r--r--win/CS/frmMain.Designer.cs16
-rw-r--r--win/CS/frmMain.cs7
-rw-r--r--win/CS/frmMain.resx21
6 files changed, 61 insertions, 37 deletions
diff --git a/win/CS/Controls/AudioPanel.cs b/win/CS/Controls/AudioPanel.cs
index 5d5c59a85..ff56a1330 100644
--- a/win/CS/Controls/AudioPanel.cs
+++ b/win/CS/Controls/AudioPanel.cs
@@ -92,7 +92,7 @@ namespace Handbrake.Controls
if (track.Encoder == AudioEncoder.Ac3Passthrough || track.Encoder == AudioEncoder.DtsPassthrough)
{
passthruTracks += track.ScannedTrack.Bitrate;
- }
+ }
else
{
encodedTracks += track.Bitrate;
@@ -286,17 +286,9 @@ namespace Handbrake.Controls
// Update an item in the Audio list if required.
track.Encoder = EnumHelper<AudioEncoder>.GetValue(drp_audioEncoder.Text);
- //// Just make sure we don't have the wrong mixdown set, if we do fix it.
- //if (track.MixDown == HandBrake.ApplicationServices.Model.Encoding.Mixdown.Ac3Passthrough || track.MixDown == HandBrake.ApplicationServices.Model.Encoding.Mixdown.DtsPassthrough)
- //{
- // if (track.Encoder != AudioEncoder.Ac3Passthrough && track.Encoder != AudioEncoder.DtsPassthrough)
- // {
- // drp_audioMix.SelectedItem = "Dolby Pro Logic II";
- // }
- //}
break;
case "drp_audioMix":
- SetBitrate();
+ SetBitrate(track.Bitrate);
if (drp_audioMix.SelectedItem != null)
{
@@ -342,8 +334,8 @@ namespace Handbrake.Controls
drp_audioTrack.SelectedItem = track.ScannedTrack;
drp_audioEncoder.SelectedItem = EnumHelper<AudioEncoder>.GetDescription(track.Encoder);
drp_audioMix.SelectedItem = EnumHelper<Mixdown>.GetDescription(track.MixDown);
- drp_audioSample.SelectedItem = track.SampleRate;
- drp_audioBitrate.SelectedItem = track.Bitrate;
+ drp_audioSample.SelectedItem = track.SampleRateDisplayValue;
+ drp_audioBitrate.SelectedItem = track.BitRateDisplayValue;
// Set the Advanced Control.
if (!advancedAudio.IsDisposed)
@@ -653,7 +645,10 @@ namespace Handbrake.Controls
/// <summary>
/// Set the bitrate dropdown
/// </summary>
- private void SetBitrate()
+ /// <param name="currentValue">
+ /// The current Value.
+ /// </param>
+ private void SetBitrate(int currentValue)
{
int max = 0;
string defaultRate = "160";
@@ -725,8 +720,16 @@ namespace Handbrake.Controls
drp_audioBitrate.Items.Add("768");
}
- // Set the default bit-rate
- drp_audioBitrate.SelectedItem = defaultRate;
+ // Set the Current Value, or default value if the value is out of bounds
+
+ if (currentValue <= max && currentValue != 0)
+ {
+ drp_audioBitrate.SelectedItem = currentValue.ToString();
+ }
+ else
+ {
+ drp_audioBitrate.SelectedItem = defaultRate;
+ }
}
/// <summary>
diff --git a/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs b/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs
index 1c688e79e..6a06586b2 100644
--- a/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs
+++ b/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs
@@ -105,7 +105,12 @@ namespace HandBrake.ApplicationServices.Model.Encoding
{
get
{
- return this.Bitrate == 0 ? "Auto" : this.Bitrate.ToString();
+ if (this.Encoder == AudioEncoder.Ac3Passthrough || this.Encoder == AudioEncoder.DtsPassthrough)
+ {
+ return "Auto";
+ }
+
+ return this.Bitrate.ToString();
}
}
diff --git a/win/CS/HandBrake.ApplicationServices/Services/PresetService.cs b/win/CS/HandBrake.ApplicationServices/Services/PresetService.cs
index 6381bb177..e4f67b7db 100644
--- a/win/CS/HandBrake.ApplicationServices/Services/PresetService.cs
+++ b/win/CS/HandBrake.ApplicationServices/Services/PresetService.cs
@@ -294,6 +294,20 @@ namespace HandBrake.ApplicationServices.Services
return name == string.Empty || this.presets.Any(item => item.Name == name);
}
+ /// <summary>
+ /// Returns a value if the preset can be updated / resaved
+ /// </summary>
+ /// <param name="name">
+ /// The name.
+ /// </param>
+ /// <returns>
+ /// True if it's not a built-in preset, false otherwise.
+ /// </returns>
+ public bool CanUpdatePreset(string name)
+ {
+ return this.presets.Where(preset => preset.Name == name).Any(preset => preset.IsBuildIn == false);
+ }
+
#endregion
#region Private Helpers
diff --git a/win/CS/frmMain.Designer.cs b/win/CS/frmMain.Designer.cs
index 129271dcd..066f7f68e 100644
--- a/win/CS/frmMain.Designer.cs
+++ b/win/CS/frmMain.Designer.cs
@@ -287,7 +287,7 @@ namespace Handbrake
this.check_turbo.Enabled = false;
this.check_turbo.Location = new System.Drawing.Point(495, 134);
this.check_turbo.Name = "check_turbo";
- this.check_turbo.Size = new System.Drawing.Size(101, 17);
+ this.check_turbo.Size = new System.Drawing.Size(99, 17);
this.check_turbo.TabIndex = 9;
this.check_turbo.Text = "Turbo first Pass";
this.ToolTip.SetToolTip(this.check_turbo, "Makes the first pass of a 2 pass encode faster.");
@@ -557,7 +557,7 @@ namespace Handbrake
this.radio_cq.BackColor = System.Drawing.Color.Transparent;
this.radio_cq.Location = new System.Drawing.Point(366, 37);
this.radio_cq.Name = "radio_cq";
- this.radio_cq.Size = new System.Drawing.Size(110, 17);
+ this.radio_cq.Size = new System.Drawing.Size(105, 17);
this.radio_cq.TabIndex = 3;
this.radio_cq.Text = "Constant Quality:";
this.ToolTip.SetToolTip(this.radio_cq, resources.GetString("radio_cq.ToolTip"));
@@ -571,7 +571,7 @@ namespace Handbrake
this.radio_avgBitrate.Checked = true;
this.radio_avgBitrate.Location = new System.Drawing.Point(367, 108);
this.radio_avgBitrate.Name = "radio_avgBitrate";
- this.radio_avgBitrate.Size = new System.Drawing.Size(116, 17);
+ this.radio_avgBitrate.Size = new System.Drawing.Size(112, 17);
this.radio_avgBitrate.TabIndex = 4;
this.radio_avgBitrate.TabStop = true;
this.radio_avgBitrate.Text = "Avg Bitrate (kbps):";
@@ -585,7 +585,7 @@ namespace Handbrake
this.check_2PassEncode.BackColor = System.Drawing.Color.Transparent;
this.check_2PassEncode.Location = new System.Drawing.Point(385, 134);
this.check_2PassEncode.Name = "check_2PassEncode";
- this.check_2PassEncode.Size = new System.Drawing.Size(104, 17);
+ this.check_2PassEncode.Size = new System.Drawing.Size(106, 17);
this.check_2PassEncode.TabIndex = 10;
this.check_2PassEncode.Text = "2-Pass Encoding";
this.ToolTip.SetToolTip(this.check_2PassEncode, resources.GetString("check_2PassEncode.ToolTip"));
@@ -608,8 +608,8 @@ namespace Handbrake
this.treeView_presets.TabIndex = 0;
this.treeView_presets.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView_presets_AfterSelect);
this.treeView_presets.KeyUp += new System.Windows.Forms.KeyEventHandler(this.treeView_presets_deleteKey);
+ this.treeView_presets.MouseDown += new System.Windows.Forms.MouseEventHandler(this.treeview_presets_mouseDown);
this.treeView_presets.MouseMove += new System.Windows.Forms.MouseEventHandler(this.TreeViewPresetsMouseMove);
- this.treeView_presets.MouseUp += new System.Windows.Forms.MouseEventHandler(this.treeview_presets_mouseUp);
//
// presets_menu
//
@@ -873,7 +873,7 @@ namespace Handbrake
this.radio_constantFramerate.Checked = true;
this.radio_constantFramerate.Location = new System.Drawing.Point(0, 0);
this.radio_constantFramerate.Name = "radio_constantFramerate";
- this.radio_constantFramerate.Size = new System.Drawing.Size(122, 17);
+ this.radio_constantFramerate.Size = new System.Drawing.Size(117, 17);
this.radio_constantFramerate.TabIndex = 17;
this.radio_constantFramerate.TabStop = true;
this.radio_constantFramerate.Text = "Constant Framerate";
@@ -885,7 +885,7 @@ namespace Handbrake
this.radio_peakAndVariable.BackColor = System.Drawing.Color.Transparent;
this.radio_peakAndVariable.Location = new System.Drawing.Point(0, 23);
this.radio_peakAndVariable.Name = "radio_peakAndVariable";
- this.radio_peakAndVariable.Size = new System.Drawing.Size(116, 17);
+ this.radio_peakAndVariable.Size = new System.Drawing.Size(113, 17);
this.radio_peakAndVariable.TabIndex = 19;
this.radio_peakAndVariable.Text = "Variable Framerate";
this.radio_peakAndVariable.UseVisualStyleBackColor = false;
@@ -963,7 +963,7 @@ namespace Handbrake
this.Check_ChapterMarkers.BackColor = System.Drawing.Color.Transparent;
this.Check_ChapterMarkers.Location = new System.Drawing.Point(16, 32);
this.Check_ChapterMarkers.Name = "Check_ChapterMarkers";
- this.Check_ChapterMarkers.Size = new System.Drawing.Size(140, 17);
+ this.Check_ChapterMarkers.Size = new System.Drawing.Size(136, 17);
this.Check_ChapterMarkers.TabIndex = 4;
this.Check_ChapterMarkers.Text = "Create chapter markers";
this.Check_ChapterMarkers.UseVisualStyleBackColor = false;
diff --git a/win/CS/frmMain.cs b/win/CS/frmMain.cs
index 10815d564..10cd69952 100644
--- a/win/CS/frmMain.cs
+++ b/win/CS/frmMain.cs
@@ -589,8 +589,7 @@ namespace Handbrake
// Now enable the save menu if the selected preset is a user preset
if (treeView_presets.SelectedNode != null)
- if (presetHandler.CheckIfPresetExists(treeView_presets.SelectedNode.Text))
- pmnu_saveChanges.Enabled = true;
+ pmnu_saveChanges.Enabled = presetHandler.CanUpdatePreset(treeView_presets.SelectedNode.Text);
treeView_presets.Select();
}
@@ -674,7 +673,7 @@ namespace Handbrake
/// <param name="e">
/// The e.
/// </param>
- private void treeview_presets_mouseUp(object sender, MouseEventArgs e)
+ private void treeview_presets_mouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
treeView_presets.SelectedNode = treeView_presets.GetNodeAt(e.Location);
@@ -1140,7 +1139,7 @@ namespace Handbrake
return false;
}
}
-
+
// Make sure we don't have a duplciate on the queue.
if (this.queueProcessor.QueueManager.CheckForDestinationPathDuplicates(jobDestination))
diff --git a/win/CS/frmMain.resx b/win/CS/frmMain.resx
index a737bb095..9ec365918 100644
--- a/win/CS/frmMain.resx
+++ b/win/CS/frmMain.resx
@@ -640,6 +640,18 @@ Clear the text box below to return to the internal query generation.</value>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>98</value>
</metadata>
+ <metadata name="File_Save.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>664, 15</value>
+ </metadata>
+ <metadata name="openPreset.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>310, 54</value>
+ </metadata>
+ <metadata name="File_ChapterImport.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>423, 54</value>
+ </metadata>
+ <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>98</value>
+ </metadata>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAYAMDAAAAEACACoDgAAZgAAACAgAAABAAgAqAgAAA4PAAAQEAAAAQAIAGgFAAC2FwAAMDAAAAEA
@@ -1019,13 +1031,4 @@ Clear the text box below to return to the internal query generation.</value>
AAD6AQAA4AEAAMABAACAAQAAgAEAAMBBAADAYQAAjGEAAIRhAADc+wAA3/8AAA==
</value>
</data>
- <metadata name="File_Save.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>664, 15</value>
- </metadata>
- <metadata name="openPreset.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>310, 54</value>
- </metadata>
- <metadata name="File_ChapterImport.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>423, 54</value>
- </metadata>
</root> \ No newline at end of file