From: <sa...@us...> - 2007-11-15 16:24:15
|
Revision: 1065 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1065&view=rev Author: saamand Date: 2007-11-15 08:24:06 -0800 (Thu, 15 Nov 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MyLyrics/LyricsEngine/LyricsController.cs trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/EvilLabs.cs trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/HotLyrics.cs trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Lyrics007.cs trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyricsOnDemand.cs trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/SeekLyrics.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/ExportTags.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/ImportTags.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.Designer.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.Designer.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.resx trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj Added Paths: ----------- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.resx trunk/plugins/MyLyrics/My Lyrics/TagReaderUtil.cs Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsController.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsController.cs 2007-11-15 15:33:55 UTC (rev 1064) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsController.cs 2007-11-15 16:24:06 UTC (rev 1065) @@ -110,9 +110,6 @@ public void Dispose() { - //m_EventStop_LyricController.Close(); - //m_EventStopped_LyricController.Close(); - // clean-up operations may be placed here for (int i = 0; i < threadList.Count; i++) { @@ -124,10 +121,15 @@ { for (int i = 0; i < threadList.Count; i++) { - stillThreadsAlive = false; ; + stillThreadsAlive = false; if (((Thread)threadList[i]).IsAlive) stillThreadsAlive = true; } + + if (threadList.Count == 0) + { + stillThreadsAlive = false; + } } FinishThread("", "", "The search has ended.", ""); } Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/EvilLabs.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/EvilLabs.cs 2007-11-15 15:33:55 UTC (rev 1064) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/EvilLabs.cs 2007-11-15 16:24:06 UTC (rev 1065) @@ -123,6 +123,10 @@ void timer_Elapsed(object sender, ElapsedEventArgs e) { + timer.Stop(); + timer.Close(); + timer.Dispose(); + lyric = "Not found"; complete = true; Thread.CurrentThread.Abort(); Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/HotLyrics.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/HotLyrics.cs 2007-11-15 15:33:55 UTC (rev 1064) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/HotLyrics.cs 2007-11-15 16:24:06 UTC (rev 1065) @@ -220,6 +220,10 @@ void timer_Elapsed(object sender, ElapsedEventArgs e) { + timer.Stop(); + timer.Close(); + timer.Dispose(); + lyric = "Not found"; complete = true; Thread.CurrentThread.Abort(); Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Lyrics007.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Lyrics007.cs 2007-11-15 15:33:55 UTC (rev 1064) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Lyrics007.cs 2007-11-15 16:24:06 UTC (rev 1065) @@ -139,7 +139,7 @@ } } } - catch (System.Reflection.TargetInvocationException) + catch (Exception) { lyric = "Not found"; } @@ -160,6 +160,10 @@ void timer_Elapsed(object sender, ElapsedEventArgs e) { + timer.Stop(); + timer.Close(); + timer.Dispose(); + lyric = "Not found"; complete = true; Thread.CurrentThread.Abort(); Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyricsOnDemand.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyricsOnDemand.cs 2007-11-15 15:33:55 UTC (rev 1064) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyricsOnDemand.cs 2007-11-15 16:24:06 UTC (rev 1065) @@ -187,6 +187,10 @@ void timer_Elapsed(object sender, ElapsedEventArgs e) { + timer.Stop(); + timer.Close(); + timer.Dispose(); + lyric = "Not found"; complete = true; Thread.CurrentThread.Abort(); Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/SeekLyrics.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/SeekLyrics.cs 2007-11-15 15:33:55 UTC (rev 1064) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/SeekLyrics.cs 2007-11-15 16:24:06 UTC (rev 1065) @@ -199,6 +199,10 @@ void timer_Elapsed(object sender, ElapsedEventArgs e) { + timer.Stop(); + timer.Close(); + timer.Dispose(); + lyric = "Not found"; complete = true; Thread.CurrentThread.Abort(); Added: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs (rev 0) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs 2007-11-15 16:24:06 UTC (rev 1065) @@ -0,0 +1,230 @@ +namespace MyLyrics +{ + partial class Information + { + /// <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 Component 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() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Information)); + this.lbIntro = new System.Windows.Forms.Label(); + this.lbInfo2 = new System.Windows.Forms.Label(); + this.lbInfo1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.panel1 = new System.Windows.Forms.Panel(); + this.label3 = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this.linkLabelForum = new System.Windows.Forms.LinkLabel(); + this.panel1.SuspendLayout(); + this.SuspendLayout(); + // + // lbIntro + // + this.lbIntro.AutoSize = true; + this.lbIntro.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + this.lbIntro.Location = new System.Drawing.Point(29, 57); + this.lbIntro.MaximumSize = new System.Drawing.Size(480, 0); + this.lbIntro.MinimumSize = new System.Drawing.Size(480, 67); + this.lbIntro.Name = "lbIntro"; + this.lbIntro.Size = new System.Drawing.Size(480, 80); + this.lbIntro.TabIndex = 0; + this.lbIntro.Text = resources.GetString("lbIntro.Text"); + // + // lbInfo2 + // + this.lbInfo2.AutoSize = true; + this.lbInfo2.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lbInfo2.ForeColor = System.Drawing.Color.Navy; + this.lbInfo2.Location = new System.Drawing.Point(26, 153); + this.lbInfo2.Name = "lbInfo2"; + this.lbInfo2.Size = new System.Drawing.Size(326, 17); + this.lbInfo2.TabIndex = 2; + this.lbInfo2.Text = "The four tabs of the MyLyrics configuration:"; + // + // lbInfo1 + // + this.lbInfo1.AutoSize = true; + this.lbInfo1.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lbInfo1.ForeColor = System.Drawing.Color.Navy; + this.lbInfo1.Location = new System.Drawing.Point(26, 30); + this.lbInfo1.Name = "lbInfo1"; + this.lbInfo1.Size = new System.Drawing.Size(225, 17); + this.lbInfo1.TabIndex = 3; + this.lbInfo1.Text = "My Lyrics plugin, version 1.00"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(12, 17); + this.label2.MaximumSize = new System.Drawing.Size(460, 0); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(445, 39); + this.label2.TabIndex = 4; + this.label2.Text = resources.GetString("label2.Text"); + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label4.ForeColor = System.Drawing.Color.Navy; + this.label4.Location = new System.Drawing.Point(3, 4); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(100, 13); + this.label4.TabIndex = 6; + this.label4.Text = "Lyrics database:"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(12, 140); + this.label5.MaximumSize = new System.Drawing.Size(460, 0); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(458, 26); + this.label5.TabIndex = 7; + this.label5.Text = "You can perform a search on your whole music database in a single batch search. Y" + + "ou can also choose to select all songs contained in the marked database."; + // + // panel1 + // + this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + this.panel1.Controls.Add(this.label8); + this.panel1.Controls.Add(this.label7); + this.panel1.Controls.Add(this.label6); + this.panel1.Controls.Add(this.label5); + this.panel1.Controls.Add(this.label1); + this.panel1.Controls.Add(this.label3); + this.panel1.Controls.Add(this.label4); + this.panel1.Controls.Add(this.label2); + this.panel1.Location = new System.Drawing.Point(29, 173); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(480, 251); + this.panel1.TabIndex = 8; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(12, 79); + this.label3.MaximumSize = new System.Drawing.Size(460, 0); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(447, 39); + this.label3.TabIndex = 7; + this.label3.Text = resources.GetString("label3.Text"); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label1.ForeColor = System.Drawing.Color.Navy; + this.label1.Location = new System.Drawing.Point(3, 66); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(144, 13); + this.label1.TabIndex = 8; + this.label1.Text = "Music database browse:"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label6.ForeColor = System.Drawing.Color.Navy; + this.label6.Location = new System.Drawing.Point(3, 127); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(136, 13); + this.label6.TabIndex = 9; + this.label6.Text = "Music database batch:"; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label7.ForeColor = System.Drawing.Color.Navy; + this.label7.Location = new System.Drawing.Point(3, 176); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(53, 13); + this.label7.TabIndex = 10; + this.label7.Text = "Settings"; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(12, 189); + this.label8.MaximumSize = new System.Drawing.Size(460, 0); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(454, 52); + this.label8.TabIndex = 11; + this.label8.Text = resources.GetString("label8.Text"); + // + // linkLabelForum + // + this.linkLabelForum.AutoSize = true; + this.linkLabelForum.LinkColor = System.Drawing.Color.Navy; + this.linkLabelForum.Location = new System.Drawing.Point(364, 436); + this.linkLabelForum.Name = "linkLabelForum"; + this.linkLabelForum.Size = new System.Drawing.Size(145, 13); + this.linkLabelForum.TabIndex = 9; + this.linkLabelForum.TabStop = true; + this.linkLabelForum.Tag = "http://forum.team-mediaportal.com/my_lyrics_plugin-f163.html"; + this.linkLabelForum.Text = "MyLyrics plugin forum section"; + this.linkLabelForum.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabelForum_LinkClicked); + // + // Information + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.linkLabelForum); + this.Controls.Add(this.panel1); + this.Controls.Add(this.lbInfo1); + this.Controls.Add(this.lbInfo2); + this.Controls.Add(this.lbIntro); + this.Name = "Information"; + this.Size = new System.Drawing.Size(539, 494); + this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label lbIntro; + private System.Windows.Forms.Label lbInfo2; + private System.Windows.Forms.Label lbInfo1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.LinkLabel linkLabelForum; + } +} Added: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.cs (rev 0) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.cs 2007-11-15 16:24:06 UTC (rev 1065) @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Text; +using System.Windows.Forms; + +namespace MyLyrics +{ + public partial class Information : UserControl + { + Form parent; + + public Information(Form parent) + { + this.parent = parent; + InitializeComponent(); + } + + private void linkLabelForum_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + System.Diagnostics.Process proc = new System.Diagnostics.Process(); + proc.StartInfo.FileName = "iexplore"; + proc.StartInfo.Arguments = "http://forum.team-mediaportal.com/my_lyrics_plugin-f163.html"; + proc.Start(); + } + } +} Added: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.resx =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.resx (rev 0) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.resx 2007-11-15 16:24:06 UTC (rev 1065) @@ -0,0 +1,134 @@ +<?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> + <data name="lbIntro.Text" xml:space="preserve"> + <value>The MyLyrics plugin makes it possible for you to see the lyric for the currently played song in MediaPortal. When playing a song in MediaPortal simple go into MyLyrics and the lyric for the song will be displayed. + +Also when run in configuration mode, you will be able to work on your lyrics database, import and export lyrics from music tags, and perform various types of searches.</value> + </data> + <data name="label2.Text" xml:space="preserve"> + <value>Here you can see your lyrics (containing the songs with a matching lyric) and your marked database (containing the songs that have been searched without any matching lyrics found). You can modify, import, and find an alternative title for a known song amont other things.</value> + </data> + <data name="label3.Text" xml:space="preserve"> + <value>This is where you can browsw your music database and manually select the songs taht you would like to search the Internet for. When a lyric is found it is added to the lyrics database. If not it is added to the marked database.</value> + </data> + <data name="label8.Text" xml:space="preserve"> + <value>Here you can set up the plugin as you prefer. E.g. you can choose the name to be shown for the plugin inside MediaPortal or if a found lyric should be stored in the tag of the music file. You can also tweak the settings regarding the "Find Lyrics" dialog accessable from the "Lyrics database" tab, and choose which sites you want to query in your searches.</value> + </data> +</root> \ No newline at end of file Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/ExportTags.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/ExportTags.cs 2007-11-15 15:33:55 UTC (rev 1064) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/ExportTags.cs 2007-11-15 16:24:06 UTC (rev 1065) @@ -38,7 +38,10 @@ MusicDatabase mDB = MusicDatabase.Instance; artists = new ArrayList(); songs = new List<Song>(); - mDB.GetArtists(0, "", ref artists); + mDB.GetAllArtists(ref artists); + //mDB.GetArtists(0, "", ref artists); + //mDB.Get + artists.Sort(); progressBar.ResetText(); Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/ImportTags.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/ImportTags.cs 2007-11-15 15:33:55 UTC (rev 1064) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/ImportTags.cs 2007-11-15 16:24:06 UTC (rev 1065) @@ -38,7 +38,8 @@ tags = new List<MusicTag>(); artists = new ArrayList(); songs = new List<Song>(); - mDB.GetArtists(0, "", ref artists); + //mDB.GetArtists(0, "", ref artists); + mDB.GetAllArtists(ref artists); artists.Sort(); progressBar.ResetText(); @@ -72,7 +73,7 @@ foreach (Song song in songs) { MusicTag tag = TagReader.ReadTag(song.FileName); - if (tag.Lyrics != string.Empty) + if (tag != null && tag.Lyrics != string.Empty) { tags.Add(tag); ++counter; Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.Designer.cs 2007-11-15 15:33:55 UTC (rev 1064) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.Designer.cs 2007-11-15 16:24:06 UTC (rev 1065) @@ -340,21 +340,21 @@ // // btResetMarkedLyricsDatabase // - this.btResetMarkedLyricsDatabase.Location = new System.Drawing.Point(426, 18); + this.btResetMarkedLyricsDatabase.Location = new System.Drawing.Point(451, 18); this.btResetMarkedLyricsDatabase.Name = "btResetMarkedLyricsDatabase"; - this.btResetMarkedLyricsDatabase.Size = new System.Drawing.Size(100, 23); + this.btResetMarkedLyricsDatabase.Size = new System.Drawing.Size(75, 23); this.btResetMarkedLyricsDatabase.TabIndex = 11; - this.btResetMarkedLyricsDatabase.Text = "Marked database"; + this.btResetMarkedLyricsDatabase.Text = "MarkedDB"; this.btResetMarkedLyricsDatabase.UseVisualStyleBackColor = true; this.btResetMarkedLyricsDatabase.Click += new System.EventHandler(this.button1_Click); // // btResetLyricsDatabase // - this.btResetLyricsDatabase.Location = new System.Drawing.Point(320, 17); + this.btResetLyricsDatabase.Location = new System.Drawing.Point(370, 18); this.btResetLyricsDatabase.Name = "btResetLyricsDatabase"; - this.btResetLyricsDatabase.Size = new System.Drawing.Size(100, 23); + this.btResetLyricsDatabase.Size = new System.Drawing.Size(75, 23); this.btResetLyricsDatabase.TabIndex = 10; - this.btResetLyricsDatabase.Text = "Lyrics database"; + this.btResetLyricsDatabase.Text = "LyricsDB"; this.btResetLyricsDatabase.UseVisualStyleBackColor = true; this.btResetLyricsDatabase.Click += new System.EventHandler(this.btResetDatabase_Click); // @@ -362,7 +362,7 @@ // this.lbResetDatabase.Location = new System.Drawing.Point(11, 14); this.lbResetDatabase.Name = "lbResetDatabase"; - this.lbResetDatabase.Size = new System.Drawing.Size(303, 30); + this.lbResetDatabase.Size = new System.Drawing.Size(353, 30); this.lbResetDatabase.TabIndex = 9; this.lbResetDatabase.Text = "Reset the lyrics database or the database with\r\nmarked titles. All data in the da" + "tabase will be permanately lost."; Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.Designer.cs 2007-11-15 15:33:55 UTC (rev 1064) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.Designer.cs 2007-11-15 16:24:06 UTC (rev 1065) @@ -14,37 +14,39 @@ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MusicDatabaseBrowse)); this.btDeselectAll = new System.Windows.Forms.Button(); this.btSelectAll = new System.Windows.Forms.Button(); - this.listViewSongs = new System.Windows.Forms.ListView(); + this.lvSongs = new System.Windows.Forms.ListView(); this.columnHeaderSong = new System.Windows.Forms.ColumnHeader(); this.columnHeaderDB = new System.Windows.Forms.ColumnHeader(); this.columnHeaderStatus = new System.Windows.Forms.ColumnHeader(); + this.imageList = new System.Windows.Forms.ImageList(this.components); this.lbArtistNumber = new System.Windows.Forms.Label(); - this.listViewSelectedSongs = new System.Windows.Forms.ListView(); + this.lvSelectedSongs = new System.Windows.Forms.ListView(); this.columnHeaderArtist2 = new System.Windows.Forms.ColumnHeader(); this.columnHeaderSong2 = new System.Windows.Forms.ColumnHeader(); this.columnHeaderDatabase2 = new System.Windows.Forms.ColumnHeader(); this.columnHeaderStatus2 = new System.Windows.Forms.ColumnHeader(); this.btAdd = new System.Windows.Forms.Button(); this.gbMusicDatabase = new System.Windows.Forms.GroupBox(); + this.btAddAll = new System.Windows.Forms.Button(); this.lbSelectedArtist = new System.Windows.Forms.Label(); - this.listViewArtists = new System.Windows.Forms.ListView(); + this.lvArtists = new System.Windows.Forms.ListView(); this.columnHeaderArtist = new System.Windows.Forms.ColumnHeader(); this.gbSelected = new System.Windows.Forms.GroupBox(); + this.btCancel = new System.Windows.Forms.Button(); + this.btRemoveAll = new System.Windows.Forms.Button(); this.btDeselectAll2 = new System.Windows.Forms.Button(); this.btSelectAll2 = new System.Windows.Forms.Button(); this.btRemove = new System.Windows.Forms.Button(); this.btSearch = new System.Windows.Forms.Button(); this.bw = new System.ComponentModel.BackgroundWorker(); - this.imageList = new System.Windows.Forms.ImageList(this.components); - this.btAddAll = new System.Windows.Forms.Button(); - this.btRemoveAll = new System.Windows.Forms.Button(); + this.lbStats = new System.Windows.Forms.Label(); this.gbMusicDatabase.SuspendLayout(); this.gbSelected.SuspendLayout(); this.SuspendLayout(); // // btDeselectAll // - this.btDeselectAll.Location = new System.Drawing.Point(437, 208); + this.btDeselectAll.Location = new System.Drawing.Point(437, 219); this.btDeselectAll.Name = "btDeselectAll"; this.btDeselectAll.Size = new System.Drawing.Size(75, 23); this.btDeselectAll.TabIndex = 10; @@ -54,7 +56,7 @@ // // btSelectAll // - this.btSelectAll.Location = new System.Drawing.Point(356, 208); + this.btSelectAll.Location = new System.Drawing.Point(356, 219); this.btSelectAll.Name = "btSelectAll"; this.btSelectAll.Size = new System.Drawing.Size(75, 23); this.btSelectAll.TabIndex = 9; @@ -62,22 +64,22 @@ this.btSelectAll.UseVisualStyleBackColor = true; this.btSelectAll.Click += new System.EventHandler(this.btSelectAll_Click); // - // listViewSongs + // lvSongs // - this.listViewSongs.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.lvSongs.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.columnHeaderSong, this.columnHeaderDB, this.columnHeaderStatus}); - this.listViewSongs.FullRowSelect = true; - this.listViewSongs.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; - this.listViewSongs.Location = new System.Drawing.Point(189, 38); - this.listViewSongs.Name = "listViewSongs"; - this.listViewSongs.Size = new System.Drawing.Size(332, 164); - this.listViewSongs.SmallImageList = this.imageList; - this.listViewSongs.Sorting = System.Windows.Forms.SortOrder.Ascending; - this.listViewSongs.TabIndex = 8; - this.listViewSongs.UseCompatibleStateImageBehavior = false; - this.listViewSongs.View = System.Windows.Forms.View.Details; + this.lvSongs.FullRowSelect = true; + this.lvSongs.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; + this.lvSongs.Location = new System.Drawing.Point(189, 33); + this.lvSongs.Name = "lvSongs"; + this.lvSongs.Size = new System.Drawing.Size(332, 164); + this.lvSongs.SmallImageList = this.imageList; + this.lvSongs.Sorting = System.Windows.Forms.SortOrder.Ascending; + this.lvSongs.TabIndex = 8; + this.lvSongs.UseCompatibleStateImageBehavior = false; + this.lvSongs.View = System.Windows.Forms.View.Details; // // columnHeaderSong // @@ -94,32 +96,38 @@ this.columnHeaderStatus.Text = "Status"; this.columnHeaderStatus.Width = 44; // + // imageList + // + this.imageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList.ImageStream"))); + this.imageList.TransparentColor = System.Drawing.Color.Transparent; + this.imageList.Images.SetKeyName(0, "yes.gif"); + // // lbArtistNumber // this.lbArtistNumber.AutoSize = true; - this.lbArtistNumber.Location = new System.Drawing.Point(11, 21); + this.lbArtistNumber.Location = new System.Drawing.Point(11, 16); this.lbArtistNumber.Name = "lbArtistNumber"; this.lbArtistNumber.Size = new System.Drawing.Size(67, 13); this.lbArtistNumber.TabIndex = 7; this.lbArtistNumber.Text = "[no of artists]"; // - // listViewSelectedSongs + // lvSelectedSongs // - this.listViewSelectedSongs.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.lvSelectedSongs.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.columnHeaderArtist2, this.columnHeaderSong2, this.columnHeaderDatabase2, this.columnHeaderStatus2}); - this.listViewSelectedSongs.FullRowSelect = true; - this.listViewSelectedSongs.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; - this.listViewSelectedSongs.Location = new System.Drawing.Point(11, 19); - this.listViewSelectedSongs.Name = "listViewSelectedSongs"; - this.listViewSelectedSongs.Size = new System.Drawing.Size(510, 164); - this.listViewSelectedSongs.SmallImageList = this.imageList; - this.listViewSelectedSongs.Sorting = System.Windows.Forms.SortOrder.Ascending; - this.listViewSelectedSongs.TabIndex = 11; - this.listViewSelectedSongs.UseCompatibleStateImageBehavior = false; - this.listViewSelectedSongs.View = System.Windows.Forms.View.Details; + this.lvSelectedSongs.FullRowSelect = true; + this.lvSelectedSongs.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; + this.lvSelectedSongs.Location = new System.Drawing.Point(11, 19); + this.lvSelectedSongs.Name = "lvSelectedSongs"; + this.lvSelectedSongs.Size = new System.Drawing.Size(510, 164); + this.lvSelectedSongs.SmallImageList = this.imageList; + this.lvSelectedSongs.Sorting = System.Windows.Forms.SortOrder.Ascending; + this.lvSelectedSongs.TabIndex = 11; + this.lvSelectedSongs.UseCompatibleStateImageBehavior = false; + this.lvSelectedSongs.View = System.Windows.Forms.View.Details; // // columnHeaderArtist2 // @@ -143,7 +151,7 @@ // // btAdd // - this.btAdd.Location = new System.Drawing.Point(275, 208); + this.btAdd.Location = new System.Drawing.Point(275, 219); this.btAdd.Name = "btAdd"; this.btAdd.Size = new System.Drawing.Size(75, 23); this.btAdd.TabIndex = 12; @@ -153,44 +161,55 @@ // // gbMusicDatabase // + this.gbMusicDatabase.Controls.Add(this.lbStats); this.gbMusicDatabase.Controls.Add(this.btAddAll); this.gbMusicDatabase.Controls.Add(this.lbSelectedArtist); - this.gbMusicDatabase.Controls.Add(this.listViewArtists); + this.gbMusicDatabase.Controls.Add(this.lvArtists); this.gbMusicDatabase.Controls.Add(this.btAdd); this.gbMusicDatabase.Controls.Add(this.btDeselectAll); this.gbMusicDatabase.Controls.Add(this.lbArtistNumber); this.gbMusicDatabase.Controls.Add(this.btSelectAll); - this.gbMusicDatabase.Controls.Add(this.listViewSongs); + this.gbMusicDatabase.Controls.Add(this.lvSongs); this.gbMusicDatabase.Location = new System.Drawing.Point(5, 5); this.gbMusicDatabase.Name = "gbMusicDatabase"; - this.gbMusicDatabase.Size = new System.Drawing.Size(538, 237); + this.gbMusicDatabase.Size = new System.Drawing.Size(538, 249); this.gbMusicDatabase.TabIndex = 13; this.gbMusicDatabase.TabStop = false; this.gbMusicDatabase.Text = "Select songs from music database"; // + // btAddAll + // + this.btAddAll.Location = new System.Drawing.Point(194, 219); + this.btAddAll.Name = "btAddAll"; + this.btAddAll.Size = new System.Drawing.Size(75, 23); + this.btAddAll.TabIndex = 15; + this.btAddAll.Text = "Add all"; + this.btAddAll.UseVisualStyleBackColor = true; + this.btAddAll.Click += new System.EventHandler(this.btAddAll_Click); + // // lbSelectedArtist // this.lbSelectedArtist.AutoSize = true; - this.lbSelectedArtist.Location = new System.Drawing.Point(191, 21); + this.lbSelectedArtist.Location = new System.Drawing.Point(191, 16); this.lbSelectedArtist.Name = "lbSelectedArtist"; this.lbSelectedArtist.Size = new System.Drawing.Size(78, 13); this.lbSelectedArtist.TabIndex = 14; this.lbSelectedArtist.Text = "[selected artist]"; // - // listViewArtists + // lvArtists // - this.listViewArtists.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.lvArtists.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.columnHeaderArtist}); - this.listViewArtists.FullRowSelect = true; - this.listViewArtists.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; - this.listViewArtists.Location = new System.Drawing.Point(11, 38); - this.listViewArtists.MultiSelect = false; - this.listViewArtists.Name = "listViewArtists"; - this.listViewArtists.Size = new System.Drawing.Size(172, 164); - this.listViewArtists.TabIndex = 13; - this.listViewArtists.UseCompatibleStateImageBehavior = false; - this.listViewArtists.View = System.Windows.Forms.View.Details; - this.listViewArtists.SelectedIndexChanged += new System.EventHandler(this.listViewArtists_SelectedIndexChanged); + this.lvArtists.FullRowSelect = true; + this.lvArtists.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; + this.lvArtists.Location = new System.Drawing.Point(11, 33); + this.lvArtists.MultiSelect = false; + this.lvArtists.Name = "lvArtists"; + this.lvArtists.Size = new System.Drawing.Size(172, 164); + this.lvArtists.TabIndex = 13; + this.lvArtists.UseCompatibleStateImageBehavior = false; + this.lvArtists.View = System.Windows.Forms.View.Details; + this.lvArtists.SelectedIndexChanged += new System.EventHandler(this.listViewArtists_SelectedIndexChanged); // // columnHeaderArtist // @@ -199,22 +218,44 @@ // // gbSelected // + this.gbSelected.Controls.Add(this.btCancel); this.gbSelected.Controls.Add(this.btRemoveAll); this.gbSelected.Controls.Add(this.btDeselectAll2); this.gbSelected.Controls.Add(this.btSelectAll2); this.gbSelected.Controls.Add(this.btRemove); this.gbSelected.Controls.Add(this.btSearch); - this.gbSelected.Controls.Add(this.listViewSelectedSongs); - this.gbSelected.Location = new System.Drawing.Point(5, 248); + this.gbSelected.Controls.Add(this.lvSelectedSongs); + this.gbSelected.Location = new System.Drawing.Point(5, 257); this.gbSelected.Name = "gbSelected"; this.gbSelected.Size = new System.Drawing.Size(538, 220); this.gbSelected.TabIndex = 14; this.gbSelected.TabStop = false; this.gbSelected.Text = "Selected songs from music database"; // + // btCancel + // + this.btCancel.Enabled = false; + this.btCancel.Location = new System.Drawing.Point(95, 189); + this.btCancel.Name = "btCancel"; + this.btCancel.Size = new System.Drawing.Size(75, 23); + this.btCancel.TabIndex = 17; + this.btCancel.Text = "Cancel"; + this.btCancel.UseVisualStyleBackColor = true; + this.btCancel.Click += new System.EventHandler(this.btCancel_Click); + // + // btRemoveAll + // + this.btRemoveAll.Location = new System.Drawing.Point(194, 191); + this.btRemoveAll.Name = "btRemoveAll"; + this.btRemoveAll.Size = new System.Drawing.Size(75, 23); + this.btRemoveAll.TabIndex = 16; + this.btRemoveAll.Text = "Remove all"; + this.btRemoveAll.UseVisualStyleBackColor = true; + this.btRemoveAll.Click += new System.EventHandler(this.btRemoveAll_Click); + // // btDeselectAll2 // - this.btDeselectAll2.Location = new System.Drawing.Point(351, 189); + this.btDeselectAll2.Location = new System.Drawing.Point(437, 191); this.btDeselectAll2.Name = "btDeselectAll2"; this.btDeselectAll2.Size = new System.Drawing.Size(75, 23); this.btDeselectAll2.TabIndex = 15; @@ -224,7 +265,7 @@ // // btSelectAll2 // - this.btSelectAll2.Location = new System.Drawing.Point(270, 189); + this.btSelectAll2.Location = new System.Drawing.Point(356, 191); this.btSelectAll2.Name = "btSelectAll2"; this.btSelectAll2.Size = new System.Drawing.Size(75, 23); this.btSelectAll2.TabIndex = 15; @@ -234,7 +275,7 @@ // // btRemove // - this.btRemove.Location = new System.Drawing.Point(189, 189); + this.btRemove.Location = new System.Drawing.Point(275, 191); this.btRemove.Name = "btRemove"; this.btRemove.Size = new System.Drawing.Size(75, 23); this.btRemove.TabIndex = 15; @@ -256,36 +297,21 @@ // bw // this.bw.WorkerReportsProgress = true; + this.bw.WorkerSupportsCancellation = true; this.bw.DoWork += new System.ComponentModel.DoWorkEventHandler(this.bw_DoWork); this.bw.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.bw_RunWorkerCompleted); this.bw.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.bw_ProgressChanged); // - // imageList + // lbStats // - this.imageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList.ImageStream"))); - this.imageList.TransparentColor = System.Drawing.Color.Transparent; - this.imageList.Images.SetKeyName(0, "yes.gif"); + this.lbStats.AutoSize = true; + this.lbStats.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lbStats.Location = new System.Drawing.Point(191, 201); + this.lbStats.Name = "lbStats"; + this.lbStats.Size = new System.Drawing.Size(35, 13); + this.lbStats.TabIndex = 17; + this.lbStats.Text = "[stats]"; // - // btAddAll - // - this.btAddAll.Location = new System.Drawing.Point(194, 208); - this.btAddAll.Name = "btAddAll"; - this.btAddAll.Size = new System.Drawing.Size(75, 23); - this.btAddAll.TabIndex = 15; - this.btAddAll.Text = "Add all"; - this.btAddAll.UseVisualStyleBackColor = true; - this.btAddAll.Click += new System.EventHandler(this.btAddAll_Click); - // - // btRemoveAll - // - this.btRemoveAll.Location = new System.Drawing.Point(108, 189); - this.btRemoveAll.Name = "btRemoveAll"; - this.btRemoveAll.Size = new System.Drawing.Size(75, 23); - this.btRemoveAll.TabIndex = 16; - this.btRemoveAll.Text = "Remove all"; - this.btRemoveAll.UseVisualStyleBackColor = true; - this.btRemoveAll.Click += new System.EventHandler(this.btRemoveAll_Click); - // // MusicDatabaseBrowse // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -306,19 +332,19 @@ private System.Windows.Forms.Button btDeselectAll; private System.Windows.Forms.Button btSelectAll; - private System.Windows.Forms.ListView listViewSongs; + private System.Windows.Forms.ListView lvSongs; private System.Windows.Forms.ColumnHeader columnHeaderSong; private System.Windows.Forms.ColumnHeader columnHeaderDB; private System.Windows.Forms.ColumnHeader columnHeaderStatus; private System.Windows.Forms.Label lbArtistNumber; - private System.Windows.Forms.ListView listViewSelectedSongs; + private System.Windows.Forms.ListView lvSelectedSongs; private System.Windows.Forms.ColumnHeader columnHeaderSong2; private System.Windows.Forms.ColumnHeader columnHeaderDatabase2; private System.Windows.Forms.ColumnHeader columnHeaderStatus2; private System.Windows.Forms.Button btAdd; private System.Windows.Forms.GroupBox gbMusicDatabase; private System.Windows.Forms.GroupBox gbSelected; - private System.Windows.Forms.ListView listViewArtists; + private System.Windows.Forms.ListView lvArtists; private System.Windows.Forms.ColumnHeader columnHeaderArtist; private System.Windows.Forms.Label lbSelectedArtist; private System.Windows.Forms.ColumnHeader columnHeaderArtist2; @@ -331,5 +357,7 @@ private System.ComponentModel.IContainer components; private System.Windows.Forms.Button btAddAll; private System.Windows.Forms.Button btRemoveAll; + private System.Windows.Forms.Button btCancel; + private System.Windows.Forms.Label lbStats; } } \ No newline at end of file Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.cs 2007-11-15 15:33:55 UTC (rev 1064) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.cs 2007-11-15 16:24:06 UTC (rev 1065) @@ -36,6 +36,11 @@ int m_noOfSearchesToComplete = 0; int m_noOfSearchesCompleted = 0; + bool m_lockButtons = true; + + Thread m_LyricControllerThread; + ManualResetEvent m_EventStopThread; + Queue<string[]> songs; LyricsController lc; @@ -47,11 +52,12 @@ private void ListboxArtistsUpdate(object sender, EventArgs e) { - MusicDatabase mdb = MusicDatabase.Instance; + MusicDatabase mDB = MusicDatabase.Instance; ArrayList artists = new ArrayList(); - mdb.GetArtists(0, String.Empty, ref artists); + //mdb.GetArtists(0, String.Empty, ref artists); + mDB.GetAllArtists(ref artists); - listViewArtists.Items.Clear(); + lvArtists.Items.Clear(); lbSelectedArtist.Text = String.Empty; m_DelegateStringUpdate = new DelegateStringUpdate(this.updateStringMethod); @@ -64,35 +70,35 @@ foreach (object artist in artists) { ListViewItem lvi = new ListViewItem((string)artist); - listViewArtists.Items.Add(lvi); + lvArtists.Items.Add(lvi); } - listViewArtists.Sorting = SortOrder.Ascending; - listViewSongs.Items.Clear(); - lbArtistNumber.Text = String.Format("{0} artists found", listViewArtists.Items.Count); + lvArtists.Sorting = SortOrder.Ascending; + lvSongs.Items.Clear(); + lbArtistNumber.Text = String.Format("{0} artists found", lvArtists.Items.Count); } private void btSelectAll_Click(object sender, EventArgs e) { - foreach (ListViewItem lvi in listViewSongs.Items) + foreach (ListViewItem lvi in lvSongs.Items) { lvi.Selected = true; } - listViewSongs.Select(); + lvSongs.Select(); } private void btDeselectAll_Click(object sender, EventArgs e) { - foreach (ListViewItem lvi in listViewSongs.Items) + foreach (ListViewItem lvi in lvSongs.Items) { lvi.Selected = false; } - listViewSongs.Select(); + lvSongs.Select(); } private void btAdd_Click(object sender, EventArgs e) { - foreach (ListViewItem lvi in listViewSongs.SelectedItems) + foreach (ListViewItem lvi in lvSongs.SelectedItems) { if (lvi.ImageIndex == -1) { @@ -105,15 +111,15 @@ newLvi.ImageIndex = lvi.ImageIndex; - listViewSelectedSongs.Items.Add(newLvi); + lvSelectedSongs.Items.Add(newLvi); } } - if (listViewSelectedSongs.Items.Count > 0) + if (lvSelectedSongs.Items.Count > 0) { btSearch.Enabled = true; btRemove.Enabled = true; - listViewSelectedSongs.Sort(); + lvSelectedSongs.Sort(); } } @@ -126,7 +132,7 @@ mdb.GetSongsByArtist(selectedArtist, ref songs); lbSelectedArtist.Text = String.Format("Artist: {0}", selectedArtist); - listViewSongs.Items.Clear(); + lvSongs.Items.Clear(); foreach (Song song in songs) { @@ -168,7 +174,7 @@ bool alreadyInCollection = false; - foreach (ListViewItem lviColl in listViewSongs.Items) + foreach (ListViewItem lviColl in lvSongs.Items) { if (lvi.Tag.Equals(lviColl.Tag)) { @@ -179,20 +185,20 @@ if (!alreadyInCollection) { - listViewSongs.Items.Add(lvi); + lvSongs.Items.Add(lvi); } } - + RefreshArtistStats(); } private void btRemove_Click(object sender, EventArgs e) { - foreach (ListViewItem lvi in listViewSelectedSongs.SelectedItems) + foreach (ListViewItem lvi in lvSelectedSongs.SelectedItems) { - listViewSelectedSongs.Items.Remove(lvi); + lvSelectedSongs.Items.Remove(lvi); } - if (listViewSelectedSongs.Items.Count == 0) + if (lvSelectedSongs.Items.Count == 0) { btSearch.Enabled = false; btRemove.Enabled = false; @@ -201,17 +207,21 @@ private void btSearch_Click(object sender, EventArgs e) { + m_lockButtons = false; + if (bw.IsBusy) { Thread.Sleep(2000); } - ((MyLyricsSetup)parent).btClose.Enabled = false; + MyLyricsSetup.UpdateLibraryUI = true; + ChangeButtonsEnableState(); + songs = new Queue<string[]>(); List<ListViewItem> items = new List<ListViewItem>(); - foreach (ListViewItem lvi in listViewSelectedSongs.Items) + foreach (ListViewItem lvi in lvSelectedSongs.Items) { ListViewItem lviClone = (ListViewItem)lvi.Clone(); if (lvi.ImageIndex == -1) @@ -221,8 +231,8 @@ items.Add(lviClone); } } - listViewSelectedSongs.Items.Clear(); - listViewSelectedSongs.Items.AddRange(items.ToArray()); + lvSelectedSongs.Items.Clear(); + lvSelectedSongs.Items.AddRange(items.ToArray()); List<string> sitesToSearch = new List<string>(); @@ -242,8 +252,7 @@ sitesToSearch.Add("SeekLyrics"); } - Thread m_LyricControllerThread; - ManualResetEvent m_EventStopThread = new ManualResetEvent(false); + m_EventStopThread = new ManualResetEvent(false); // If automaticUpdate is set then return after the first positive search lc = new LyricsController(this, m_EventStopThread, (string[])sitesToSearch.ToArray(), false, false); @@ -270,22 +279,73 @@ private void btSelectAll2_Click(object sender, EventArgs e) { - foreach (ListViewItem lvi in listViewSelectedSongs.Items) + foreach (ListViewItem lvi in lvSelectedSongs.Items) { lvi.Selected = true; } - listViewSelectedSongs.Select(); + lvSelectedSongs.Select(); } private void btDeselectAll2_Click(object sender, EventArgs e) { - foreach (ListViewItem lvi in listViewSelectedSongs.Items) + foreach (ListViewItem lvi in lvSelectedSongs.Items) { lvi.Selected = false; } - listViewSelectedSongs.Select(); + lvSelectedSongs.Select(); } + public void RefreshSongsListView() + { + if (lvArtists.SelectedIndices.Count > 0) + { + int index = lvArtists.SelectedIndices[0]; + lvArtists.Items[index].Selected = false; + lvArtists.Items[index].Selected = true; + } + } + + public void RefreshArtistStats() + { + int lyricsInLyricDB = 0; + int lyricsInMarkedDB = 0; + + foreach (ListViewItem lvi in lvSongs.Items) + { + if (lvi.SubItems[1].Text.Equals("LyricsDB")) + { + ++lyricsInLyricDB; + } + else if (lvi.SubItems[1].Text.Equals("MarkedDB")) + { + ++lyricsInMarkedDB; + } + } + lbStats.Text = string.Format("Lyrics: {0} - Lyrics in LyricsDB: {1} - Lyrics in MarkedDB: {2}", lvSongs.Items.Count, lyricsInLyricDB, lyricsInMarkedDB); + } + + private void ChangeSearchingSubI... [truncated message content] |