Finalized 2.1.2;

Starting work on 2.1.3 (prioritized metadata lookup, freedb via ctdb)
This commit is contained in:
chudov
2011-06-26 00:02:29 +00:00
parent e3b05e3e7f
commit 78197894f7
18 changed files with 708 additions and 221 deletions

View File

@@ -34,14 +34,16 @@
this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// progressBar1
//
this.progressBar1.Dock = System.Windows.Forms.DockStyle.Top;
this.progressBar1.Location = new System.Drawing.Point(10, 198);
this.progressBar1.Dock = System.Windows.Forms.DockStyle.Fill;
this.progressBar1.Location = new System.Drawing.Point(5, 5);
this.progressBar1.Name = "progressBar1";
this.progressBar1.Size = new System.Drawing.Size(587, 23);
this.progressBar1.Size = new System.Drawing.Size(587, 25);
this.progressBar1.Style = System.Windows.Forms.ProgressBarStyle.Marquee;
this.progressBar1.TabIndex = 0;
//
@@ -54,14 +56,14 @@
//
this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader1});
this.listView1.Dock = System.Windows.Forms.DockStyle.Top;
this.listView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.listView1.FullRowSelect = true;
this.listView1.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
this.listView1.HideSelection = false;
this.listView1.Location = new System.Drawing.Point(10, 10);
this.listView1.MultiSelect = false;
this.listView1.Name = "listView1";
this.listView1.Size = new System.Drawing.Size(587, 188);
this.listView1.Size = new System.Drawing.Size(597, 213);
this.listView1.TabIndex = 1;
this.listView1.UseCompatibleStateImageBehavior = false;
this.listView1.View = System.Windows.Forms.View.Details;
@@ -74,9 +76,10 @@
// button1
//
this.button1.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.button1.Location = new System.Drawing.Point(519, 204);
this.button1.Dock = System.Windows.Forms.DockStyle.Right;
this.button1.Location = new System.Drawing.Point(442, 5);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.Size = new System.Drawing.Size(75, 25);
this.button1.TabIndex = 2;
this.button1.Text = "Cancel";
this.button1.UseVisualStyleBackColor = true;
@@ -85,30 +88,44 @@
// button2
//
this.button2.DialogResult = System.Windows.Forms.DialogResult.OK;
this.button2.Location = new System.Drawing.Point(438, 204);
this.button2.Dock = System.Windows.Forms.DockStyle.Right;
this.button2.Location = new System.Drawing.Point(517, 5);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.Size = new System.Drawing.Size(75, 25);
this.button2.TabIndex = 3;
this.button2.Text = "OK";
this.button2.UseVisualStyleBackColor = true;
this.button2.Visible = false;
//
// panel1
//
this.panel1.Controls.Add(this.button1);
this.panel1.Controls.Add(this.button2);
this.panel1.Controls.Add(this.progressBar1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panel1.Location = new System.Drawing.Point(10, 223);
this.panel1.Name = "panel1";
this.panel1.Padding = new System.Windows.Forms.Padding(5);
this.panel1.Size = new System.Drawing.Size(597, 35);
this.panel1.TabIndex = 4;
//
// FormMetadata
//
this.AcceptButton = this.button2;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.button1;
this.ClientSize = new System.Drawing.Size(607, 233);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.progressBar1);
this.ClientSize = new System.Drawing.Size(617, 268);
this.Controls.Add(this.listView1);
this.Controls.Add(this.panel1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
this.MinimumSize = new System.Drawing.Size(500, 300);
this.Name = "FormMetadata";
this.Padding = new System.Windows.Forms.Padding(10);
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "CTDB Metadata Lookup";
this.Load += new System.EventHandler(this.FormMetadata_Load);
this.panel1.ResumeLayout(false);
this.ResumeLayout(false);
}
@@ -121,5 +138,6 @@
private System.Windows.Forms.ColumnHeader columnHeader1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Panel panel1;
}
}

View File

