From: <sa...@us...> - 2009-01-01 11:54:31
|
Revision: 2482 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2482&view=rev Author: saamand Date: 2009-01-01 11:54:16 +0000 (Thu, 01 Jan 2009) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MyLyrics/LyricsEngine/LyricSearch.cs trunk/plugins/MyLyrics/LyricsEngine/LyricsEngine.csproj trunk/plugins/MyLyrics/LyricsEngine/Setup.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/FindLyric.Designer.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/FindLyric.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.cs 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.cs Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricSearch.cs =================================================================== (Binary files differ) Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsEngine.csproj =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsEngine.csproj 2008-12-30 22:11:28 UTC (rev 2481) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsEngine.csproj 2009-01-01 11:54:16 UTC (rev 2482) @@ -54,6 +54,7 @@ <Compile Include="LyricSearch.cs" /> <Compile Include="LyricDiagnostics.cs" /> <Compile Include="LyricsSites\Actionext.cs" /> + <Compile Include="LyricsSites\LyrDB.cs" /> <Compile Include="LyricsSites\HotLyrics.cs" /> <Compile Include="LyricsSites\Lyrics007.cs" /> <Compile Include="LyricsSites\LyricsOnDemand.cs" /> Modified: trunk/plugins/MyLyrics/LyricsEngine/Setup.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/Setup.cs 2008-12-30 22:11:28 UTC (rev 2481) +++ trunk/plugins/MyLyrics/LyricsEngine/Setup.cs 2009-01-01 11:54:16 UTC (rev 2482) @@ -6,13 +6,14 @@ { public static class Setup { - public static string[] BatchSearchSites = new string[6] + public static string[] BatchSearchSites = new string[7] { "LyricWiki", "Lyrics007", "LyricsOnDemand", "HotLyrics", "Actionext", + "LyrDB", "SeekLyrics" }; Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs 2008-12-30 22:11:28 UTC (rev 2481) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs 2009-01-01 11:54:16 UTC (rev 2482) @@ -78,7 +78,7 @@ this.lbInfo1.ForeColor = System.Drawing.Color.Black; this.lbInfo1.Location = new System.Drawing.Point(26, 30); this.lbInfo1.Name = "lbInfo1"; - this.lbInfo1.Size = new System.Drawing.Size(223, 18); + this.lbInfo1.Size = new System.Drawing.Size(197, 18); this.lbInfo1.TabIndex = 3; this.lbInfo1.Text = "MyLyrics plugin, version 1.20"; // @@ -106,7 +106,7 @@ // label5 // this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(12, 128); + this.label5.Location = new System.Drawing.Point(12, 129); this.label5.MaximumSize = new System.Drawing.Size(460, 0); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(371, 26); Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/FindLyric.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/FindLyric.Designer.cs 2008-12-30 22:11:28 UTC (rev 2481) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/FindLyric.Designer.cs 2009-01-01 11:54:16 UTC (rev 2482) @@ -51,6 +51,7 @@ this.cbLyricWiki = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.btClose = new System.Windows.Forms.Button(); this.btUpdate = new System.Windows.Forms.Button(); + this.cbLyrDB = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.gbSearchInfo.SuspendLayout(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); @@ -175,6 +176,7 @@ // // gbLyricSites // + this.gbLyricSites.Controls.Add(this.cbLyrDB); this.gbLyricSites.Controls.Add(this.cbActionext); this.gbLyricSites.Controls.Add(this.btCancel); this.gbLyricSites.Controls.Add(this.btFind); @@ -197,7 +199,7 @@ this.cbActionext.Checked = true; this.cbActionext.CheckState = System.Windows.Forms.CheckState.Checked; this.cbActionext.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.cbActionext.Location = new System.Drawing.Point(131, 43); + this.cbActionext.Location = new System.Drawing.Point(18, 44); this.cbActionext.Name = "cbActionext"; this.cbActionext.Size = new System.Drawing.Size(68, 17); this.cbActionext.TabIndex = 17; @@ -220,7 +222,7 @@ this.cbHotLyrics.Checked = true; this.cbHotLyrics.CheckState = System.Windows.Forms.CheckState.Checked; this.cbHotLyrics.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.cbHotLyrics.Location = new System.Drawing.Point(131, 21); + this.cbHotLyrics.Location = new System.Drawing.Point(346, 21); this.cbHotLyrics.Name = "cbHotLyrics"; this.cbHotLyrics.Size = new System.Drawing.Size(71, 17); this.cbHotLyrics.TabIndex = 14; @@ -233,7 +235,7 @@ this.cbSeekLyrics.Checked = true; this.cbSeekLyrics.CheckState = System.Windows.Forms.CheckState.Checked; this.cbSeekLyrics.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.cbSeekLyrics.Location = new System.Drawing.Point(131, 66); + this.cbSeekLyrics.Location = new System.Drawing.Point(246, 44); this.cbSeekLyrics.Name = "cbSeekLyrics"; this.cbSeekLyrics.Size = new System.Drawing.Size(79, 17); this.cbSeekLyrics.TabIndex = 15; @@ -246,7 +248,7 @@ this.cbLyricsOnDemand.Checked = true; this.cbLyricsOnDemand.CheckState = System.Windows.Forms.CheckState.Checked; this.cbLyricsOnDemand.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.cbLyricsOnDemand.Location = new System.Drawing.Point(16, 43); + this.cbLyricsOnDemand.Location = new System.Drawing.Point(111, 21); this.cbLyricsOnDemand.Name = "cbLyricsOnDemand"; this.cbLyricsOnDemand.Size = new System.Drawing.Size(108, 17); this.cbLyricsOnDemand.TabIndex = 12; @@ -259,7 +261,7 @@ this.cbLyrics007.Checked = true; this.cbLyrics007.CheckState = System.Windows.Forms.CheckState.Checked; this.cbLyrics007.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.cbLyrics007.Location = new System.Drawing.Point(16, 66); + this.cbLyrics007.Location = new System.Drawing.Point(246, 21); this.cbLyrics007.Name = "cbLyrics007"; this.cbLyrics007.Size = new System.Drawing.Size(72, 17); this.cbLyrics007.TabIndex = 13; @@ -300,6 +302,19 @@ this.btUpdate.UseVisualStyleBackColor = true; this.btUpdate.Click += new System.EventHandler(this.btUpdate_Click); // + // cbLyrDB + // + this.cbLyrDB.AutoSize = true; + this.cbLyrDB.Checked = true; + this.cbLyrDB.CheckState = System.Windows.Forms.CheckState.Checked; + this.cbLyrDB.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.cbLyrDB.Location = new System.Drawing.Point(111, 44); + this.cbLyrDB.Name = "cbLyrDB"; + this.cbLyrDB.Size = new System.Drawing.Size(53, 17); + this.cbLyrDB.TabIndex = 18; + this.cbLyrDB.Text = "LyrDB"; + this.cbLyrDB.UseVisualStyleBackColor = true; + // // FindLyric // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -355,5 +370,6 @@ private System.Windows.Forms.Button btUpdate; private System.Windows.Forms.Button btCancel; internal MediaPortal.UserInterface.Controls.MPCheckBox cbActionext; + internal MediaPortal.UserInterface.Controls.MPCheckBox cbLyrDB; } } \ No newline at end of file Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/FindLyric.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/FindLyric.cs 2008-12-30 22:11:28 UTC (rev 2481) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/FindLyric.cs 2009-01-01 11:54:16 UTC (rev 2482) @@ -84,6 +84,7 @@ { cbLyricWiki.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useLyricWiki", "True")).ToString().Equals("True") ? true : false; cbActionext.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useActionext", "True")).ToString().Equals("True") ? true : false; + cbLyrDB.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useLyrDB", "True")).ToString().Equals("True") ? true : false; cbLyrics007.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useLyrics007", "True")).ToString().Equals("True") ? true : false; cbLyricsOnDemand.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useLyricsOnDemand", "True")).ToString().Equals("True") ? true : false; cbSeekLyrics.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useSeekLyrics", "True")).ToString().Equals("True") ? true : false; @@ -159,6 +160,10 @@ { sitesToSearch.Add("Actionext"); } + if (cbLyrDB.Checked) + { + sitesToSearch.Add("LyrDB"); + } if (cbHotLyrics.Checked) { sitesToSearch.Add("HotLyrics"); Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.cs 2008-12-30 22:11:28 UTC (rev 2481) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.cs 2009-01-01 11:54:16 UTC (rev 2482) @@ -310,6 +310,8 @@ sitesToSearch.Add("LyricWiki"); if (((string)xmlreader.GetValueAsString("myLyrics", "useActionext", "True")).ToString().Equals("True")) sitesToSearch.Add("Actionext"); + if (((string)xmlreader.GetValueAsString("myLyrics", "useLyrDB", "True")).ToString().Equals("True")) + sitesToSearch.Add("LyrDB"); if (((string)xmlreader.GetValueAsString("myLyrics", "useLyrics007", "True")).ToString().Equals("True")) sitesToSearch.Add("Lyrics007"); if (((string)xmlreader.GetValueAsString("myLyrics", "useLyricsOnDemand", "True")).ToString().Equals("True")) Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs 2008-12-30 22:11:28 UTC (rev 2481) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs 2009-01-01 11:54:16 UTC (rev 2482) @@ -107,6 +107,7 @@ this.tabPageAbout = new System.Windows.Forms.TabPage(); this.btClose = new MediaPortal.UserInterface.Controls.MPButton(); this.bgWorkerSearch = new System.ComponentModel.BackgroundWorker(); + this.cbLyrDB = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.tabControl.SuspendLayout(); this.tabPageDatabase.SuspendLayout(); this.gbGenerel.SuspendLayout(); @@ -623,8 +624,6 @@ // cbMusicTagAlwaysCheck // this.cbMusicTagAlwaysCheck.AutoSize = true; - this.cbMusicTagAlwaysCheck.Checked = true; - this.cbMusicTagAlwaysCheck.CheckState = System.Windows.Forms.CheckState.Checked; this.cbMusicTagAlwaysCheck.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.cbMusicTagAlwaysCheck.Location = new System.Drawing.Point(17, 20); this.cbMusicTagAlwaysCheck.Name = "cbMusicTagAlwaysCheck"; @@ -637,8 +636,6 @@ // cbMusicTagWrite // this.cbMusicTagWrite.AutoSize = true; - this.cbMusicTagWrite.Checked = true; - this.cbMusicTagWrite.CheckState = System.Windows.Forms.CheckState.Checked; this.cbMusicTagWrite.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.cbMusicTagWrite.Location = new System.Drawing.Point(17, 43); this.cbMusicTagWrite.Name = "cbMusicTagWrite"; @@ -749,6 +746,7 @@ // // groupBox2 // + this.groupBox2.Controls.Add(this.cbLyrDB); this.groupBox2.Controls.Add(this.cbActionext); this.groupBox2.Controls.Add(this.cbLyrics007); this.groupBox2.Controls.Add(this.cbLyricWiki); @@ -838,7 +836,7 @@ this.cbSeekLyrics.Checked = true; this.cbSeekLyrics.CheckState = System.Windows.Forms.CheckState.Checked; this.cbSeekLyrics.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.cbSeekLyrics.Location = new System.Drawing.Point(131, 71); + this.cbSeekLyrics.Location = new System.Drawing.Point(216, 26); this.cbSeekLyrics.Name = "cbSeekLyrics"; this.cbSeekLyrics.Size = new System.Drawing.Size(79, 17); this.cbSeekLyrics.TabIndex = 6; @@ -997,6 +995,20 @@ this.bgWorkerSearch.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.bgWorkerSearch_RunWorkerCompleted); this.bgWorkerSearch.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.bgWorkerSearch_ProgressChanged); // + // cbLyrDB + // + this.cbLyrDB.AutoSize = true; + this.cbLyrDB.Checked = true; + this.cbLyrDB.CheckState = System.Windows.Forms.CheckState.Checked; + this.cbLyrDB.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.cbLyrDB.Location = new System.Drawing.Point(131, 71); + this.cbLyrDB.Name = "cbLyrDB"; + this.cbLyrDB.Size = new System.Drawing.Size(53, 17); + this.cbLyrDB.TabIndex = 9; + this.cbLyrDB.Text = "LyrDB"; + this.cbLyrDB.UseVisualStyleBackColor = true; + this.cbLyrDB.Leave += new System.EventHandler(this.WriteMediaPortalXML); + // // MyLyricsSetup // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -1126,5 +1138,6 @@ private MediaPortal.UserInterface.Controls.MPLabel lbArtist; internal MediaPortal.UserInterface.Controls.MPCheckBox cbMusicTagAlwaysCheck; private MediaPortal.UserInterface.Controls.MPCheckBox cbDisregardSongWithLyricInTag; + internal MediaPortal.UserInterface.Controls.MPCheckBox cbLyrDB; } } \ No newline at end of file Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.cs 2008-12-30 22:11:28 UTC (rev 2481) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.cs 2009-01-01 11:54:16 UTC (rev 2482) @@ -151,77 +151,8 @@ #endregion - #region Get settings from in MediaPortal.xml - using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MediaPortal.xml")) - { - try - { - tbLimit.Text = xmlreader.GetValueAsString("myLyrics", "limit", m_TotalTitles.ToString()); - tbPluginName.Text = xmlreader.GetValueAsString("myLyrics", "pluginsName", "My Lyrics"); + GetSettingsFromConfigurationXml(); - cbAutoFetch.Checked = xmlreader.GetValue("myLyrics", "automaticFetch").Equals("yes"); - cbAutomaticUpdate.Checked = xmlreader.GetValue("myLyrics", "automaticUpdateWhenFirstFound").Equals("yes"); - cbMoveSongFrom.Checked = xmlreader.GetValue("myLyrics", "moveLyricFromMarkedDatabase").Equals("yes"); - - m_automaticWriteToMusicTag = !xmlreader.GetValue("myLyrics", "automaticWriteToMusicTag").Equals("no"); - cbMusicTagWrite.Checked = m_automaticWriteToMusicTag; - - m_automaticReadFromToMusicTag = !xmlreader.GetValue("myLyrics", "automaticReadFromToMusicTag").Equals("no"); - cbMusicTagAlwaysCheck.Checked = m_automaticReadFromToMusicTag; - - lbSongsLimitNote.Text = ("(You have currently " + m_TotalTitles.ToString() + " titles in your music database)"); - - trackBar.Value = ((int)xmlreader.GetValueAsInt("myLyrics", "defaultSitesModeValue", 2)); - rdDefault.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useDefaultSitesMode", "True")).ToString().Equals("True") ? true : false; - - m_find = xmlreader.GetValueAsString("myLyrics", "find", ""); - m_replace = xmlreader.GetValueAsString("myLyrics", "replace", ""); - - if (m_find != "") - { - - string[] findArray = m_find.Split(','); - string[] replaceArray = m_replace.Split(','); - int valueIndex = 0; - - foreach (string findValue in findArray) - { - - if (findValue != "") - { - dbGridView.Rows.Insert(valueIndex, 1); - DataGridViewRow row = dbGridView.Rows[valueIndex]; - row.Cells[0].Value = findValue; - row.Cells[1].Value = replaceArray[valueIndex]; - valueIndex++; - } - } - } - - if (!rdDefault.Checked) - { - trackBar.Enabled = false; - rbUserDefined.Checked = true; - - cbLyricWiki.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useLyricWiki", "True")).ToString().Equals("True") ? true : false; - cbActionext.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useActionext", "True")).ToString().Equals("True") ? true : false; - cbLyrics007.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useLyrics007", "True")).ToString().Equals("True") ? true : false; - cbLyricsOnDemand.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useLyricsOnDemand", "True")).ToString().Equals("True") ? true : false; - cbSeekLyrics.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useSeekLyrics", "True")).ToString().Equals("True") ? true : false; - cbHotLyrics.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useHotLyrics", "True")).ToString().Equals("True") ? true : false; - } - } - catch (Exception ex) - { - - MessageBox.Show("Something has gone wrong when reading Mediaportal.xml (" + ex.Message + ")"); - } - } - - m_strippedPrefixStrings = MediaPortalUtil.GetStrippedPrefixStringArray(); - - #endregion - #region Serialzie/deserialize lyricsdatabases string lyricsXMLpath = MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Base, MyLyricsSettings.LyricsXMLName); FileInfo lyricsXMLfileInfo = new FileInfo(lyricsXMLpath); @@ -307,7 +238,82 @@ lyricsLibraryUC.updateLyricsTree(false); } + private void GetSettingsFromConfigurationXml() + { + #region Get settings from in MediaPortal.xml + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MediaPortal.xml")) + { + try + { + tbLimit.Text = xmlreader.GetValueAsString("myLyrics", "limit", m_TotalTitles.ToString()); + tbPluginName.Text = xmlreader.GetValueAsString("myLyrics", "pluginsName", "My Lyrics"); + cbAutoFetch.Checked = xmlreader.GetValue("myLyrics", "automaticFetch").Equals("yes"); + cbAutomaticUpdate.Checked = xmlreader.GetValue("myLyrics", "automaticUpdateWhenFirstFound").Equals("yes"); + cbMoveSongFrom.Checked = xmlreader.GetValue("myLyrics", "moveLyricFromMarkedDatabase").Equals("yes"); + + m_automaticWriteToMusicTag = xmlreader.GetValue("myLyrics", "automaticWriteToMusicTag").Equals("yes"); + cbMusicTagWrite.Checked = m_automaticWriteToMusicTag; + + m_automaticReadFromToMusicTag = xmlreader.GetValue("myLyrics", "automaticReadFromToMusicTag").Equals("yes"); + cbMusicTagAlwaysCheck.Checked = m_automaticReadFromToMusicTag; + + lbSongsLimitNote.Text = ("(You have currently " + m_TotalTitles.ToString() + " titles in your music database)"); + + trackBar.Value = ((int)xmlreader.GetValueAsInt("myLyrics", "defaultSitesModeValue", 2)); + rdDefault.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useDefaultSitesMode", "True")).ToString().Equals("True") ? true : false; + + m_find = xmlreader.GetValueAsString("myLyrics", "find", ""); + m_replace = xmlreader.GetValueAsString("myLyrics", "replace", ""); + + if (m_find != "") + { + + string[] findArray = m_find.Split(','); + string[] replaceArray = m_replace.Split(','); + int valueIndex = 0; + + foreach (string findValue in findArray) + { + + if (findValue != "") + { + dbGridView.Rows.Insert(valueIndex, 1); + DataGridViewRow row = dbGridView.Rows[valueIndex]; + row.Cells[0].Value = findValue; + row.Cells[1].Value = replaceArray[valueIndex]; + valueIndex++; + } + } + } + + if (!rdDefault.Checked) + { + trackBar.Enabled = false; + rbUserDefined.Checked = true; + + cbLyricWiki.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useLyricWiki", "True")).ToString().Equals("True") ? true : false; + cbActionext.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useActionext", "True")).ToString().Equals("True") ? true : false; + cbLyrDB.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useLyrDB", "True")).ToString().Equals("True") ? true : false; + cbLyrics007.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useLyrics007", "True")).ToString().Equals("True") ? true : false; + cbLyricsOnDemand.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useLyricsOnDemand", "True")).ToString().Equals("True") ? true : false; + cbSeekLyrics.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useSeekLyrics", "True")).ToString().Equals("True") ? true : false; + cbHotLyrics.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useHotLyrics", "True")).ToString().Equals("True") ? true : false; + } + } + catch (Exception ex) + { + + MessageBox.Show("Something has gone wrong when reading Mediaportal.xml (" + ex.Message + ")"); + } + } + + m_strippedPrefixStrings = MediaPortalUtil.GetStrippedPrefixStringArray(); + + #endregion + } + + // Stop worker thread if it is running. // Called when user presses Stop button of form is closed. private void StopThread() @@ -379,6 +385,8 @@ Thread.Sleep(2000); } + GetSettingsFromConfigurationXml(); + MyLyricsSetup.UpdateLibraryUI = true; stopwatch.StartZero(); @@ -407,6 +415,13 @@ m_Limit = int.Parse(tbLimit.Text); + + if (m_Limit == 0) + { + ThreadFinished = new string[] { "", "", "You must select a number of songs to search", "error" }; + return; + } + m_DisregardKnownLyric = cbDisconsiderTitlesWithLyrics.Enabled && cbDisconsiderTitlesWithLyrics.Checked; m_MarkSongsWhenNoLyricFound = cbMarkSongsWithNoLyrics.Enabled && cbMarkSongsWithNoLyrics.Checked; m_DisregardMarkedLyric = cbDisregardSongsWithNoLyric.Enabled && cbDisregardSongsWithNoLyric.Checked; @@ -448,6 +463,8 @@ sitesToSearch.Add("LyricWiki"); if (cbActionext.Checked) sitesToSearch.Add("Actionext"); + if (cbLyrDB.Checked) + sitesToSearch.Add("LyrDB"); if (cbLyrics007.Checked) sitesToSearch.Add("Lyrics007"); if (cbLyricsOnDemand.Checked) @@ -457,8 +474,15 @@ if (cbHotLyrics.Checked) sitesToSearch.Add("HotLyrics"); + if (sitesToSearch.Count == 0) + { + ThreadFinished = new string[] { "", "", "You haven't selected any sites to search", "error" }; + return; + } + sitesToSearchArray = (string[])sitesToSearch.ToArray(typeof(string)); + m_EventStopThread.Reset(); bgWorkerSearch.RunWorkerAsync(); @@ -549,8 +573,18 @@ StopThread(); progressBar.ResetText(); progressBar.Enabled = false; - lbStep1a.Text = "Completed"; - lbStep2a.Text = "Completed"; + + if (site.Equals("error")) + { + lbStep1a.Text = "-"; + lbStep2a.Text = "-"; + } + else + { + lbStep1a.Text = "Completed"; + lbStep2a.Text = "Completed"; + } + lbMessage.Text = "#" + ((int)(++m_noOfMessages)).ToString() + " - " + message + "\r\n" + lbMessage.Text + "\r\n"; btStartBatchSearch.Enabled = true; btCancel.Enabled = false; @@ -620,14 +654,14 @@ #region 1. Sorting song lyricConfigInfosQueue = new Queue(); + mDB = MusicDatabase.Instance; + if (m_SearchOnlyMarkedSongs == false) { //System.IO.Directory.SetCurrentDirectory(@"C:\Program Files\Team MediaPortal\MediaPortal"); //string test = System.IO.Directory.GetCurrentDirectory(); - mDB = MusicDatabase.Instance; - mDB.GetAllArtists(ref artists); m_noOfArtistsToSearch = artists.Count; @@ -752,9 +786,11 @@ { m_SongsToSearchOnline.Enqueue(new string[2] { song[0], song[1] }); } - else + + if (stopCollectingOfTitles) { - //bwMusicTagSearch.ReportProgress(rowNumberInListView); + bgWorkerSearch.CancelAsync(); + return; } } @@ -980,6 +1016,7 @@ cbHotLyrics.Checked = false; cbSeekLyrics.Checked = false; cbActionext.Checked = false; + cbLyrDB.Checked = false; } else if (trackBar.Value == 1) { @@ -989,6 +1026,7 @@ cbHotLyrics.Checked = false; cbSeekLyrics.Checked = false; cbActionext.Checked = false; + cbLyrDB.Checked = false; } else if (trackBar.Value == 2) { @@ -997,6 +1035,7 @@ cbLyricWiki.Checked = true; cbHotLyrics.Checked = true; cbActionext.Checked = true; + cbLyrDB.Checked = true; cbSeekLyrics.Checked = false; } else if (trackBar.Value == 3) @@ -1006,6 +1045,7 @@ cbLyricWiki.Checked = true; cbHotLyrics.Checked = true; cbSeekLyrics.Checked = true; + cbLyrDB.Checked = true; cbActionext.Checked = true; } @@ -1037,6 +1077,7 @@ cbHotLyrics.Enabled = false; cbSeekLyrics.Enabled = false; cbActionext.Enabled = false; + cbLyrDB.Enabled = false; trackBar_Scroll(null, null); } else @@ -1048,6 +1089,7 @@ cbHotLyrics.Enabled = true; cbSeekLyrics.Enabled = true; cbActionext.Enabled = true; + cbLyrDB.Enabled = true; } } @@ -1061,6 +1103,7 @@ xmlwriter.SetValue("myLyrics", "pluginsName", tbPluginName.Text); xmlwriter.SetValue("myLyrics", "useLyricWiki", cbLyricWiki.Checked.ToString()); xmlwriter.SetValue("myLyrics", "useActionext", cbActionext.Checked.ToString()); + xmlwriter.SetValue("myLyrics", "useLyrDB", cbLyrDB.Checked.ToString()); xmlwriter.SetValue("myLyrics", "useLyrics007", cbLyrics007.Checked.ToString()); xmlwriter.SetValue("myLyrics", "useLyricsOnDemand", cbLyricsOnDemand.Checked.ToString()); xmlwriter.SetValue("myLyrics", "useSeekLyrics", cbSeekLyrics.Checked.ToString()); Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2008-12-30 22:11:28 UTC (rev 2481) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2009-01-01 11:54:16 UTC (rev 2482) @@ -185,6 +185,7 @@ GetID = (int)GUIMyLyrics.WINDOW_MYLYRICS; + GUIGraphicsContext.ResetLastActivity(); } public override bool Init() @@ -333,7 +334,7 @@ resetGUI(selectedScreen); - bool useLyricWiki, useLyrics007, useLyricsOnDemand, useSeekLyrics, useHotLyrics, useActionext; + bool useLyricWiki, useLyrics007, useLyricsOnDemand, useSeekLyrics, useHotLyrics, useActionext, useLyrDB; using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MediaPortal.xml")) { @@ -344,6 +345,7 @@ useSeekLyrics = ((string)xmlreader.GetValueAsString("myLyrics", "useSeekLyrics", "True")).ToString().Equals("True") ? true : false; useHotLyrics = ((string)xmlreader.GetValueAsString("myLyrics", "useHotLyrics", "True")).ToString().Equals("True") ? true : false; useActionext = ((string)xmlreader.GetValueAsString("myLyrics", "useActionext", "True")).ToString().Equals("True") ? true : false; + useLyrDB = ((string)xmlreader.GetValueAsString("myLyrics", "useLyrDB", "True")).ToString().Equals("True") ? true : false; m_automaticWriteToMusicTag = xmlreader.GetValue("myLyrics", "automaticWriteToMusicTag").Equals("yes"); @@ -366,6 +368,10 @@ { sitesToSearch.Add("Actionext"); } + if (useActionext && Setup.IsMember("LyrDB")) + { + sitesToSearch.Add("LyrDB"); + } if (useLyrics007 && Setup.IsMember("Lyrics007")) { sitesToSearch.Add("Lyrics007"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |