* CUERipper: was still sometimes locking drives it didn't need to

* ArCueDotNet: don't search for cover art
* 'Silent track' diagnostics in AR log
* LAME.dll: settings were not used
* libwavpack: settings were not used (MD5Sum & extra mode)
* workarounds for various Mono bugs
* Path formatting: %discnumber% produces two-digit numbers if %totaldiscs% > 9
* Overwrite dialog: list files, 'remember the choice' option
* Doesn't abort on broken Artwork files
* Better locates files in some complicated cases, e.g. when only some tracks have tracknumber tags
* Folder browser now sorts contents, because OS didn't do it when browsing external drives etc
This commit is contained in:
chudov
2010-06-11 17:54:37 +00:00
parent 769a85f827
commit 64ddb2cf31
23 changed files with 2483 additions and 999 deletions

View File

@@ -0,0 +1,80 @@
using CUETools.Processor;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace CUETools.TestCodecs
{
/// <summary>
///This is a test class for FileGroupInfoTest and is intended
///to contain all FileGroupInfoTest Unit Tests
///</summary>
[TestClass()]
public class FileGroupInfoTest
{
private TestContext testContextInstance;
/// <summary>
///Gets or sets the test context which provides
///information about and functionality for the current test run.
///</summary>
public TestContext TestContext
{
get
{
return testContextInstance;
}
set
{
testContextInstance = value;
}
}
#region Additional test attributes
//
//You can use the following additional attributes as you write your tests:
//
//Use ClassInitialize to run code before running the first test in the class
//[ClassInitialize()]
//public static void MyClassInitialize(TestContext testContext)
//{
//}
//
//Use ClassCleanup to run code after all tests in a class have run
//[ClassCleanup()]
//public static void MyClassCleanup()
//{
//}
//
//Use TestInitialize to run code before running each test
//[TestInitialize()]
//public void MyTestInitialize()
//{
//}
//
//Use TestCleanup to run code after each test has run
//[TestCleanup()]
//public void MyTestCleanup()
//{
//}
//
#endregion
/// <summary>
///A test for CompareTrackNames
///</summary>
[TestMethod()]
public void CompareTrackNamesTest()
{
string a = string.Empty; // TODO: Initialize to an appropriate value
string b = string.Empty; // TODO: Initialize to an appropriate value
int expected = 0; // TODO: Initialize to an appropriate value
int actual;
actual = FileGroupInfo.CompareTrackNames(a, b);
Assert.AreEqual(expected, actual);
Assert.Inconclusive("Verify the correctness of this test method.");
}
}
}

View File

@@ -96,6 +96,12 @@
<Compile Include="frmChoice.Designer.cs">
<DependentUpon>frmChoice.cs</DependentUpon>
</Compile>
<Compile Include="frmOverwrite.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmOverwrite.Designer.cs">
<DependentUpon>frmOverwrite.cs</DependentUpon>
</Compile>
<Compile Include="frmPassword.cs">
<SubType>Form</SubType>
</Compile>
@@ -158,6 +164,9 @@
<SubType>Designer</SubType>
<DependentUpon>frmCUETools.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmOverwrite.resx">
<DependentUpon>frmOverwrite.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmPassword.de-DE.resx">
<DependentUpon>frmPassword.cs</DependentUpon>
<SubType>Designer</SubType>

View File