@@ -39,7 +39,11 @@ namespace CUETools.CTDB.EACPlugin
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
{
this.ctdb.ContactDB(null, this.agent, null, true, false);
this.ctdb.ContactDB(null, this.agent, null, false, false,
AudioDataPlugIn.Options.priorityMusicbrainz,
AudioDataPlugIn.Options.priorityFreedb,
AudioDataPlugIn.Options.priorityFreedbFuzzy);
}
private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)

View File

@@ -49,7 +49,7 @@ namespace CUETools.CTDB.EACPlugin
this.ctdb.UploadHelper.onProgress += UploadProgress;
if (this.agent != null)
{
this.ctdb.ContactDB(null, this.agent, this.drivename, false, false);
this.ctdb.ContactDB(null, this.agent, this.drivename, true, false, CTDBPriority.None, CTDBPriority.None, CTDBPriority.None);
}
else
{

View File

@@ -49,33 +49,97 @@ namespace MetadataPlugIn
return false;
int year, disccount, discnumber;
if (meta.year != null && int.TryParse(meta.year, out year))
data.Year = year;
if (meta.disccount != null && int.TryParse(meta.disccount, out disccount))
data.TotalNumberOfCDs = disccount;
if (meta.discnumber != null && int.TryParse(meta.discnumber, out discnumber))
data.CDNumber = discnumber;
if (meta.album != null)
data.AlbumTitle = meta.album;
if (meta.artist != null)
data.AlbumArtist = meta.artist;
string extra = meta.extra ?? "";
if (!string.IsNullOrEmpty(meta.discname))
extra += "Disc name: " + meta.discname + "\r\n";
if (!string.IsNullOrEmpty(meta.infourl))
extra += "Info URL: " + meta.infourl + "\r\n";
if (!string.IsNullOrEmpty(meta.barcode))
extra += "Barcode: " + meta.barcode + "\r\n";
if (!string.IsNullOrEmpty(meta.releasedate))
extra += "Release date: " + meta.releasedate + "\r\n";
if (!string.IsNullOrEmpty(meta.country))
extra += "Release country: " + meta.country + "\r\n";
if (meta.label != null)
foreach (var label in meta.label)
{
if (!string.IsNullOrEmpty(label.name))
extra += "Release label: " + label.name + "\r\n";
if (!string.IsNullOrEmpty(label.catno))
extra += "Release catalog#: " + label.catno + "\r\n";
}
data.Year = meta.year != null && int.TryParse(meta.year, out year) ? year : -1;
data.TotalNumberOfCDs = meta.disccount != null && int.TryParse(meta.disccount, out disccount) ? disccount : 1;
data.CDNumber = meta.discnumber != null && int.TryParse(meta.discnumber, out discnumber) ? discnumber : 1;
data.FirstTrackNumber = 1;
data.AlbumTitle = meta.album ?? "";
data.AlbumArtist = meta.artist ?? "";
data.MP3V2Type = meta.genre ?? "";
data.CDDBMusicType = GetFreeDBMusicType(meta);
data.MP3Type = GetMP3MusicType(data.CDDBMusicType);
data.ExtendedDiscInformation = extra;
data.Revision = -1; // TODO: meta.id? rock/ffffffff/16?
if (meta.track != null)
for (int track = 0; track < data.NumberOfTracks; track++)
{
if (track < meta.track.Length)
{
if (meta.track[track].name != null)
data.SetTrackTitle(track, meta.track[track].name);
var trackartist = meta.track[track].artist ?? meta.artist;
if (trackartist != null)
data.SetTrackArtist(track, trackartist);
data.SetTrackTitle(track, meta.track[track].name ?? "");
data.SetTrackArtist(track, meta.track[track].artist ?? meta.artist ?? "");
data.SetExtendedTrackInformation(track, meta.track[track].extra ?? "");
}
else if (meta.artist != null)
data.SetTrackArtist(track, meta.artist);
else
{
data.SetTrackTitle(track, "");
data.SetTrackArtist(track, meta.artist ?? "");
data.SetExtendedTrackInformation(track, "");
}
data.SetTrackComposer(track, "");
}
return true;
}
public int GetMP3MusicType(int freedbtype)
{
int[] list = { 17, 29, 34, 95, 53, 77, 90, 113, 117, 129, 95 };
return (freedbtype <= 0 || freedbtype >= list.Length) ? -1 : list[freedbtype];
}
public int GetFreeDBMusicType(CTDBResponseMeta meta)
{
int pos = meta.id.IndexOf('/');
if (meta.source != "freedb" || pos < 0)
return -1;
string freedbtype = meta.id.Substring(0, pos);
switch (freedbtype.ToUpper())
{
case "BLUES":
return 0;
case "CLASSICAL":
return 1;
case "COUNTRY":
return 2;
case "DATA":
return 3;
case "FOLK":
return 4;
case "JAZZ":
return 5;
case "NEWAGE":
return 6;
case "REGGAE":
return 7;
case "ROCK":
return 8;
case "SOUNDTRACK":
return 9;
case "MISC":
return 10;
default:
return -1;
}
}
public string GetPluginGuid()
{
return ((GuidAttribute)Attribute.GetCustomAttribute(GetType(), typeof(GuidAttribute))).Value;

View File

@@ -33,7 +33,28 @@ namespace AudioDataPlugIn
this.label2 = new System.Windows.Forms.Label();
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.radioButtonMBHigh = new System.Windows.Forms.RadioButton();
this.radioButtonMBLow = new System.Windows.Forms.RadioButton();
this.radioButtonMBMedium = new System.Windows.Forms.RadioButton();
this.radioButtonMBNone = new System.Windows.Forms.RadioButton();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.radioButtonFDMedium = new System.Windows.Forms.RadioButton();
this.radioButtonFDHigh = new System.Windows.Forms.RadioButton();
this.radioButtonFDLow = new System.Windows.Forms.RadioButton();
this.radioButtonFDNone = new System.Windows.Forms.RadioButton();
this.buttonOk = new System.Windows.Forms.Button();
this.label3 = new System.Windows.Forms.Label();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.radioButtonFZMedium = new System.Windows.Forms.RadioButton();
this.radioButtonFZHigh = new System.Windows.Forms.RadioButton();
this.radioButtonFZLow = new System.Windows.Forms.RadioButton();
this.radioButtonFZNone = new System.Windows.Forms.RadioButton();
this.buttonCancel = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
this.SuspendLayout();
//
// label1
@@ -49,7 +70,7 @@ namespace AudioDataPlugIn
//
this.label2.Location = new System.Drawing.Point(95, 67);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(230, 74);
this.label2.Size = new System.Drawing.Size(230, 34);
this.label2.TabIndex = 1;
this.label2.Text = "Copyright (c) 2011 Gregory S. Chudov";
//
@@ -73,11 +94,220 @@ namespace AudioDataPlugIn
this.pictureBox1.TabIndex = 4;
this.pictureBox1.TabStop = false;
//
// radioButtonMBHigh
//
this.radioButtonMBHigh.AutoSize = true;
this.radioButtonMBHigh.Location = new System.Drawing.Point(6, 16);
this.radioButtonMBHigh.Name = "radioButtonMBHigh";
this.radioButtonMBHigh.Size = new System.Drawing.Size(47, 17);
this.radioButtonMBHigh.TabIndex = 6;
this.radioButtonMBHigh.TabStop = true;
this.radioButtonMBHigh.Text = "High";
this.radioButtonMBHigh.UseVisualStyleBackColor = true;
//
// radioButtonMBLow
//
this.radioButtonMBLow.AutoSize = true;
this.radioButtonMBLow.Location = new System.Drawing.Point(6, 50);
this.radioButtonMBLow.Name = "radioButtonMBLow";
this.radioButtonMBLow.Size = new System.Drawing.Size(45, 17);
this.radioButtonMBLow.TabIndex = 7;
this.radioButtonMBLow.TabStop = true;
this.radioButtonMBLow.Text = "Low";
this.radioButtonMBLow.UseVisualStyleBackColor = true;
//
// radioButtonMBMedium
//
this.radioButtonMBMedium.AutoSize = true;
this.radioButtonMBMedium.Location = new System.Drawing.Point(6, 33);
this.radioButtonMBMedium.Name = "radioButtonMBMedium";
this.radioButtonMBMedium.Size = new System.Drawing.Size(62, 17);
this.radioButtonMBMedium.TabIndex = 8;
this.radioButtonMBMedium.TabStop = true;
this.radioButtonMBMedium.Text = "Medium";
this.radioButtonMBMedium.UseVisualStyleBackColor = true;
//
// radioButtonMBNone
//
this.radioButtonMBNone.AutoSize = true;
this.radioButtonMBNone.Location = new System.Drawing.Point(6, 67);
this.radioButtonMBNone.Name = "radioButtonMBNone";
this.radioButtonMBNone.Size = new System.Drawing.Size(51, 17);
this.radioButtonMBNone.TabIndex = 9;
this.radioButtonMBNone.TabStop = true;
this.radioButtonMBNone.Text = "None";
this.radioButtonMBNone.UseVisualStyleBackColor = true;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.radioButtonMBMedium);
this.groupBox1.Controls.Add(this.radioButtonMBHigh);
this.groupBox1.Controls.Add(this.radioButtonMBLow);
this.groupBox1.Controls.Add(this.radioButtonMBNone);
this.groupBox1.Location = new System.Drawing.Point(12, 119);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(83, 95);
this.groupBox1.TabIndex = 15;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Musicbrainz";
//
// groupBox2
//
this.groupBox2.Controls.Add(this.radioButtonFDMedium);
this.groupBox2.Controls.Add(this.radioButtonFDHigh);
this.groupBox2.Controls.Add(this.radioButtonFDLow);
this.groupBox2.Controls.Add(this.radioButtonFDNone);
this.groupBox2.Location = new System.Drawing.Point(101, 119);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(83, 95);
this.groupBox2.TabIndex = 16;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Freedb";
//
// radioButtonFDMedium
//
this.radioButtonFDMedium.AutoSize = true;
this.radioButtonFDMedium.Location = new System.Drawing.Point(6, 33);
this.radioButtonFDMedium.Name = "radioButtonFDMedium";
this.radioButtonFDMedium.Size = new System.Drawing.Size(62, 17);
this.radioButtonFDMedium.TabIndex = 8;
this.radioButtonFDMedium.TabStop = true;
this.radioButtonFDMedium.Text = "Medium";
this.radioButtonFDMedium.UseVisualStyleBackColor = true;
//
// radioButtonFDHigh
//
this.radioButtonFDHigh.AutoSize = true;
this.radioButtonFDHigh.Location = new System.Drawing.Point(6, 16);
this.radioButtonFDHigh.Name = "radioButtonFDHigh";
this.radioButtonFDHigh.Size = new System.Drawing.Size(47, 17);
this.radioButtonFDHigh.TabIndex = 6;
this.radioButtonFDHigh.TabStop = true;
this.radioButtonFDHigh.Text = "High";
this.radioButtonFDHigh.UseVisualStyleBackColor = true;
//
// radioButtonFDLow
//
this.radioButtonFDLow.AutoSize = true;
this.radioButtonFDLow.Location = new System.Drawing.Point(6, 50);
this.radioButtonFDLow.Name = "radioButtonFDLow";
this.radioButtonFDLow.Size = new System.Drawing.Size(45, 17);
this.radioButtonFDLow.TabIndex = 7;
this.radioButtonFDLow.TabStop = true;
this.radioButtonFDLow.Text = "Low";
this.radioButtonFDLow.UseVisualStyleBackColor = true;
//
// radioButtonFDNone
//
this.radioButtonFDNone.AutoSize = true;
this.radioButtonFDNone.Location = new System.Drawing.Point(6, 67);
this.radioButtonFDNone.Name = "radioButtonFDNone";
this.radioButtonFDNone.Size = new System.Drawing.Size(51, 17);
this.radioButtonFDNone.TabIndex = 9;
this.radioButtonFDNone.TabStop = true;
this.radioButtonFDNone.Text = "None";
this.radioButtonFDNone.UseVisualStyleBackColor = true;
//
// buttonOk
//
this.buttonOk.DialogResult = System.Windows.Forms.DialogResult.OK;
this.buttonOk.Location = new System.Drawing.Point(303, 189);
this.buttonOk.Name = "buttonOk";
this.buttonOk.Size = new System.Drawing.Size(75, 25);
this.buttonOk.TabIndex = 17;
this.buttonOk.Text = "OK";
this.buttonOk.UseVisualStyleBackColor = true;
this.buttonOk.Click += new System.EventHandler(this.button2_Click);
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(12, 101);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(134, 13);
this.label3.TabIndex = 18;
this.label3.Text = "Metadata providers priority:";
//
// groupBox3
//
this.groupBox3.Controls.Add(this.radioButtonFZMedium);
this.groupBox3.Controls.Add(this.radioButtonFZHigh);
this.groupBox3.Controls.Add(this.radioButtonFZLow);
this.groupBox3.Controls.Add(this.radioButtonFZNone);
this.groupBox3.Location = new System.Drawing.Point(190, 119);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(83, 95);
this.groupBox3.TabIndex = 17;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "Freedb fuzzy";
//
// radioButtonFZMedium
//
this.radioButtonFZMedium.AutoSize = true;
this.radioButtonFZMedium.Location = new System.Drawing.Point(6, 33);
this.radioButtonFZMedium.Name = "radioButtonFZMedium";
this.radioButtonFZMedium.Size = new System.Drawing.Size(62, 17);
this.radioButtonFZMedium.TabIndex = 8;
this.radioButtonFZMedium.TabStop = true;
this.radioButtonFZMedium.Text = "Medium";
this.radioButtonFZMedium.UseVisualStyleBackColor = true;
//
// radioButtonFZHigh
//
this.radioButtonFZHigh.AutoSize = true;
this.radioButtonFZHigh.Location = new System.Drawing.Point(6, 16);
this.radioButtonFZHigh.Name = "radioButtonFZHigh";
this.radioButtonFZHigh.Size = new System.Drawing.Size(47, 17);
this.radioButtonFZHigh.TabIndex = 6;
this.radioButtonFZHigh.TabStop = true;
this.radioButtonFZHigh.Text = "High";
this.radioButtonFZHigh.UseVisualStyleBackColor = true;
//
// radioButtonFZLow
//
this.radioButtonFZLow.AutoSize = true;
this.radioButtonFZLow.Location = new System.Drawing.Point(6, 50);
this.radioButtonFZLow.Name = "radioButtonFZLow";
this.radioButtonFZLow.Size = new System.Drawing.Size(45, 17);
this.radioButtonFZLow.TabIndex = 7;
this.radioButtonFZLow.TabStop = true;
this.radioButtonFZLow.Text = "Low";
this.radioButtonFZLow.UseVisualStyleBackColor = true;
//
// radioButtonFZNone
//
this.radioButtonFZNone.AutoSize = true;
this.radioButtonFZNone.Location = new System.Drawing.Point(6, 67);
this.radioButtonFZNone.Name = "radioButtonFZNone";
this.radioButtonFZNone.Size = new System.Drawing.Size(51, 17);
this.radioButtonFZNone.TabIndex = 9;
this.radioButtonFZNone.TabStop = true;
this.radioButtonFZNone.Text = "None";
this.radioButtonFZNone.UseVisualStyleBackColor = true;
//
// buttonCancel
//
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonCancel.Location = new System.Drawing.Point(303, 158);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 25);
this.buttonCancel.TabIndex = 19;
this.buttonCancel.Text = "Cancel";
this.buttonCancel.UseVisualStyleBackColor = true;
//
// Options
//
this.AcceptButton = this.buttonOk;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(332, 158);
this.CancelButton = this.buttonCancel;
this.ClientSize = new System.Drawing.Size(390, 227);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.groupBox3);
this.Controls.Add(this.label3);
this.Controls.Add(this.buttonOk);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.linkLabel1);
this.Controls.Add(this.label2);
@@ -90,6 +320,12 @@ namespace AudioDataPlugIn
this.Text = "Options";
this.Load += new System.EventHandler(this.Options_Load);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
@@ -101,5 +337,23 @@ namespace AudioDataPlugIn
private System.Windows.Forms.Label label2;
private System.Windows.Forms.LinkLabel linkLabel1;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.RadioButton radioButtonMBHigh;
private System.Windows.Forms.RadioButton radioButtonMBLow;
private System.Windows.Forms.RadioButton radioButtonMBMedium;
private System.Windows.Forms.RadioButton radioButtonMBNone;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.RadioButton radioButtonFDMedium;
private System.Windows.Forms.RadioButton radioButtonFDHigh;
private System.Windows.Forms.RadioButton radioButtonFDLow;
private System.Windows.Forms.RadioButton radioButtonFDNone;
private System.Windows.Forms.Button buttonOk;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.RadioButton radioButtonFZMedium;
private System.Windows.Forms.RadioButton radioButtonFZHigh;
private System.Windows.Forms.RadioButton radioButtonFZLow;
private System.Windows.Forms.RadioButton radioButtonFZNone;
private System.Windows.Forms.Button buttonCancel;
}
}

