mirror of
https://github.com/claunia/cuetools.net.git
synced 2025-12-16 18:14:25 +00:00
Unify encoders & decoders tabs in settings
This commit is contained in:
109
CUETools/frmSettings.Designer.cs
generated
109
CUETools/frmSettings.Designer.cs
generated
@@ -148,16 +148,14 @@ namespace JDP
|
|||||||
this.listBoxEncoders = new System.Windows.Forms.ListBox();
|
this.listBoxEncoders = new System.Windows.Forms.ListBox();
|
||||||
this.tabPage11 = new System.Windows.Forms.TabPage();
|
this.tabPage11 = new System.Windows.Forms.TabPage();
|
||||||
this.tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel();
|
this.tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel();
|
||||||
this.listViewDecoders = new System.Windows.Forms.ListView();
|
|
||||||
this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
|
||||||
this.groupBoxExternalDecoder = new System.Windows.Forms.GroupBox();
|
this.groupBoxExternalDecoder = new System.Windows.Forms.GroupBox();
|
||||||
this.textBoxDecoderPath = new System.Windows.Forms.TextBox();
|
this.textBoxDecoderPath = new System.Windows.Forms.TextBox();
|
||||||
this.labelDecoderPath = new System.Windows.Forms.Label();
|
this.labelDecoderPath = new System.Windows.Forms.Label();
|
||||||
this.labelDecoderParameters = new System.Windows.Forms.Label();
|
this.labelDecoderParameters = new System.Windows.Forms.Label();
|
||||||
this.textBoxDecoderParameters = new System.Windows.Forms.TextBox();
|
this.textBoxDecoderParameters = new System.Windows.Forms.TextBox();
|
||||||
this.panel2 = new System.Windows.Forms.Panel();
|
this.panel2 = new System.Windows.Forms.Panel();
|
||||||
this.button2 = new System.Windows.Forms.Button();
|
this.buttonDecoderDelete = new System.Windows.Forms.Button();
|
||||||
this.button1 = new System.Windows.Forms.Button();
|
this.buttonDecoderAdd = new System.Windows.Forms.Button();
|
||||||
this.comboBoxDecoderExtension = new System.Windows.Forms.ComboBox();
|
this.comboBoxDecoderExtension = new System.Windows.Forms.ComboBox();
|
||||||
this.labelDecoderExtension = new System.Windows.Forms.Label();
|
this.labelDecoderExtension = new System.Windows.Forms.Label();
|
||||||
this.tabPage4 = new System.Windows.Forms.TabPage();
|
this.tabPage4 = new System.Windows.Forms.TabPage();
|
||||||
@@ -180,6 +178,10 @@ namespace JDP
|
|||||||
this.labelFormatEncoder = new System.Windows.Forms.Label();
|
this.labelFormatEncoder = new System.Windows.Forms.Label();
|
||||||
this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
this.checkBox1 = new System.Windows.Forms.CheckBox();
|
this.checkBox1 = new System.Windows.Forms.CheckBox();
|
||||||
|
this.label4 = new System.Windows.Forms.Label();
|
||||||
|
this.textBoxDecoderName = new System.Windows.Forms.TextBox();
|
||||||
|
this.bindingSourceDecoders = new System.Windows.Forms.BindingSource(this.components);
|
||||||
|
this.listBoxDecoders = new System.Windows.Forms.ListBox();
|
||||||
btnCancel = new System.Windows.Forms.Button();
|
btnCancel = new System.Windows.Forms.Button();
|
||||||
this.grpGeneral.SuspendLayout();
|
this.grpGeneral.SuspendLayout();
|
||||||
this.groupBox1.SuspendLayout();
|
this.groupBox1.SuspendLayout();
|
||||||
@@ -223,6 +225,7 @@ namespace JDP
|
|||||||
this.tabPage5.SuspendLayout();
|
this.tabPage5.SuspendLayout();
|
||||||
this.groupBoxScriptConditions.SuspendLayout();
|
this.groupBoxScriptConditions.SuspendLayout();
|
||||||
this.tabPage7.SuspendLayout();
|
this.tabPage7.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.bindingSourceDecoders)).BeginInit();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// btnCancel
|
// btnCancel
|
||||||
@@ -1194,40 +1197,18 @@ namespace JDP
|
|||||||
resources.ApplyResources(this.tableLayoutPanel5, "tableLayoutPanel5");
|
resources.ApplyResources(this.tableLayoutPanel5, "tableLayoutPanel5");
|
||||||
this.tableLayoutPanel5.Controls.Add(this.groupBoxExternalDecoder, 1, 1);
|
this.tableLayoutPanel5.Controls.Add(this.groupBoxExternalDecoder, 1, 1);
|
||||||
this.tableLayoutPanel5.Controls.Add(this.panel2, 1, 0);
|
this.tableLayoutPanel5.Controls.Add(this.panel2, 1, 0);
|
||||||
this.tableLayoutPanel5.Controls.Add(this.listViewDecoders, 0, 0);
|
this.tableLayoutPanel5.Controls.Add(this.listBoxDecoders, 0, 0);
|
||||||
this.tableLayoutPanel5.Name = "tableLayoutPanel5";
|
this.tableLayoutPanel5.Name = "tableLayoutPanel5";
|
||||||
//
|
//
|
||||||
// listViewDecoders
|
|
||||||
//
|
|
||||||
this.listViewDecoders.BackColor = System.Drawing.SystemColors.Control;
|
|
||||||
this.listViewDecoders.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
|
||||||
this.listViewDecoders.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
|
|
||||||
this.columnHeader4});
|
|
||||||
this.listViewDecoders.FullRowSelect = true;
|
|
||||||
this.listViewDecoders.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
|
|
||||||
this.listViewDecoders.HideSelection = false;
|
|
||||||
this.listViewDecoders.LabelEdit = true;
|
|
||||||
resources.ApplyResources(this.listViewDecoders, "listViewDecoders");
|
|
||||||
this.listViewDecoders.MultiSelect = false;
|
|
||||||
this.listViewDecoders.Name = "listViewDecoders";
|
|
||||||
this.tableLayoutPanel5.SetRowSpan(this.listViewDecoders, 2);
|
|
||||||
this.listViewDecoders.UseCompatibleStateImageBehavior = false;
|
|
||||||
this.listViewDecoders.View = System.Windows.Forms.View.Details;
|
|
||||||
this.listViewDecoders.AfterLabelEdit += new System.Windows.Forms.LabelEditEventHandler(this.listViewDecoders_AfterLabelEdit);
|
|
||||||
this.listViewDecoders.BeforeLabelEdit += new System.Windows.Forms.LabelEditEventHandler(this.listViewDecoders_BeforeLabelEdit);
|
|
||||||
this.listViewDecoders.ItemSelectionChanged += new System.Windows.Forms.ListViewItemSelectionChangedEventHandler(this.listViewDecoders_ItemSelectionChanged);
|
|
||||||
this.listViewDecoders.KeyDown += new System.Windows.Forms.KeyEventHandler(this.listViewDecoders_KeyDown);
|
|
||||||
//
|
|
||||||
// columnHeader4
|
|
||||||
//
|
|
||||||
resources.ApplyResources(this.columnHeader4, "columnHeader4");
|
|
||||||
//
|
|
||||||
// groupBoxExternalDecoder
|
// groupBoxExternalDecoder
|
||||||
//
|
//
|
||||||
|
this.groupBoxExternalDecoder.Controls.Add(this.label4);
|
||||||
|
this.groupBoxExternalDecoder.Controls.Add(this.textBoxDecoderName);
|
||||||
this.groupBoxExternalDecoder.Controls.Add(this.textBoxDecoderPath);
|
this.groupBoxExternalDecoder.Controls.Add(this.textBoxDecoderPath);
|
||||||
this.groupBoxExternalDecoder.Controls.Add(this.labelDecoderPath);
|
this.groupBoxExternalDecoder.Controls.Add(this.labelDecoderPath);
|
||||||
this.groupBoxExternalDecoder.Controls.Add(this.labelDecoderParameters);
|
this.groupBoxExternalDecoder.Controls.Add(this.labelDecoderParameters);
|
||||||
this.groupBoxExternalDecoder.Controls.Add(this.textBoxDecoderParameters);
|
this.groupBoxExternalDecoder.Controls.Add(this.textBoxDecoderParameters);
|
||||||
|
this.groupBoxExternalDecoder.DataBindings.Add(new System.Windows.Forms.Binding("Visible", this.bindingSourceDecoders, "CanBeDeleted", true));
|
||||||
resources.ApplyResources(this.groupBoxExternalDecoder, "groupBoxExternalDecoder");
|
resources.ApplyResources(this.groupBoxExternalDecoder, "groupBoxExternalDecoder");
|
||||||
this.groupBoxExternalDecoder.Name = "groupBoxExternalDecoder";
|
this.groupBoxExternalDecoder.Name = "groupBoxExternalDecoder";
|
||||||
this.groupBoxExternalDecoder.TabStop = false;
|
this.groupBoxExternalDecoder.TabStop = false;
|
||||||
@@ -1235,6 +1216,7 @@ namespace JDP
|
|||||||
// textBoxDecoderPath
|
// textBoxDecoderPath
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.textBoxDecoderPath, "textBoxDecoderPath");
|
resources.ApplyResources(this.textBoxDecoderPath, "textBoxDecoderPath");
|
||||||
|
this.textBoxDecoderPath.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bindingSourceDecoders, "Path", true));
|
||||||
this.textBoxDecoderPath.Name = "textBoxDecoderPath";
|
this.textBoxDecoderPath.Name = "textBoxDecoderPath";
|
||||||
//
|
//
|
||||||
// labelDecoderPath
|
// labelDecoderPath
|
||||||
@@ -1250,33 +1232,38 @@ namespace JDP
|
|||||||
// textBoxDecoderParameters
|
// textBoxDecoderParameters
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.textBoxDecoderParameters, "textBoxDecoderParameters");
|
resources.ApplyResources(this.textBoxDecoderParameters, "textBoxDecoderParameters");
|
||||||
|
this.textBoxDecoderParameters.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bindingSourceDecoders, "Parameters", true));
|
||||||
this.textBoxDecoderParameters.Name = "textBoxDecoderParameters";
|
this.textBoxDecoderParameters.Name = "textBoxDecoderParameters";
|
||||||
//
|
//
|
||||||
// panel2
|
// panel2
|
||||||
//
|
//
|
||||||
this.panel2.Controls.Add(this.button2);
|
this.panel2.Controls.Add(this.buttonDecoderDelete);
|
||||||
this.panel2.Controls.Add(this.button1);
|
this.panel2.Controls.Add(this.buttonDecoderAdd);
|
||||||
this.panel2.Controls.Add(this.comboBoxDecoderExtension);
|
this.panel2.Controls.Add(this.comboBoxDecoderExtension);
|
||||||
this.panel2.Controls.Add(this.labelDecoderExtension);
|
this.panel2.Controls.Add(this.labelDecoderExtension);
|
||||||
resources.ApplyResources(this.panel2, "panel2");
|
resources.ApplyResources(this.panel2, "panel2");
|
||||||
this.panel2.Name = "panel2";
|
this.panel2.Name = "panel2";
|
||||||
//
|
//
|
||||||
// button2
|
// buttonDecoderDelete
|
||||||
//
|
//
|
||||||
this.button2.DataBindings.Add(new System.Windows.Forms.Binding("Enabled", this.encodersBindingSource, "CanBeDeleted", true));
|
this.buttonDecoderDelete.DataBindings.Add(new System.Windows.Forms.Binding("Enabled", this.bindingSourceDecoders, "CanBeDeleted", true));
|
||||||
resources.ApplyResources(this.button2, "button2");
|
resources.ApplyResources(this.buttonDecoderDelete, "buttonDecoderDelete");
|
||||||
this.button2.Name = "button2";
|
this.buttonDecoderDelete.Name = "buttonDecoderDelete";
|
||||||
this.button2.UseVisualStyleBackColor = true;
|
this.buttonDecoderDelete.UseVisualStyleBackColor = true;
|
||||||
|
this.buttonDecoderDelete.Click += new System.EventHandler(this.buttonDecoderDelete_Click);
|
||||||
//
|
//
|
||||||
// button1
|
// buttonDecoderAdd
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.button1, "button1");
|
resources.ApplyResources(this.buttonDecoderAdd, "buttonDecoderAdd");
|
||||||
this.button1.Name = "button1";
|
this.buttonDecoderAdd.Name = "buttonDecoderAdd";
|
||||||
this.button1.UseVisualStyleBackColor = true;
|
this.buttonDecoderAdd.UseVisualStyleBackColor = true;
|
||||||
|
this.buttonDecoderAdd.Click += new System.EventHandler(this.buttonDecoderAdd_Click);
|
||||||
//
|
//
|
||||||
// comboBoxDecoderExtension
|
// comboBoxDecoderExtension
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.comboBoxDecoderExtension, "comboBoxDecoderExtension");
|
resources.ApplyResources(this.comboBoxDecoderExtension, "comboBoxDecoderExtension");
|
||||||
|
this.comboBoxDecoderExtension.DataBindings.Add(new System.Windows.Forms.Binding("SelectedItem", this.bindingSourceDecoders, "Extension", true));
|
||||||
|
this.comboBoxDecoderExtension.DataBindings.Add(new System.Windows.Forms.Binding("Enabled", this.bindingSourceDecoders, "CanBeDeleted", true));
|
||||||
this.comboBoxDecoderExtension.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
this.comboBoxDecoderExtension.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
this.comboBoxDecoderExtension.FormattingEnabled = true;
|
this.comboBoxDecoderExtension.FormattingEnabled = true;
|
||||||
this.comboBoxDecoderExtension.Name = "comboBoxDecoderExtension";
|
this.comboBoxDecoderExtension.Name = "comboBoxDecoderExtension";
|
||||||
@@ -1449,6 +1436,35 @@ namespace JDP
|
|||||||
this.checkBox1.Name = "checkBox1";
|
this.checkBox1.Name = "checkBox1";
|
||||||
this.checkBox1.UseVisualStyleBackColor = true;
|
this.checkBox1.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
|
// label4
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.label4, "label4");
|
||||||
|
this.label4.Name = "label4";
|
||||||
|
//
|
||||||
|
// textBoxDecoderName
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.textBoxDecoderName, "textBoxDecoderName");
|
||||||
|
this.textBoxDecoderName.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bindingSourceDecoders, "Name", true));
|
||||||
|
this.textBoxDecoderName.Name = "textBoxDecoderName";
|
||||||
|
this.toolTip1.SetToolTip(this.textBoxDecoderName, resources.GetString("textBoxDecoderName.ToolTip"));
|
||||||
|
//
|
||||||
|
// bindingSourceDecoders
|
||||||
|
//
|
||||||
|
this.bindingSourceDecoders.DataMember = "Decoders";
|
||||||
|
this.bindingSourceDecoders.DataSource = this.cUEConfigBindingSource;
|
||||||
|
this.bindingSourceDecoders.CurrentItemChanged += new System.EventHandler(this.bindingSourceDecoders_CurrentItemChanged);
|
||||||
|
//
|
||||||
|
// listBoxDecoders
|
||||||
|
//
|
||||||
|
this.listBoxDecoders.BackColor = System.Drawing.SystemColors.Control;
|
||||||
|
this.listBoxDecoders.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||||
|
this.listBoxDecoders.DataSource = this.bindingSourceDecoders;
|
||||||
|
this.listBoxDecoders.DisplayMember = "FullName";
|
||||||
|
resources.ApplyResources(this.listBoxDecoders, "listBoxDecoders");
|
||||||
|
this.listBoxDecoders.FormattingEnabled = true;
|
||||||
|
this.listBoxDecoders.Name = "listBoxDecoders";
|
||||||
|
this.tableLayoutPanel5.SetRowSpan(this.listBoxDecoders, 2);
|
||||||
|
//
|
||||||
// frmSettings
|
// frmSettings
|
||||||
//
|
//
|
||||||
this.AcceptButton = this.btnOK;
|
this.AcceptButton = this.btnOK;
|
||||||
@@ -1525,6 +1541,7 @@ namespace JDP
|
|||||||
this.tabPage5.ResumeLayout(false);
|
this.tabPage5.ResumeLayout(false);
|
||||||
this.groupBoxScriptConditions.ResumeLayout(false);
|
this.groupBoxScriptConditions.ResumeLayout(false);
|
||||||
this.tabPage7.ResumeLayout(false);
|
this.tabPage7.ResumeLayout(false);
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.bindingSourceDecoders)).EndInit();
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1601,8 +1618,6 @@ namespace JDP
|
|||||||
private System.Windows.Forms.Label labelFormatDecoder;
|
private System.Windows.Forms.Label labelFormatDecoder;
|
||||||
private System.Windows.Forms.ComboBox comboFormatLosslessEncoder;
|
private System.Windows.Forms.ComboBox comboFormatLosslessEncoder;
|
||||||
private System.Windows.Forms.Label labelFormatEncoder;
|
private System.Windows.Forms.Label labelFormatEncoder;
|
||||||
private System.Windows.Forms.ListView listViewDecoders;
|
|
||||||
private System.Windows.Forms.ColumnHeader columnHeader4;
|
|
||||||
private System.Windows.Forms.ComboBox comboBoxEncoderExtension;
|
private System.Windows.Forms.ComboBox comboBoxEncoderExtension;
|
||||||
private System.Windows.Forms.GroupBox groupBoxExternalDecoder;
|
private System.Windows.Forms.GroupBox groupBoxExternalDecoder;
|
||||||
private System.Windows.Forms.ComboBox comboBoxDecoderExtension;
|
private System.Windows.Forms.ComboBox comboBoxDecoderExtension;
|
||||||
@@ -1678,8 +1693,12 @@ namespace JDP
|
|||||||
private System.Windows.Forms.Panel panel3;
|
private System.Windows.Forms.Panel panel3;
|
||||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel5;
|
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel5;
|
||||||
private System.Windows.Forms.Panel panel2;
|
private System.Windows.Forms.Panel panel2;
|
||||||
private System.Windows.Forms.Button button2;
|
private System.Windows.Forms.Button buttonDecoderDelete;
|
||||||
private System.Windows.Forms.Button button1;
|
private System.Windows.Forms.Button buttonDecoderAdd;
|
||||||
|
private System.Windows.Forms.Label label4;
|
||||||
|
private System.Windows.Forms.TextBox textBoxDecoderName;
|
||||||
|
private System.Windows.Forms.BindingSource bindingSourceDecoders;
|
||||||
|
private System.Windows.Forms.ListBox listBoxDecoders;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -116,14 +116,6 @@ namespace JDP
|
|||||||
if (comboLanguage.SelectedItem == null)
|
if (comboLanguage.SelectedItem == null)
|
||||||
comboLanguage.SelectedItem = comboLanguage.Items[0];
|
comboLanguage.SelectedItem = comboLanguage.Items[0];
|
||||||
|
|
||||||
foreach (var decoder in _config.decoders)
|
|
||||||
if (decoder.path != null)
|
|
||||||
{
|
|
||||||
ListViewItem item = new ListViewItem(decoder.Name);
|
|
||||||
item.Tag = decoder;
|
|
||||||
listViewDecoders.Items.Add(item);
|
|
||||||
}
|
|
||||||
//listViewDecoders.Items[0].Selected = true;
|
|
||||||
listViewFormats.SmallImageList = m_icon_mgr.ImageList;
|
listViewFormats.SmallImageList = m_icon_mgr.ImageList;
|
||||||
labelEncoderExtension.ImageList = m_icon_mgr.ImageList;
|
labelEncoderExtension.ImageList = m_icon_mgr.ImageList;
|
||||||
labelDecoderExtension.ImageList = m_icon_mgr.ImageList;
|
labelDecoderExtension.ImageList = m_icon_mgr.ImageList;
|
||||||
@@ -186,8 +178,6 @@ namespace JDP
|
|||||||
{
|
{
|
||||||
if (listViewFormats.SelectedIndices.Count > 0)
|
if (listViewFormats.SelectedIndices.Count > 0)
|
||||||
listViewFormats.Items[listViewFormats.SelectedIndices[0]].Selected = false;
|
listViewFormats.Items[listViewFormats.SelectedIndices[0]].Selected = false;
|
||||||
if (listViewDecoders.SelectedIndices.Count > 0)
|
|
||||||
listViewDecoders.Items[listViewDecoders.SelectedIndices[0]].Selected = false;
|
|
||||||
if (listViewScripts.SelectedItems.Count > 0)
|
if (listViewScripts.SelectedItems.Count > 0)
|
||||||
listViewScripts.SelectedItems[0].Selected = false;
|
listViewScripts.SelectedItems[0].Selected = false;
|
||||||
|
|
||||||
@@ -298,8 +288,6 @@ namespace JDP
|
|||||||
{
|
{
|
||||||
if (listViewFormats.SelectedItems.Count > 0)
|
if (listViewFormats.SelectedItems.Count > 0)
|
||||||
listViewFormats.SelectedItems[0].Selected = false;
|
listViewFormats.SelectedItems[0].Selected = false;
|
||||||
if (listViewDecoders.SelectedItems.Count > 0)
|
|
||||||
listViewDecoders.SelectedItems[0].Selected = false;
|
|
||||||
if (listViewScripts.SelectedItems.Count > 0)
|
if (listViewScripts.SelectedItems.Count > 0)
|
||||||
listViewScripts.SelectedItems[0].Selected = false;
|
listViewScripts.SelectedItems[0].Selected = false;
|
||||||
}
|
}
|
||||||
@@ -375,15 +363,7 @@ namespace JDP
|
|||||||
if (decoder.extension == format.extension)
|
if (decoder.extension == format.extension)
|
||||||
decodersToRemove.Add(decoder);
|
decodersToRemove.Add(decoder);
|
||||||
foreach (var decoder in decodersToRemove)
|
foreach (var decoder in decodersToRemove)
|
||||||
{
|
|
||||||
_config.decoders.Remove(decoder);
|
_config.decoders.Remove(decoder);
|
||||||
foreach (ListViewItem item in listViewDecoders.Items)
|
|
||||||
if (item.Tag == decoder)
|
|
||||||
{
|
|
||||||
item.Remove();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var encodersToRemove = new List<CUEToolsUDC>();
|
var encodersToRemove = new List<CUEToolsUDC>();
|
||||||
foreach (var encoder in _config.encoders)
|
foreach (var encoder in _config.encoders)
|
||||||
if (encoder.extension == format.extension)
|
if (encoder.extension == format.extension)
|
||||||
@@ -530,102 +510,46 @@ namespace JDP
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void listViewDecoders_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
|
|
||||||
|
private void bindingSourceDecoders_CurrentItemChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (e.IsSelected)
|
var decoder = bindingSourceDecoders.Current as CUEToolsUDC;
|
||||||
{
|
if (decoder == null)
|
||||||
CUEToolsUDC decoder = (CUEToolsUDC)e.Item.Tag;
|
{
|
||||||
if (decoder == null) return;
|
labelDecoderExtension.Visible =
|
||||||
comboBoxDecoderExtension.SelectedItem = decoder.extension;
|
comboBoxDecoderExtension.Visible = false;
|
||||||
comboBoxDecoderExtension.Visible = true;
|
}
|
||||||
labelDecoderExtension.Visible = true;
|
else
|
||||||
if (decoder.path != null)
|
{
|
||||||
{
|
//CUEToolsFormat format = _config.formats[decoder.extension]; // _config.formats.TryGetValue(encoder.extension, out format)
|
||||||
comboBoxDecoderExtension.Enabled = true;
|
labelDecoderExtension.Visible =
|
||||||
groupBoxExternalDecoder.Visible = true;
|
comboBoxDecoderExtension.Visible = true;
|
||||||
textBoxDecoderPath.Text = decoder.path;
|
groupBoxExternalDecoder.Visible = decoder.CanBeDeleted;
|
||||||
textBoxDecoderParameters.Text = decoder.parameters;
|
foreach (KeyValuePair<string, CUEToolsFormat> fmtEntry in _config.formats)
|
||||||
}
|
{
|
||||||
else
|
CUEToolsFormat fmt = fmtEntry.Value;
|
||||||
{
|
if (fmt.decoder == decoder && fmt.extension != decoder.extension)
|
||||||
comboBoxDecoderExtension.Enabled = false;
|
fmt.decoder = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
{
|
|
||||||
CUEToolsUDC decoder = (CUEToolsUDC)e.Item.Tag;
|
|
||||||
if (decoder == null) return;
|
|
||||||
|
|
||||||
if (decoder.path != null)
|
private void listViewDecoders_KeyDown(object sender, KeyEventArgs e)
|
||||||
{
|
{
|
||||||
decoder.path = textBoxDecoderPath.Text;
|
switch (e.KeyCode)
|
||||||
decoder.parameters = textBoxDecoderParameters.Text;
|
{
|
||||||
if (decoder.extension != (string)comboBoxDecoderExtension.SelectedItem)
|
case Keys.Insert:
|
||||||
{
|
{
|
||||||
if (listViewFormats.SelectedItems.Count > 0)
|
buttonDecoderAdd_Click(sender, e);
|
||||||
listViewFormats.SelectedItems[0].Selected = false;
|
break;
|
||||||
CUEToolsFormat format;
|
}
|
||||||
if (_config.formats.TryGetValue(decoder.extension, out format) && format.decoder == decoder)
|
case Keys.Delete:
|
||||||
format.decoder = null;
|
{
|
||||||
decoder.extension = (string)comboBoxDecoderExtension.SelectedItem;
|
buttonDecoderDelete_Click(sender, e);
|
||||||
}
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
comboBoxDecoderExtension.Visible = false;
|
}
|
||||||
labelDecoderExtension.Visible = false;
|
|
||||||
groupBoxExternalDecoder.Visible = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void listViewDecoders_AfterLabelEdit(object sender, LabelEditEventArgs e)
|
|
||||||
{
|
|
||||||
if (e.Label == null)
|
|
||||||
{
|
|
||||||
e.CancelEdit = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var decoder = listViewDecoders.Items[e.Item].Tag as CUEToolsUDC;
|
|
||||||
if (listViewFormats.SelectedItems.Count > 0)
|
|
||||||
listViewFormats.SelectedItems[0].Selected = false;
|
|
||||||
decoder.name = e.Label;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void listViewDecoders_BeforeLabelEdit(object sender, LabelEditEventArgs e)
|
|
||||||
{
|
|
||||||
CUEToolsUDC decoder = (CUEToolsUDC)listViewDecoders.Items[e.Item].Tag;
|
|
||||||
if (decoder.path == null)
|
|
||||||
e.CancelEdit = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void listViewDecoders_KeyDown(object sender, KeyEventArgs e)
|
|
||||||
{
|
|
||||||
switch (e.KeyCode)
|
|
||||||
{
|
|
||||||
case Keys.Insert:
|
|
||||||
{
|
|
||||||
var decoder = new CUEToolsUDC("new", "wav", true, "", "", "", "");
|
|
||||||
_config.decoders.Add(decoder);
|
|
||||||
ListViewItem item = new ListViewItem(decoder.name);
|
|
||||||
item.Tag = decoder;
|
|
||||||
listViewDecoders.Items.Add(item);
|
|
||||||
item.BeginEdit();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case Keys.Delete:
|
|
||||||
{
|
|
||||||
if (listViewDecoders.SelectedItems.Count <= 0)
|
|
||||||
return;
|
|
||||||
CUEToolsUDC decoder = listViewDecoders.SelectedItems[0].Tag as CUEToolsUDC;
|
|
||||||
if (decoder.path == null)
|
|
||||||
return;
|
|
||||||
if (_config.formats[decoder.extension].decoder == decoder)
|
|
||||||
_config.formats[decoder.extension].decoder = null;
|
|
||||||
_config.decoders.Remove(decoder);
|
|
||||||
listViewDecoders.Items.Remove(listViewDecoders.SelectedItems[0]);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void comboBoxDecoderExtension_SelectedIndexChanged(object sender, EventArgs e)
|
private void comboBoxDecoderExtension_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
@@ -813,6 +737,21 @@ namespace JDP
|
|||||||
if (_config.formats[encoder.extension].encoderLossy == encoder)
|
if (_config.formats[encoder.extension].encoderLossy == encoder)
|
||||||
_config.formats[encoder.extension].encoderLossy = null;
|
_config.formats[encoder.extension].encoderLossy = null;
|
||||||
encodersBindingSource.RemoveCurrent();
|
encodersBindingSource.RemoveCurrent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void buttonDecoderAdd_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
bindingSourceDecoders.AddNew();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buttonDecoderDelete_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var decoder = bindingSourceDecoders.Current as CUEToolsUDC;
|
||||||
|
if (decoder == null || !decoder.CanBeDeleted)
|
||||||
|
return;
|
||||||
|
if (_config.formats[decoder.extension].decoder == decoder)
|
||||||
|
_config.formats[decoder.extension].decoder = null;
|
||||||
|
bindingSourceDecoders.RemoveCurrent();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user