@@ -35,6 +35,7 @@ namespace JDP {
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.textBatchReport = new System.Windows.Forms.TextBox();
this.grpInput = new System.Windows.Forms.GroupBox();
this.fileSystemTreeView1 = new CUEControls.FileSystemTreeView();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.groupBoxMode = new System.Windows.Forms.GroupBox();
this.tableLayoutPanelCUEStyle = new System.Windows.Forms.TableLayoutPanel();
@@ -120,7 +121,6 @@ namespace JDP {
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.setAsMyMusicFolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.resetToOriginalLocationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.fileSystemTreeView1 = new CUEControls.FileSystemTreeView();
this.toolStripContainer1.BottomToolStripPanel.SuspendLayout();
this.toolStripContainer1.ContentPanel.SuspendLayout();
this.toolStripContainer1.TopToolStripPanel.SuspendLayout();
@@ -254,6 +254,33 @@ namespace JDP {
this.grpInput.Name = "grpInput";
this.grpInput.TabStop = false;
//
// fileSystemTreeView1
//
this.fileSystemTreeView1.AllowDrop = true;
resources.ApplyResources(this.fileSystemTreeView1, "fileSystemTreeView1");
this.fileSystemTreeView1.BackColor = System.Drawing.SystemColors.Control;
this.fileSystemTreeView1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.fileSystemTreeView1.CheckBoxes = true;
this.fileSystemTreeView1.FullRowSelect = true;
this.fileSystemTreeView1.HideSelection = false;
this.fileSystemTreeView1.ItemHeight = 16;
this.fileSystemTreeView1.Name = "fileSystemTreeView1";
this.fileSystemTreeView1.ShowLines = false;
this.fileSystemTreeView1.ShowRootLines = false;
this.fileSystemTreeView1.SpecialFolders = new CUEControls.ExtraSpecialFolder[] {
CUEControls.ExtraSpecialFolder.MyComputer,
CUEControls.ExtraSpecialFolder.Profile,
CUEControls.ExtraSpecialFolder.MyMusic,
CUEControls.ExtraSpecialFolder.CommonMusic};
this.fileSystemTreeView1.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.fileSystemTreeView1_AfterCheck);
this.fileSystemTreeView1.NodeExpand += new CUEControls.FileSystemTreeViewNodeExpandHandler(this.fileSystemTreeView1_NodeExpand);
this.fileSystemTreeView1.DragDrop += new System.Windows.Forms.DragEventHandler(this.fileSystemTreeView1_DragDrop);
this.fileSystemTreeView1.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.fileSystemTreeView1_AfterSelect);
this.fileSystemTreeView1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.fileSystemTreeView1_MouseDown);
this.fileSystemTreeView1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.fileSystemTreeView1_KeyDown);
this.fileSystemTreeView1.AfterExpand += new System.Windows.Forms.TreeViewEventHandler(this.fileSystemTreeView1_AfterExpand);
this.fileSystemTreeView1.DragOver += new System.Windows.Forms.DragEventHandler(this.fileSystemTreeView1_DragOver);
//
// tableLayoutPanel2
//
resources.ApplyResources(this.tableLayoutPanel2, "tableLayoutPanel2");
@@ -969,33 +996,6 @@ namespace JDP {
resources.ApplyResources(this.resetToOriginalLocationToolStripMenuItem, "resetToOriginalLocationToolStripMenuItem");
this.resetToOriginalLocationToolStripMenuItem.Click += new System.EventHandler(this.resetToOriginalLocationToolStripMenuItem_Click);
//
// fileSystemTreeView1
//
this.fileSystemTreeView1.AllowDrop = true;
resources.ApplyResources(this.fileSystemTreeView1, "fileSystemTreeView1");
this.fileSystemTreeView1.BackColor = System.Drawing.SystemColors.Control;
this.fileSystemTreeView1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.fileSystemTreeView1.CheckBoxes = true;
this.fileSystemTreeView1.FullRowSelect = true;
this.fileSystemTreeView1.HideSelection = false;
this.fileSystemTreeView1.ItemHeight = 16;
this.fileSystemTreeView1.Name = "fileSystemTreeView1";
this.fileSystemTreeView1.ShowLines = false;
this.fileSystemTreeView1.ShowRootLines = false;
this.fileSystemTreeView1.SpecialFolders = new CUEControls.ExtraSpecialFolder[] {
CUEControls.ExtraSpecialFolder.MyComputer,
CUEControls.ExtraSpecialFolder.Profile,
CUEControls.ExtraSpecialFolder.MyMusic,
CUEControls.ExtraSpecialFolder.CommonMusic};
this.fileSystemTreeView1.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.fileSystemTreeView1_AfterCheck);
this.fileSystemTreeView1.NodeExpand += new CUEControls.FileSystemTreeViewNodeExpandHandler(this.fileSystemTreeView1_NodeExpand);
this.fileSystemTreeView1.DragDrop += new System.Windows.Forms.DragEventHandler(this.fileSystemTreeView1_DragDrop);
this.fileSystemTreeView1.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.fileSystemTreeView1_AfterSelect);
this.fileSystemTreeView1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.fileSystemTreeView1_MouseDown);
this.fileSystemTreeView1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.fileSystemTreeView1_KeyDown);
this.fileSystemTreeView1.AfterExpand += new System.Windows.Forms.TreeViewEventHandler(this.fileSystemTreeView1_AfterExpand);
this.fileSystemTreeView1.DragOver += new System.Windows.Forms.DragEventHandler(this.fileSystemTreeView1_DragOver);
//
// frmCUETools
//
resources.ApplyResources(this, "$this");