View File

@@ -6,11 +6,16 @@ using System.Drawing;
using System.Text;
using System.Windows.Forms;
using CUETools.CTDB.EACPlugin.Properties;
using CUETools.CTDB;
namespace AudioDataPlugIn
{
public partial class Options : Form
{
public static CTDBPriority priorityMusicbrainz = CTDBPriority.High;
public static CTDBPriority priorityFreedb = CTDBPriority.Medium;
public static CTDBPriority priorityFreedbFuzzy = CTDBPriority.Low;
public Options()
{
InitializeComponent();
@@ -24,6 +29,34 @@ namespace AudioDataPlugIn
private void Options_Load(object sender, EventArgs e)
{
this.Icon = Resources.ctdb;
this.radioButtonMBHigh.Checked = priorityMusicbrainz == CTDBPriority.High;
this.radioButtonMBMedium.Checked = priorityMusicbrainz == CTDBPriority.Medium;
this.radioButtonMBLow.Checked = priorityMusicbrainz == CTDBPriority.Low;
this.radioButtonMBNone.Checked = priorityMusicbrainz == CTDBPriority.None;
this.radioButtonFDHigh.Checked = priorityFreedb == CTDBPriority.High;
this.radioButtonFDMedium.Checked = priorityFreedb == CTDBPriority.Medium;
this.radioButtonFDLow.Checked = priorityFreedb == CTDBPriority.Low;
this.radioButtonFDNone.Checked = priorityFreedb == CTDBPriority.None;
this.radioButtonFZHigh.Checked = priorityFreedbFuzzy == CTDBPriority.High;
this.radioButtonFZMedium.Checked = priorityFreedbFuzzy == CTDBPriority.Medium;
this.radioButtonFZLow.Checked = priorityFreedbFuzzy == CTDBPriority.Low;
this.radioButtonFZNone.Checked = priorityFreedbFuzzy == CTDBPriority.None;
}
private void button2_Click(object sender, EventArgs e)
{
priorityMusicbrainz = this.radioButtonMBHigh.Checked ? CTDBPriority.High
: this.radioButtonMBMedium.Checked ? CTDBPriority.Medium
: this.radioButtonMBLow.Checked ? CTDBPriority.Low
: CTDBPriority.None;
priorityFreedb = this.radioButtonFDHigh.Checked ? CTDBPriority.High
: this.radioButtonFDMedium.Checked ? CTDBPriority.Medium
: this.radioButtonFDLow.Checked ? CTDBPriority.Low
: CTDBPriority.None;
priorityFreedbFuzzy = this.radioButtonFZHigh.Checked ? CTDBPriority.High
: this.radioButtonFZMedium.Checked ? CTDBPriority.Medium
: this.radioButtonFZLow.Checked ? CTDBPriority.Low
: CTDBPriority.None;
}
}
}