diff --git a/CUEControls/BNComboBox.cs b/CUEControls/BNComboBox.cs index ce10fec..3b1995b 100644 --- a/CUEControls/BNComboBox.cs +++ b/CUEControls/BNComboBox.cs @@ -508,14 +508,14 @@ namespace BBBNOVA { //System.Diagnostics.Trace.WriteLine(string.Format("OnSelectedValueChanged({0}=>{1})", Text, _listBox.Text)); - OnSelectedIndexChanged(e); - //this.SelectedIndex = _listBox.SelectedIndex; //this.Invalidate(true); Text = _listBox.SelectedValue != null ? _listBox.GetItemText(_listBox.SelectedValue) : ""; + OnSelectedIndexChanged(e); + base.OnSelectedValueChanged(e); } diff --git a/CUERipper/frmCUERipper.Designer.cs b/CUERipper/frmCUERipper.Designer.cs index 9adc442..8306772 100644 --- a/CUERipper/frmCUERipper.Designer.cs +++ b/CUERipper/frmCUERipper.Designer.cs @@ -49,14 +49,13 @@ namespace CUERipper this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.numericWriteOffset = new System.Windows.Forms.NumericUpDown(); this.lblWriteOffset = new System.Windows.Forms.Label(); - this.radioButtonAudioLossy = new System.Windows.Forms.RadioButton(); - this.radioButtonAudioHybrid = new System.Windows.Forms.RadioButton(); - this.radioButtonAudioLossless = new System.Windows.Forms.RadioButton(); this.checkBoxEACMode = new System.Windows.Forms.CheckBox(); this.groupBoxSettings = new System.Windows.Forms.GroupBox(); + this.bnComboBoxLosslessOrNot = new BBBNOVA.BNComboBox(); + this.losslessOrNotBindingSource = new System.Windows.Forms.BindingSource(this.components); + this.bindingSourceCR = new System.Windows.Forms.BindingSource(this.components); this.bnComboBoxEncoder = new BBBNOVA.BNComboBox(); this.encodersBindingSource = new System.Windows.Forms.BindingSource(this.components); - this.bindingSourceCR = new System.Windows.Forms.BindingSource(this.components); this.labelSecureMode = new System.Windows.Forms.Label(); this.bnComboBoxFormat = new BBBNOVA.BNComboBox(); this.formatsBindingSource = new System.Windows.Forms.BindingSource(this.components); @@ -87,8 +86,9 @@ namespace CUERipper this.contextMenuStripRelease.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericWriteOffset)).BeginInit(); this.groupBoxSettings.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.encodersBindingSource)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.losslessOrNotBindingSource)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.bindingSourceCR)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.encodersBindingSource)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.formatsBindingSource)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.cUEStylesBindingSource)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.trackBarEncoderMode)).BeginInit(); @@ -252,30 +252,6 @@ namespace CUERipper resources.ApplyResources(this.lblWriteOffset, "lblWriteOffset"); this.lblWriteOffset.Name = "lblWriteOffset"; // - // radioButtonAudioLossy - // - resources.ApplyResources(this.radioButtonAudioLossy, "radioButtonAudioLossy"); - this.radioButtonAudioLossy.Name = "radioButtonAudioLossy"; - this.radioButtonAudioLossy.TabStop = true; - this.radioButtonAudioLossy.UseVisualStyleBackColor = true; - this.radioButtonAudioLossy.CheckedChanged += new System.EventHandler(this.radioButtonAudioLossless_CheckedChanged); - // - // radioButtonAudioHybrid - // - resources.ApplyResources(this.radioButtonAudioHybrid, "radioButtonAudioHybrid"); - this.radioButtonAudioHybrid.Name = "radioButtonAudioHybrid"; - this.radioButtonAudioHybrid.TabStop = true; - this.radioButtonAudioHybrid.UseVisualStyleBackColor = true; - this.radioButtonAudioHybrid.CheckedChanged += new System.EventHandler(this.radioButtonAudioLossless_CheckedChanged); - // - // radioButtonAudioLossless - // - resources.ApplyResources(this.radioButtonAudioLossless, "radioButtonAudioLossless"); - this.radioButtonAudioLossless.Name = "radioButtonAudioLossless"; - this.radioButtonAudioLossless.TabStop = true; - this.radioButtonAudioLossless.UseVisualStyleBackColor = true; - this.radioButtonAudioLossless.CheckedChanged += new System.EventHandler(this.radioButtonAudioLossless_CheckedChanged); - // // checkBoxEACMode // resources.ApplyResources(this.checkBoxEACMode, "checkBoxEACMode"); @@ -285,6 +261,7 @@ namespace CUERipper // // groupBoxSettings // + this.groupBoxSettings.Controls.Add(this.bnComboBoxLosslessOrNot); this.groupBoxSettings.Controls.Add(this.bnComboBoxEncoder); this.groupBoxSettings.Controls.Add(this.labelSecureMode); this.groupBoxSettings.Controls.Add(this.bnComboBoxFormat); @@ -294,16 +271,47 @@ namespace CUERipper this.groupBoxSettings.Controls.Add(this.labelEncoderMode); this.groupBoxSettings.Controls.Add(this.trackBarEncoderMode); this.groupBoxSettings.Controls.Add(this.trackBarSecureMode); - this.groupBoxSettings.Controls.Add(this.radioButtonAudioLossless); this.groupBoxSettings.Controls.Add(this.lblWriteOffset); this.groupBoxSettings.Controls.Add(this.checkBoxEACMode); - this.groupBoxSettings.Controls.Add(this.radioButtonAudioLossy); - this.groupBoxSettings.Controls.Add(this.radioButtonAudioHybrid); this.groupBoxSettings.Controls.Add(this.numericWriteOffset); resources.ApplyResources(this.groupBoxSettings, "groupBoxSettings"); this.groupBoxSettings.Name = "groupBoxSettings"; this.groupBoxSettings.TabStop = false; // + // bnComboBoxLosslessOrNot + // + this.bnComboBoxLosslessOrNot.BackColor = System.Drawing.SystemColors.ControlDark; + this.bnComboBoxLosslessOrNot.Border = System.Windows.Forms.BorderStyle.FixedSingle; + this.bnComboBoxLosslessOrNot.Color1 = System.Drawing.SystemColors.Control; + this.bnComboBoxLosslessOrNot.Color2 = System.Drawing.SystemColors.ControlDark; + this.bnComboBoxLosslessOrNot.Color3 = System.Drawing.Color.Maroon; + this.bnComboBoxLosslessOrNot.Color4 = System.Drawing.SystemColors.ControlDarkDark; + this.bnComboBoxLosslessOrNot.DataSource = this.losslessOrNotBindingSource; + this.bnComboBoxLosslessOrNot.DropDownHeight = 200; + this.bnComboBoxLosslessOrNot.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.bnComboBoxLosslessOrNot.DropDownWidth = 80; + this.bnComboBoxLosslessOrNot.ForeColor = System.Drawing.SystemColors.ControlText; + this.bnComboBoxLosslessOrNot.ImageList = null; + this.bnComboBoxLosslessOrNot.IsDroppedDown = false; + resources.ApplyResources(this.bnComboBoxLosslessOrNot, "bnComboBoxLosslessOrNot"); + this.bnComboBoxLosslessOrNot.MaxDropDownItems = 8; + this.bnComboBoxLosslessOrNot.MinimumSize = new System.Drawing.Size(40, 21); + this.bnComboBoxLosslessOrNot.Name = "bnComboBoxLosslessOrNot"; + this.bnComboBoxLosslessOrNot.Radius = ((BBBNOVA.BNRadius)(resources.GetObject("bnComboBoxLosslessOrNot.Radius"))); + this.bnComboBoxLosslessOrNot.SelectedIndex = -1; + this.bnComboBoxLosslessOrNot.SelectedItem = null; + this.bnComboBoxLosslessOrNot.Sorted = false; + this.bnComboBoxLosslessOrNot.SelectedIndexChanged += new System.EventHandler(this.bnComboBoxLosslessOrNot_SelectedIndexChanged); + // + // losslessOrNotBindingSource + // + this.losslessOrNotBindingSource.DataMember = "LosslessOrNot"; + this.losslessOrNotBindingSource.DataSource = this.bindingSourceCR; + // + // bindingSourceCR + // + this.bindingSourceCR.DataSource = typeof(CUERipper.frmCUERipper); + // // bnComboBoxEncoder // this.bnComboBoxEncoder.BackColor = System.Drawing.SystemColors.ControlDark; @@ -315,7 +323,7 @@ namespace CUERipper this.bnComboBoxEncoder.DataSource = this.encodersBindingSource; this.bnComboBoxEncoder.DropDownHeight = 200; this.bnComboBoxEncoder.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.bnComboBoxEncoder.DropDownWidth = 114; + this.bnComboBoxEncoder.DropDownWidth = 80; this.bnComboBoxEncoder.ForeColor = System.Drawing.SystemColors.ControlText; this.bnComboBoxEncoder.ImageList = null; this.bnComboBoxEncoder.IsDroppedDown = false; @@ -334,10 +342,6 @@ namespace CUERipper this.encodersBindingSource.DataMember = "Encoders"; this.encodersBindingSource.DataSource = this.bindingSourceCR; // - // bindingSourceCR - // - this.bindingSourceCR.DataSource = typeof(CUERipper.frmCUERipper); - // // labelSecureMode // resources.ApplyResources(this.labelSecureMode, "labelSecureMode"); @@ -354,7 +358,7 @@ namespace CUERipper this.bnComboBoxFormat.DataSource = this.formatsBindingSource; this.bnComboBoxFormat.DropDownHeight = 200; this.bnComboBoxFormat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.bnComboBoxFormat.DropDownWidth = 114; + this.bnComboBoxFormat.DropDownWidth = 80; this.bnComboBoxFormat.ForeColor = System.Drawing.SystemColors.ControlText; this.bnComboBoxFormat.ImageKeyMember = "DotExtension"; this.bnComboBoxFormat.ImageList = null; @@ -390,7 +394,7 @@ namespace CUERipper this.bnComboBoxImage.DataSource = this.cUEStylesBindingSource; this.bnComboBoxImage.DropDownHeight = 200; this.bnComboBoxImage.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.bnComboBoxImage.DropDownWidth = 93; + this.bnComboBoxImage.DropDownWidth = 80; this.bnComboBoxImage.ForeColor = System.Drawing.SystemColors.ControlText; this.bnComboBoxImage.ImageList = null; this.bnComboBoxImage.IsDroppedDown = false; @@ -629,8 +633,9 @@ namespace CUERipper ((System.ComponentModel.ISupportInitialize)(this.numericWriteOffset)).EndInit(); this.groupBoxSettings.ResumeLayout(false); this.groupBoxSettings.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.encodersBindingSource)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.losslessOrNotBindingSource)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.bindingSourceCR)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.encodersBindingSource)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.formatsBindingSource)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.cUEStylesBindingSource)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.trackBarEncoderMode)).EndInit(); @@ -662,9 +667,6 @@ namespace CUERipper private System.Windows.Forms.ToolStripStatusLabel toolStripStatusAr; private System.Windows.Forms.NumericUpDown numericWriteOffset; private System.Windows.Forms.Label lblWriteOffset; - private System.Windows.Forms.RadioButton radioButtonAudioLossy; - private System.Windows.Forms.RadioButton radioButtonAudioHybrid; - private System.Windows.Forms.RadioButton radioButtonAudioLossless; private System.Windows.Forms.CheckBox checkBoxEACMode; private System.Windows.Forms.GroupBox groupBoxSettings; private System.Windows.Forms.ToolStripStatusLabel toolStripStatusCTDB; @@ -697,6 +699,8 @@ namespace CUERipper private System.Windows.Forms.BindingSource formatsBindingSource; private BBBNOVA.BNComboBox bnComboBoxEncoder; private System.Windows.Forms.BindingSource encodersBindingSource; + private BBBNOVA.BNComboBox bnComboBoxLosslessOrNot; + private System.Windows.Forms.BindingSource losslessOrNotBindingSource; } } diff --git a/CUERipper/frmCUERipper.cs b/CUERipper/frmCUERipper.cs index 9aedf3f..ef3dbab 100644 --- a/CUERipper/frmCUERipper.cs +++ b/CUERipper/frmCUERipper.cs @@ -62,6 +62,7 @@ namespace CUERipper }; private BindingList cueStyles = new BindingList { "image", "tracks" }; + private BindingList losslessOrNot = new BindingList { "lossless", "lossy" }; private BindingList releases = new BindingList(); private BindingList drives = new BindingList(); private BindingList formats = new BindingList(); @@ -75,6 +76,14 @@ namespace CUERipper } } + public BindingList LosslessOrNot + { + get + { + return losslessOrNot; + } + } + public BindingList Releases { get @@ -781,23 +790,22 @@ namespace CUERipper { get { - return - radioButtonAudioHybrid.Checked ? AudioEncoderType.Hybrid : - radioButtonAudioLossy.Checked ? AudioEncoderType.Lossy : - AudioEncoderType.Lossless; + return bnComboBoxLosslessOrNot.Text == "lossy" ? AudioEncoderType.Lossy + : bnComboBoxLosslessOrNot.Text == "hybrid" ? AudioEncoderType.Hybrid + : AudioEncoderType.Lossless; } set { switch (value) { case AudioEncoderType.Hybrid: - radioButtonAudioHybrid.Checked = true; + bnComboBoxLosslessOrNot.SelectedItem = "hybrid"; break; case AudioEncoderType.Lossy: - radioButtonAudioLossy.Checked = true; + bnComboBoxLosslessOrNot.SelectedItem = "lossy"; break; default: - radioButtonAudioLossless.Checked = true; + bnComboBoxLosslessOrNot.SelectedItem = "lossless"; break; } } @@ -808,50 +816,6 @@ namespace CUERipper _config.createEACLOG = checkBoxEACMode.Checked; } - private void radioButtonAudioLossless_CheckedChanged(object sender, EventArgs e) - { - if (sender is RadioButton && !((RadioButton)sender).Checked) - return; - formats.Clear(); - formats.RaiseListChangedEvents = false; - foreach (KeyValuePair format in _config.formats) - { - if (SelectedOutputAudioType == AudioEncoderType.Lossless && !format.Value.allowLossless) - continue; - if (SelectedOutputAudioType == AudioEncoderType.Hybrid) // && format.Key != "wv") TODO!!!!! - continue; - if (SelectedOutputAudioType == AudioEncoderType.Lossy && !format.Value.allowLossy) - continue; - formats.Add(new FormatInfo(format.Value, false)); - } - foreach (KeyValuePair format in _config.formats) - { - if (!format.Value.allowLossyWAV) - continue; - if (SelectedOutputAudioType == AudioEncoderType.Lossless) - continue; - if (SelectedOutputAudioType == AudioEncoderType.NoAudio) - continue; - formats.Add(new FormatInfo(format.Value, true)); - } - string select = null; - switch (SelectedOutputAudioType) - { - case AudioEncoderType.Lossless: - select = _defaultLosslessFormat; - break; - case AudioEncoderType.Lossy: - select = _defaultLossyFormat; - break; - case AudioEncoderType.Hybrid: - select = _defaultHybridFormat; - break; - } - formats.RaiseListChangedEvents = true; - formats.ResetBindings(); - SelectedOutputAudioFormat = select; - } - private void comboBoxEncoder_SelectedIndexChanged(object sender, EventArgs e) { if (SelectedOutputAudioFormat == null) @@ -1007,6 +971,49 @@ namespace CUERipper comboBoxOutputFormat_TextUpdate(sender, e); } + + private void bnComboBoxLosslessOrNot_SelectedIndexChanged(object sender, EventArgs e) + { + if (bnComboBoxLosslessOrNot.SelectedItem == null) return; + formats.Clear(); + formats.RaiseListChangedEvents = false; + foreach (KeyValuePair format in _config.formats) + { + if (SelectedOutputAudioType == AudioEncoderType.Lossless && !format.Value.allowLossless) + continue; + if (SelectedOutputAudioType == AudioEncoderType.Hybrid) // && format.Key != "wv") TODO!!!!! + continue; + if (SelectedOutputAudioType == AudioEncoderType.Lossy && !format.Value.allowLossy) + continue; + formats.Add(new FormatInfo(format.Value, false)); + } + foreach (KeyValuePair format in _config.formats) + { + if (!format.Value.allowLossyWAV) + continue; + if (SelectedOutputAudioType == AudioEncoderType.Lossless) + continue; + if (SelectedOutputAudioType == AudioEncoderType.NoAudio) + continue; + formats.Add(new FormatInfo(format.Value, true)); + } + string select = null; + switch (SelectedOutputAudioType) + { + case AudioEncoderType.Lossless: + select = _defaultLosslessFormat; + break; + case AudioEncoderType.Lossy: + select = _defaultLossyFormat; + break; + case AudioEncoderType.Hybrid: + select = _defaultHybridFormat; + break; + } + formats.RaiseListChangedEvents = true; + formats.ResetBindings(); + SelectedOutputAudioFormat = select; + } } public class StartStop diff --git a/CUERipper/frmCUERipper.resx b/CUERipper/frmCUERipper.resx index 23e2313..45d1860 100644 --- a/CUERipper/frmCUERipper.resx +++ b/CUERipper/frmCUERipper.resx @@ -396,7 +396,7 @@ groupBoxSettings - 14 + 12 True @@ -428,96 +428,6 @@ 10 - - True - - - NoControl - - - 6, 36 - - - 52, 17 - - - 1 - - - Lossy - - - radioButtonAudioLossy - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBoxSettings - - - 12 - - - True - - - NoControl - - - 6, 53 - - - 55, 17 - - - 2 - - - Hybrid - - - radioButtonAudioHybrid - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBoxSettings - - - 13 - - - True - - - NoControl - - - 6, 19 - - - 65, 17 - - - 0 - - - Lossless - - - radioButtonAudioLossless - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBoxSettings - - - 9 - True @@ -548,14 +458,46 @@ 11 - - 451, 456 + + 631, 456 210, 56 + + 6, 19 + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAEJDVUVDb250cm9scywgVmVyc2lvbj0yLjAuNi4wLCBDdWx0dXJl + PW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwFAQAAABBCQkJOT1ZBLkJOUmFkaXVzBAAAAAhfdG9w + TGVmdAlfdG9wUmlnaHQLX2JvdHRvbUxlZnQMX2JvdHRvbVJpZ2h0AAAAAAgICAgCAAAAAgAAAAYAAAAC + AAAAAgAAAAs= + + + + 80, 21 + + + 39 + + + bnComboBoxLosslessOrNot + + + BBBNOVA.BNComboBox, CUEControls, Version=2.0.6.0, Culture=neutral, PublicKeyToken=null + + + groupBoxSettings + + + 0 + + + 451, 456 + - 113, 46 + 92, 46 @@ -566,7 +508,7 @@ - 114, 21 + 80, 21 38 @@ -581,7 +523,7 @@ groupBoxSettings - 0 + 1 NoControl @@ -608,13 +550,13 @@ groupBoxSettings - 1 + 2 279, 456 - 113, 19 + 92, 19 @@ -625,7 +567,7 @@ - 114, 21 + 80, 21 37 @@ -640,7 +582,7 @@ groupBoxSettings - 2 + 3 True @@ -655,7 +597,7 @@ NoControl - 116, 103 + 12, 106 0, 0, 0, 0 @@ -679,13 +621,13 @@ groupBoxSettings - 3 + 4 642, 56 - 6, 89 + 6, 46 @@ -696,7 +638,7 @@ - 93, 21 + 80, 21 34 @@ -711,7 +653,7 @@ groupBoxSettings - 4 + 5 False @@ -723,7 +665,7 @@ NoControl - 198, 103 + 143, 106 0, 0, 0, 0 @@ -750,7 +692,7 @@ groupBoxSettings - 5 + 6 Tahoma, 8.25pt @@ -759,13 +701,13 @@ NoControl - 116, 103 + 12, 106 0, 0, 0, 0 - 111, 15 + 167, 15 31 @@ -786,19 +728,19 @@ groupBoxSettings - 6 + 7 NoControl - 113, 73 + 6, 76 0, 0, 0, 0 - 114, 45 + 166, 45 8 @@ -813,7 +755,7 @@ groupBoxSettings - 7 + 8 NoControl @@ -837,7 +779,7 @@ groupBoxSettings - 8 + 9 6, 332 @@ -1574,10 +1516,10 @@ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - encodersBindingSource + + losslessOrNotBindingSource - + System.Windows.Forms.BindingSource, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @@ -1586,6 +1528,12 @@ System.Windows.Forms.BindingSource, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + encodersBindingSource + + + System.Windows.Forms.BindingSource, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + formatsBindingSource