View File

@@ -83,6 +83,8 @@ namespace JDP {
}
}
DialogResult overwriteResult = DialogResult.None;
private void btnConvert_Click(object sender, EventArgs e) {
if ((_workThread != null) && (_workThread.IsAlive))
return;
@@ -98,6 +100,7 @@ namespace JDP {
_batchReport = new StringBuilder();
_batchRoot = null;
_batchProcessed = 0;
overwriteResult = DialogResult.None;
// TODO!!!
//if (SelectedOutputAudioFmt != null)
@@ -778,20 +781,8 @@ namespace JDP {
this.Invoke((MethodInvoker)delegate()
{
toolStripStatusLabelAR.Enabled = cueSheet.ArVerify.ARStatus == null;
toolStripStatusLabelAR.Visible = useAR;
toolStripStatusLabelAR.Text = cueSheet.ArVerify.ARStatus == null ? cueSheet.ArVerify.WorstTotal().ToString() : "";
toolStripStatusLabelAR.ToolTipText = "AccurateRip: " + (cueSheet.ArVerify.ARStatus ?? "found") + ".";
if (!useCUEToolsDB)
toolStripStatusLabelCTDB.Visible = false;
else
{
toolStripStatusLabelCTDB.Visible = true;
toolStripStatusLabelCTDB.Enabled = cueSheet.CTDB.DBStatus == null;
toolStripStatusLabelCTDB.Text = cueSheet.CTDB.DBStatus == null ? cueSheet.CTDB.Total.ToString() : "";
toolStripStatusLabelCTDB.ToolTipText = "CUETools DB: " + (cueSheet.CTDB.DBStatus ?? "found") + ".";
}
toolStripStatusLabelCTDB.Visible = useCUEToolsDB;
if (releases != null)
{
@@ -818,28 +809,37 @@ namespace JDP {
cueSheet.GenerateFilenames(audioEncoderType, outputFormat, pathOut);
bool outputExists = cueSheet.OutputExists();
List<string> outputExists = cueSheet.OutputExists();
dlgRes = DialogResult.Cancel;
if (outputExists)
if (outputExists.Count > 0)
{
this.Invoke((MethodInvoker)delegate()
{
dlgRes = MessageBox.Show(this, "One or more output file already exists, " +
"do you want to overwrite?", "Overwrite?", (_batchPaths.Count == 0) ?
MessageBoxButtons.YesNo : MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
if (overwriteResult == DialogResult.None)
{
using (frmOverwrite frm = new frmOverwrite())
{
outputExists.ForEach(path => frm.textFiles.AppendText(path + "\n"));
dlgRes = frm.ShowDialog(this);
if (frm.checkBoxRemember.Checked)
overwriteResult = dlgRes;
}
}
else
dlgRes = overwriteResult;
if (dlgRes == DialogResult.Yes)
outputExists = false;
outputExists.Clear();
else if (_batchPaths.Count == 0)
SetupControls(false);
});
if (outputExists && _batchPaths.Count == 0)
if (outputExists.Count > 0 && _batchPaths.Count == 0)
{
cueSheet.Close();
return;
}
}
if (!outputExists)
if (outputExists.Count == 0)
{
cueSheet.UsePregapForFirstTrackInSingleFile = _usePregapForFirstTrackInSingleFile && !outputAudio;
if (script == null)
@@ -988,7 +988,8 @@ namespace JDP {
public void SetStatus(object sender, CUEToolsProgressEventArgs e)
{
this.BeginInvoke((MethodInvoker)delegate() {
this.BeginInvoke((MethodInvoker)delegate()
{
if (e.percent == 0)
{
_startedAt = DateTime.Now;
@@ -1004,13 +1005,20 @@ namespace JDP {
{
double speed = e.offset / span.TotalSeconds / 44100;
speedStr = String.Format("{0:00.00}x", speed);
}
}
toolStripProgressBar2.ToolTipText = String.Format("{0}:{1:00}/{2}:{3:00}", (int)span.TotalMinutes, span.Seconds, (int)eta.TotalMinutes, eta.Seconds);
toolStripStatusLabelProcessed.Text = String.Format("{0}@{1}", toolStripProgressBar2.ToolTipText, speedStr);
toolStripStatusLabelProcessed.Visible = true;
}
toolStripStatusLabel1.Text = e.status;
toolStripProgressBar2.Value = Math.Max(0,Math.Min(100,(int)(e.percent*100)));
toolStripProgressBar2.Value = Math.Max(0, Math.Min(100, (int)(e.percent * 100)));
toolStripStatusLabelAR.Enabled = e.cueSheet != null && e.cueSheet.ArVerify != null && e.cueSheet.ArVerify.ARStatus == null;
toolStripStatusLabelAR.Text = e.cueSheet != null && e.cueSheet.ArVerify != null && e.cueSheet.ArVerify.ExceptionStatus == WebExceptionStatus.Success ? e.cueSheet.ArVerify.WorstTotal().ToString() : "";
toolStripStatusLabelAR.ToolTipText = e.cueSheet != null && e.cueSheet.ArVerify != null ? "AccurateRip: " + (e.cueSheet.ArVerify.ARStatus ?? "found") + "." : "";
toolStripStatusLabelCTDB.Enabled = e.cueSheet != null && e.cueSheet.CTDB != null && e.cueSheet.CTDB.DBStatus == null;
toolStripStatusLabelCTDB.Text = e.cueSheet != null && e.cueSheet.CTDB != null && e.cueSheet.CTDB.DBStatus == null ? e.cueSheet.CTDB.Total.ToString() : "";
toolStripStatusLabelCTDB.ToolTipText = e.cueSheet != null && e.cueSheet.CTDB != null ? "CUETools DB: " + (e.cueSheet.CTDB.DBStatus ?? "found") + "." : "";
});
}
@@ -1664,7 +1672,8 @@ namespace JDP {
&& ((File.Exists(pathIn) && Path.GetExtension(pathIn).ToLower() == ".cue")
|| Directory.Exists(pathIn));
rbActionCreateCUESheet.Enabled = pathIn.Length != 0
&& ((File.Exists(pathIn) && CUESheet.CreateDummyCUESheet(_profile._config, pathIn) != null)
&& ((File.Exists(pathIn) && Path.GetExtension(pathIn).ToLower() != ".cue")
//&& ((File.Exists(pathIn) && CUESheet.CreateDummyCUESheet(_profile._config, pathIn) != null) -- too slow
|| Directory.Exists(pathIn));
rbActionVerify.Enabled =
rbActionEncode.Enabled = pathIn.Length != 0

120
CUETools/frmOverwrite.Designer.cs generated Normal file
View File

@@ -0,0 +1,120 @@
namespace JDP
{
partial class frmOverwrite
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.buttonNo = new System.Windows.Forms.Button();
this.buttonYes = new System.Windows.Forms.Button();
this.checkBoxRemember = new System.Windows.Forms.CheckBox();
this.labelAlreadyExist = new System.Windows.Forms.Label();
this.textFiles = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// buttonNo
//
this.buttonNo.DialogResult = System.Windows.Forms.DialogResult.No;
this.buttonNo.Location = new System.Drawing.Point(587, 278);
this.buttonNo.Name = "buttonNo";
this.buttonNo.Size = new System.Drawing.Size(75, 23);
this.buttonNo.TabIndex = 0;
this.buttonNo.Text = "No";
this.buttonNo.UseVisualStyleBackColor = true;
//
// buttonYes
//
this.buttonYes.DialogResult = System.Windows.Forms.DialogResult.Yes;
this.buttonYes.Location = new System.Drawing.Point(506, 278);
this.buttonYes.Name = "buttonYes";
this.buttonYes.Size = new System.Drawing.Size(75, 23);
this.buttonYes.TabIndex = 1;
this.buttonYes.Text = "Yes";
this.buttonYes.UseVisualStyleBackColor = true;
//
// checkBoxRemember
//
this.checkBoxRemember.AutoSize = true;
this.checkBoxRemember.Location = new System.Drawing.Point(12, 282);
this.checkBoxRemember.Name = "checkBoxRemember";
this.checkBoxRemember.Size = new System.Drawing.Size(128, 17);
this.checkBoxRemember.TabIndex = 3;
this.checkBoxRemember.Text = "Remember my choice";
this.checkBoxRemember.UseVisualStyleBackColor = true;
//
// labelAlreadyExist
//
this.labelAlreadyExist.AutoSize = true;
this.labelAlreadyExist.Location = new System.Drawing.Point(201, 283);
this.labelAlreadyExist.Name = "labelAlreadyExist";
this.labelAlreadyExist.Size = new System.Drawing.Size(203, 13);
this.labelAlreadyExist.TabIndex = 2;
this.labelAlreadyExist.Text = "Some of the files already exist. Overwrite?";
//
// textFiles
//
this.textFiles.Font = new System.Drawing.Font("Courier New", 8.25F);
this.textFiles.Location = new System.Drawing.Point(9, 9);
this.textFiles.Margin = new System.Windows.Forms.Padding(0);
this.textFiles.Multiline = true;
this.textFiles.Name = "textFiles";
this.textFiles.ReadOnly = true;
this.textFiles.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.textFiles.Size = new System.Drawing.Size(656, 254);
this.textFiles.TabIndex = 4;
this.textFiles.TabStop = false;
this.textFiles.WordWrap = false;
//
// frmOverwrite
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(674, 313);
this.Controls.Add(this.textFiles);
this.Controls.Add(this.labelAlreadyExist);
this.Controls.Add(this.checkBoxRemember);
this.Controls.Add(this.buttonYes);
this.Controls.Add(this.buttonNo);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "frmOverwrite";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Overwrite?";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button buttonNo;
private System.Windows.Forms.Button buttonYes;
private System.Windows.Forms.Label labelAlreadyExist;
internal System.Windows.Forms.TextBox textFiles;
internal System.Windows.Forms.CheckBox checkBoxRemember;
}
}

18
CUETools/frmOverwrite.cs Normal file
View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace JDP
{
public partial class frmOverwrite : Form
{
public frmOverwrite()
{
InitializeComponent();
}
}
}

120
CUETools/frmOverwrite.resx Normal file
View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -527,7 +527,7 @@ namespace JDP {
// checkBoxEncoderLossless
//
resources.ApplyResources(this.checkBoxEncoderLossless, "checkBoxEncoderLossless");
this.checkBoxEncoderLossless.DataBindings.Add(new System.Windows.Forms.Binding("CheckState", this.encodersBindingSource, "Lossless", true));
this.checkBoxEncoderLossless.DataBindings.Add(new System.Windows.Forms.Binding("Checked", this.encodersBindingSource, "Lossless", true));
this.checkBoxEncoderLossless.Name = "checkBoxEncoderLossless";
this.toolTip1.SetToolTip(this.checkBoxEncoderLossless, resources.GetString("checkBoxEncoderLossless.ToolTip"));
this.checkBoxEncoderLossless.UseVisualStyleBackColor = true;
@@ -697,7 +697,7 @@ namespace JDP {
// checkBoxCopyAlbumArt
//
resources.ApplyResources(this.checkBoxCopyAlbumArt, "checkBoxCopyAlbumArt");
this.checkBoxCopyAlbumArt.DataBindings.Add(new System.Windows.Forms.Binding("CheckState", this.cUEConfigBindingSource, "CopyAlbumArt", true));
this.checkBoxCopyAlbumArt.DataBindings.Add(new System.Windows.Forms.Binding("Checked", this.cUEConfigBindingSource, "CopyAlbumArt", true));
this.checkBoxCopyAlbumArt.Name = "checkBoxCopyAlbumArt";
this.checkBoxCopyAlbumArt.UseVisualStyleBackColor = true;
//
@@ -1127,7 +1127,6 @@ namespace JDP {
this.listBoxEncoders.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.listBoxEncoders.DataSource = this.encodersBindingSource;
this.listBoxEncoders.DisplayMember = "Name";
this.listBoxEncoders.FormattingEnabled = true;
resources.ApplyResources(this.listBoxEncoders, "listBoxEncoders");
this.listBoxEncoders.Name = "listBoxEncoders";
this.listBoxEncoders.KeyDown += new System.Windows.Forms.KeyEventHandler(this.listBoxEncoders_KeyDown);

View File

@@ -35,6 +35,7 @@ namespace JDP {
private void frmSettings_Load(object sender, EventArgs e)
{
cUEConfigBindingSource.DataSource = _config;
encodersBindingSource.DataMember = "Encoders"; // for MONO bug (setting BindingSource.DataSource clears DataMember:(
propertyGrid1.SelectedObject = _config.advanced;
chkReducePriority.Checked = _reducePriority;
@@ -476,33 +477,44 @@ namespace JDP {
private void encodersBindingSource_CurrentItemChanged(object sender, EventArgs e)
{
CUEToolsUDC encoder = encodersBindingSource.Current as CUEToolsUDC;
CUEToolsFormat format = _config.formats[encoder.extension]; // _config.formats.TryGetValue(encoder.extension, out format)
labelEncoderExtension.Visible = encoder != null;
comboBoxEncoderExtension.Visible = encoder != null;
comboBoxEncoderExtension.Enabled = encoder != null && encoder.path != null;
groupBoxExternalEncoder.Visible = encoder != null && encoder.path != null;
checkBoxEncoderLossless.Enabled = encoder != null && format != null && format.allowLossless && format.allowLossy;
if (!checkBoxEncoderLossless.Enabled && encoder != null && format != null && encoder.Lossless != format.allowLossless)
encoder.Lossless = format.allowLossless;
if (encoder != null && encoder.settingsSerializer != null)
{
propertyGridEncoderSettings.Visible = encoder != null && encoder.settingsSerializer != null;
propertyGridEncoderSettings.SelectedObject = encoder.settings;
} else
if (encoder == null)
{
labelEncoderExtension.Visible =
comboBoxEncoderExtension.Visible =
comboBoxEncoderExtension.Enabled =
groupBoxExternalEncoder.Visible =
checkBoxEncoderLossless.Enabled =
propertyGridEncoderSettings.Visible = false;
propertyGridEncoderSettings.SelectedObject = null;
}
foreach (KeyValuePair<string, CUEToolsFormat> fmtEntry in _config.formats)
else
{
CUEToolsFormat fmt = fmtEntry.Value;
if (fmt.encoderLossless == encoder && (fmt.extension != encoder.extension || !encoder.Lossless))
fmt.encoderLossless = null;
if (fmt.encoderLossy == encoder && (fmt.extension != encoder.extension || encoder.Lossless))
fmt.encoderLossy = null;
CUEToolsFormat format = _config.formats[encoder.extension]; // _config.formats.TryGetValue(encoder.extension, out format)
labelEncoderExtension.Visible = true;
comboBoxEncoderExtension.Visible = true;
comboBoxEncoderExtension.Enabled = encoder.path != null;
groupBoxExternalEncoder.Visible = encoder.path != null;
checkBoxEncoderLossless.Enabled = format != null && format.allowLossless && format.allowLossy;
if (!checkBoxEncoderLossless.Enabled && format != null && encoder.Lossless != format.allowLossless)
encoder.Lossless = format.allowLossless;
if (encoder.settingsSerializer != null)
{
propertyGridEncoderSettings.Visible = encoder != null && encoder.settingsSerializer != null;
propertyGridEncoderSettings.SelectedObject = encoder.settings;
}
else
{
propertyGridEncoderSettings.Visible = false;
propertyGridEncoderSettings.SelectedObject = null;
}
foreach (KeyValuePair<string, CUEToolsFormat> fmtEntry in _config.formats)
{
CUEToolsFormat fmt = fmtEntry.Value;
if (fmt.encoderLossless == encoder && (fmt.extension != encoder.extension || !encoder.Lossless))
fmt.encoderLossless = null;
if (fmt.encoderLossy == encoder && (fmt.extension != encoder.extension || encoder.Lossless))
fmt.encoderLossy = null;
}
}
}

File diff suppressed because it is too large Load Diff