From: <sa...@us...> - 2008-12-11 17:13:09
|
Revision: 2416 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2416&view=rev Author: saamand Date: 2008-12-11 17:13:03 +0000 (Thu, 11 Dec 2008) Log Message: ----------- 1.10RC1 Modified Paths: -------------- trunk/plugins/MyLyrics/LyricsEngine/LyricSearch.cs trunk/plugins/MyLyrics/LyricsEngine/LyricUtil.cs trunk/plugins/MyLyrics/LyricsEngine/LyricsController.cs trunk/plugins/MyLyrics/LyricsEngine/LyricsDatabase/LyricsItem.cs trunk/plugins/MyLyrics/LyricsEngine/LyricsEngine.csproj 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/LyricsEngine/Properties/AssemblyInfo.cs trunk/plugins/MyLyrics/LyricsEngine/Properties/Resources.Designer.cs trunk/plugins/MyLyrics/LyricsEngine/Properties/Settings.Designer.cs trunk/plugins/MyLyrics/LyricsEngine/Setup.cs trunk/plugins/MyLyrics/LyricsEngine/Web References/org.lyricwiki/Reference.cs trunk/plugins/MyLyrics/My Lyrics/DatabaseUtil.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.resx 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/LyricsLibrary.Designer.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.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 Configuration/MyLyricsSetup_test.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj trunk/plugins/MyLyrics/My Lyrics/MyLyricsExternCode.cs trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs trunk/plugins/MyLyrics/My Lyrics/Properties/Resources.Designer.cs trunk/plugins/MyLyrics/My Lyrics/TagReaderUtil.cs trunk/plugins/MyLyrics/MyLyrics.sln Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricSearch.cs =================================================================== (Binary files differ) Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricUtil.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricUtil.cs 2008-12-11 17:00:53 UTC (rev 2415) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricUtil.cs 2008-12-11 17:13:03 UTC (rev 2416) @@ -77,5 +77,15 @@ return str; } + + public static string CleanLyrics(string lyrics) + { + while (lyrics.Contains(@"''")) + { + lyrics = lyrics.Replace(@"''", "'"); + } + + return lyrics; + } } } Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsController.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsController.cs 2008-12-11 17:00:53 UTC (rev 2415) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsController.cs 2008-12-11 17:13:03 UTC (rev 2416) @@ -185,11 +185,13 @@ internal void LyricFound(String lyricStrings, String artist, String title, String site) { + string cleanLyric = LyricUtil.CleanLyrics(lyricStrings); + --m_noOfCurrentSearches; if (m_allowAllToComplete || m_StopSearches == false) { - m_Form.LyricFound = new Object[] { lyricStrings, artist, title, site }; + m_Form.LyricFound = new Object[] { cleanLyric, artist, title, site }; StatusUpdate(artist, title, site, true); } } Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsDatabase/LyricsItem.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsDatabase/LyricsItem.cs 2008-12-11 17:00:53 UTC (rev 2415) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsDatabase/LyricsItem.cs 2008-12-11 17:13:03 UTC (rev 2416) @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Text; using System.Runtime.Serialization; +using System.Text.RegularExpressions; namespace MyLyrics { Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsEngine.csproj =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsEngine.csproj 2008-12-11 17:00:53 UTC (rev 2415) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsEngine.csproj 2008-12-11 17:13:03 UTC (rev 2416) @@ -1,8 +1,8 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProductVersion>8.0.50727</ProductVersion> + <ProductVersion>9.0.21022</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{B0760CE8-086F-4301-9091-C9BE54F261FD}</ProjectGuid> <OutputType>Library</OutputType> @@ -11,6 +11,11 @@ <AssemblyName>LyricsEngine</AssemblyName> <StartupObject> </StartupObject> + <FileUpgradeFlags> + </FileUpgradeFlags> + <UpgradeBackupLocation> + </UpgradeBackupLocation> + <OldToolsVersion>2.0</OldToolsVersion> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> @@ -48,11 +53,14 @@ <Compile Include="LyricsDatabase\LyricsItem.cs" /> <Compile Include="LyricSearch.cs" /> <Compile Include="LyricDiagnostics.cs" /> + <Compile Include="LyricsSites\Actionext.cs" /> <Compile Include="LyricsSites\HotLyrics.cs" /> - <Compile Include="LyricsSites\EvilLabs.cs" /> <Compile Include="LyricsSites\Lyrics007.cs" /> <Compile Include="LyricsSites\LyricsOnDemand.cs" /> <Compile Include="LyricsSites\SeekLyrics.cs" /> + <Compile Include="LyricsWebClient.cs"> + <SubType>Component</SubType> + </Compile> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="ICommand.cs" /> <Compile Include="ILyricForm.cs" /> Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/HotLyrics.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/HotLyrics.cs 2008-12-11 17:00:53 UTC (rev 2415) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/HotLyrics.cs 2008-12-11 17:13:03 UTC (rev 2416) @@ -100,7 +100,7 @@ string urlString = "http://www.hotlyrics.net/lyrics/" + firstLetter + "/" + artist + "/" + title + ".html"; - WebClient client = new WebClient(); + LyricsWebClient client = new LyricsWebClient(); timer.Enabled = true; timer.Interval = timeLimit; @@ -129,7 +129,7 @@ bool thisMayBeTheCorrectLyric = true; StringBuilder lyricTemp = new StringBuilder(); - WebClient client = (WebClient)sender; + LyricsWebClient client = (LyricsWebClient)sender; Stream reply = null; StreamReader sr = null; @@ -186,7 +186,6 @@ lyric = lyricTemp.ToString().Trim(); - // if warning message from Evil Labs' sql-server, then lyric isn't found if (lyric.Contains("<td")) { lyric = "Not found"; Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Lyrics007.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Lyrics007.cs 2008-12-11 17:00:53 UTC (rev 2415) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Lyrics007.cs 2008-12-11 17:13:03 UTC (rev 2416) @@ -6,6 +6,7 @@ using System.Net; using System.Threading; using System.Timers; +using System.Text.RegularExpressions; namespace LyricsEngine.LyricSites { @@ -39,14 +40,13 @@ string urlString = "http://www.lyrics007.com/" + artist + " Lyrics/" + title + " Lyrics.html"; - WebClient client = new WebClient(); - timer.Enabled = true; timer.Interval = timeLimit; timer.Elapsed += new ElapsedEventHandler(timer_Elapsed); timer.Start(); Uri uri = new Uri(urlString); + LyricsWebClient client = new LyricsWebClient(); client.OpenReadCompleted += new System.Net.OpenReadCompletedEventHandler(callbackMethod); client.OpenReadAsync(uri); @@ -66,10 +66,7 @@ private void callbackMethod(object sender, OpenReadCompletedEventArgs e) { - bool thisMayBeTheCorrectLyric = true; - StringBuilder lyricTemp = new StringBuilder(); - - WebClient client = (WebClient)sender; + LyricsWebClient client = (LyricsWebClient)sender; Stream reply = null; StreamReader sr = null; @@ -78,66 +75,49 @@ reply = (Stream)e.Result; sr = new StreamReader(reply); - string line = ""; - int noOfLinesCount = 0; + string line = sr.ReadToEnd(); - while (line.IndexOf("<td>Song: <strong>") == -1 && line.IndexOf("polyphonic ringtone to your cell phone") == -1) + // Replace the new line stuff in the result, as the regex might have problems + line = line.Replace("\n", ""); + line = line.Replace("\r", ""); + line = line.Replace("\t", ""); + + //string pat = @"<script\s*type=""text/javascript""\s*src=""http://www2\.ringtonematcher\.com/jsstatic/lyrics007\.js""></script>.*?</div>(.*?)<div.*"; + //string pat = @"src=""/images/phone2.gif""><br><br><br></div>(.*?)<div align=center>"; + string pat = @"<br><br><br></div>(.*?)<div.*"; + + // Compile the regular expression. + Regex r = new Regex(pat, RegexOptions.IgnoreCase); + // Match the regular expression pattern against a text string. + Match m = r.Match(line); + if (m.Success) { - if (sr.EndOfStream || ++noOfLinesCount > 300) + Group g1 = m.Groups[1]; + foreach (Capture c1 in g1.Captures) { - thisMayBeTheCorrectLyric = false; - break; + lyric = c1.Value; } - else - { - line = sr.ReadLine(); - } } - if (thisMayBeTheCorrectLyric) + if (lyric.Length > 0) { - lyricTemp = new StringBuilder(); - string textToCutFrom = @"<tr><td width=10></td><td>"; - int indexToCutFrom = line.LastIndexOf(textToCutFrom) + textToCutFrom.Length; - lyricTemp.Append(line.Substring(indexToCutFrom)); - line = sr.ReadLine(); - - while (line.IndexOf("The hottest songs") == -1 && line.IndexOf("Maybe you are looking for:") == -1) - { - lyricTemp.Append(line); - if (sr.EndOfStream || ++noOfLinesCount > 300) - { - thisMayBeTheCorrectLyric = false; - break; - } - else - { - line = sr.ReadLine(); - } - } - - lyricTemp.Replace("??s", "'s"); - lyricTemp.Replace("??t", "'t"); - lyricTemp.Replace("??m", "'m"); - lyricTemp.Replace("??l", "'l"); - lyricTemp.Replace("??v", "'v"); - lyricTemp.Replace("?s", "'s"); - lyricTemp.Replace("?t", "'t"); - lyricTemp.Replace("?m", "'m"); - lyricTemp.Replace("?l", "'l"); - lyricTemp.Replace("?v", "'v"); - lyricTemp.Replace("<br>", "\r\n"); - lyricTemp.Replace("<br />", "\r\n"); - lyricTemp.Replace("<BR>", "\r\n"); - - lyric = lyricTemp.ToString().Trim(); - - // if warning message from Evil Labs' sql-server, then lyric isn't found - if (lyric.Contains("<td")) - { - lyric = "Not found"; - } + lyric = lyric.Replace("??s", "'s"); + lyric = lyric.Replace("??t", "'t"); + lyric = lyric.Replace("??m", "'m"); + lyric = lyric.Replace("??l", "'l"); + lyric = lyric.Replace("??v", "'v"); + lyric = lyric.Replace("?s", "'s"); + lyric = lyric.Replace("?t", "'t"); + lyric = lyric.Replace("?m", "'m"); + lyric = lyric.Replace("?l", "'l"); + lyric = lyric.Replace("?v", "'v"); + lyric = lyric.Replace("<br>", "\r\n"); + lyric = lyric.Replace("<br />", "\r\n"); + lyric = lyric.Replace("<BR>", "\r\n"); + lyric = lyric.Trim(); } + else + lyric = "Not found"; } catch (Exception) { Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyricsOnDemand.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyricsOnDemand.cs 2008-12-11 17:00:53 UTC (rev 2415) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyricsOnDemand.cs 2008-12-11 17:13:03 UTC (rev 2416) @@ -69,7 +69,7 @@ string urlString = "http://www.lyricsondemand.com/" + firstLetter + "/" + artist + "lyrics/" + title + "lyrics.html"; - WebClient client = new WebClient(); + LyricsWebClient client = new LyricsWebClient(); timer.Enabled = true; timer.Interval = timeLimit; @@ -98,7 +98,7 @@ bool thisMayBeTheCorrectLyric = true; StringBuilder lyricTemp = new StringBuilder(); - WebClient client = (WebClient)sender; + LyricsWebClient client = (LyricsWebClient)sender; Stream reply = null; StreamReader sr = null; @@ -159,7 +159,6 @@ lyric = lyricTemp.ToString().Trim(); - // if warning message from Evil Labs' sql-server, then lyric isn't found if (lyric.Contains("<td") || lyric.Contains("<IFRAME")) { lyric = "Not found"; Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/SeekLyrics.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/SeekLyrics.cs 2008-12-11 17:00:53 UTC (rev 2415) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/SeekLyrics.cs 2008-12-11 17:13:03 UTC (rev 2416) @@ -6,6 +6,7 @@ using System.Net; using System.Threading; using System.Timers; +using System.Text.RegularExpressions; namespace LyricsEngine.LyricSites { @@ -61,11 +62,11 @@ // German letters title = title.Replace("\xFC", "%FC"); - title = title.Replace("\xDC", ""); + title = title.Replace("\xDC", "%FC"); title = title.Replace("\xE4", "%E4"); - title = title.Replace("\xC4", ""); - title = title.Replace("\xF6", "%E4"); // Not correct!!! - title = title.Replace("\xD6", ""); + title = title.Replace("\xC4", "%C4"); + title = title.Replace("\xF6", "%F6"); + title = title.Replace("\xD6", "%D6"); title = title.Replace("\xDF", "%DF"); // French letters @@ -74,14 +75,13 @@ string urlString = "http://www.seeklyrics.com/lyrics/" + artist + "/" + title + ".html"; - WebClient client = new WebClient(); - timer.Enabled = true; timer.Interval = timeLimit; timer.Elapsed += new ElapsedEventHandler(timer_Elapsed); timer.Start(); Uri uri = new Uri(urlString); + LyricsWebClient client = new LyricsWebClient(); client.OpenReadCompleted += new System.Net.OpenReadCompletedEventHandler(callbackMethod); client.OpenReadAsync(uri); @@ -100,10 +100,7 @@ private void callbackMethod(object sender, OpenReadCompletedEventArgs e) { - bool thisMayBeTheCorrectLyric = true; - StringBuilder lyricTemp = new StringBuilder(); - - WebClient client = (WebClient)sender; + LyricsWebClient client = (LyricsWebClient)sender; Stream reply = null; StreamReader sr = null; @@ -112,71 +109,45 @@ reply = (Stream)e.Result; sr = new StreamReader(reply); - string line = ""; - int noOfLinesCount = 0; + string line = sr.ReadToEnd(); - while (line.IndexOf("<pre>") == -1) - { - if (sr.EndOfStream || ++noOfLinesCount > 300) - { - thisMayBeTheCorrectLyric = false; - break; - } - else - { - line = sr.ReadLine(); - } - } + // Replace the new line stuff in the result, as the regex might have problems + line = line.Replace("\n", ""); + line = line.Replace("\r", ""); + line = line.Replace("\t", ""); - if (thisMayBeTheCorrectLyric) - { - lyricTemp = new StringBuilder(); - string textToCutFrom = "<pre>"; - int indexToCutFrom = line.LastIndexOf(textToCutFrom) + textToCutFrom.Length; - lyricTemp.Append(line.Substring(indexToCutFrom)); - if (line.Substring(indexToCutFrom).Contains("<F")) - lyricTemp = new StringBuilder(); + string pat = @"<a href=""http://www\.ringtonematcher\.com/.*?</a>(.*?)<a href"; - line = sr.ReadLine(); - - while (line.IndexOf("</pre>") == -1) - { - lyricTemp.Append(line); - if (sr.EndOfStream || ++noOfLinesCount > 300) - { - thisMayBeTheCorrectLyric = false; - break; - } - else - { - line = sr.ReadLine(); - } - } - - textToCutFrom = "</pre>"; - indexToCutFrom = line.LastIndexOf(textToCutFrom); - lyricTemp.Append(line.Substring(0, indexToCutFrom)); - - lyricTemp.Replace("?s", "'s"); - lyricTemp.Replace("?t", "'t"); - lyricTemp.Replace("?m", "'m"); - lyricTemp.Replace("?l", "'l"); - lyricTemp.Replace("?v", "'v"); - lyricTemp.Replace("<br>", "\r\n"); - lyricTemp.Replace("<br />", "\r\n"); - lyricTemp.Replace("'", "'"); - lyricTemp.Replace("</p>", ""); - lyricTemp.Replace("<BR>", ""); - lyricTemp.Replace("<br/>", "\r\n"); - - lyric = lyricTemp.ToString().Trim(); - - // if warning message from Evil Labs' sql-server, then lyric isn't found - if (lyric.Contains("<td")) - { - lyric = "Not found"; - } + // Compile the regular expression. + Regex r = new Regex(pat, RegexOptions.IgnoreCase); + // Match the regular expression pattern against a text string. + Match m = r.Match(line); + if (m.Success) + { + Group g1 = m.Groups[1]; + foreach (Capture c1 in g1.Captures) + { + lyric = c1.Value; } + } + + if (lyric.Length > 0) + { + lyric = lyric.Replace("?s", "'s"); + lyric = lyric.Replace("?t", "'t"); + lyric = lyric.Replace("?m", "'m"); + lyric = lyric.Replace("?l", "'l"); + lyric = lyric.Replace("?v", "'v"); + lyric = lyric.Replace("<br>", "\r\n"); + lyric = lyric.Replace("<br />", "\r\n"); + lyric = lyric.Replace("'", "'"); + lyric = lyric.Replace("</p>", ""); + lyric = lyric.Replace("<BR>", ""); + lyric = lyric.Replace("<br/>", "\r\n"); + lyric = lyric.Trim(); + } + else + lyric = "Not found"; } catch (System.Reflection.TargetInvocationException) { Modified: trunk/plugins/MyLyrics/LyricsEngine/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/Properties/AssemblyInfo.cs 2008-12-11 17:00:53 UTC (rev 2415) +++ trunk/plugins/MyLyrics/LyricsEngine/Properties/AssemblyInfo.cs 2008-12-11 17:13:03 UTC (rev 2416) @@ -26,7 +26,7 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("0.23")] +[assembly: AssemblyVersion("1.1")] // // In order to sign your assembly you must specify a key to use. Refer to the Modified: trunk/plugins/MyLyrics/LyricsEngine/Properties/Resources.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/Properties/Resources.Designer.cs 2008-12-11 17:00:53 UTC (rev 2415) +++ trunk/plugins/MyLyrics/LyricsEngine/Properties/Resources.Designer.cs 2008-12-11 17:13:03 UTC (rev 2416) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. -// Runtime Version:2.0.50727.42 +// Runtime Version:2.0.50727.1434 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. Modified: trunk/plugins/MyLyrics/LyricsEngine/Properties/Settings.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/Properties/Settings.Designer.cs 2008-12-11 17:00:53 UTC (rev 2415) +++ trunk/plugins/MyLyrics/LyricsEngine/Properties/Settings.Designer.cs 2008-12-11 17:13:03 UTC (rev 2416) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. -// Runtime Version:2.0.50727.42 +// Runtime Version:2.0.50727.1434 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -12,7 +12,7 @@ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); Modified: trunk/plugins/MyLyrics/LyricsEngine/Setup.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/Setup.cs 2008-12-11 17:00:53 UTC (rev 2415) +++ trunk/plugins/MyLyrics/LyricsEngine/Setup.cs 2008-12-11 17:13:03 UTC (rev 2416) @@ -12,7 +12,7 @@ "Lyrics007", "LyricsOnDemand", "HotLyrics", - "EvilLabs", + "Actionext", "SeekLyrics" }; Modified: trunk/plugins/MyLyrics/LyricsEngine/Web References/org.lyricwiki/Reference.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/Web References/org.lyricwiki/Reference.cs 2008-12-11 17:00:53 UTC (rev 2415) +++ trunk/plugins/MyLyrics/LyricsEngine/Web References/org.lyricwiki/Reference.cs 2008-12-11 17:13:03 UTC (rev 2416) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. -// Runtime Version:2.0.50727.42 +// Runtime Version:2.0.50727.1434 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -9,7 +9,7 @@ //------------------------------------------------------------------------------ // -// This source code was auto-generated by Microsoft.VSDesigner, Version 2.0.50727.42. +// This source code was auto-generated by Microsoft.VSDesigner, Version 2.0.50727.1434. // #pragma warning disable 1591 @@ -23,7 +23,7 @@ /// <remarks/> - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1434")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Web.Services.WebServiceBindingAttribute(Name="LyricWikiBinding", Namespace="urn:LyricWiki")] @@ -557,7 +557,7 @@ } /// <remarks/> - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.1434")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -590,7 +590,7 @@ } /// <remarks/> - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.1434")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -635,7 +635,7 @@ } /// <remarks/> - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.1434")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -704,11 +704,11 @@ } /// <remarks/> - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1434")] public delegate void checkSongExistsCompletedEventHandler(object sender, checkSongExistsCompletedEventArgs e); /// <remarks/> - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1434")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class checkSongExistsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -730,11 +730,11 @@ } /// <remarks/> - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1434")] public delegate void searchArtistsCompletedEventHandler(object sender, searchArtistsCompletedEventArgs e); /// <remarks/> - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1434")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class searchArtistsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -756,11 +756,11 @@ } /// <remarks/> - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1434")] public delegate void searchAlbumsCompletedEventHandler(object sender, searchAlbumsCompletedEventArgs e); /// <remarks/> - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1434")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class searchAlbumsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -782,11 +782,11 @@ } /// <remarks/> - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1434")] public delegate void searchSongsCompletedEventHandler(object sender, searchSongsCompletedEventArgs e); /// <remarks/> - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1434")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class searchSongsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -808,11 +808,11 @@ } /// <remarks/> - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1434")] public delegate void getSOTDCompletedEventHandler(object sender, getSOTDCompletedEventArgs e); /// <remarks/> - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1434")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class getSOTDCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -834,11 +834,11 @@ } /// <remarks/> - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1434")] public delegate void getSongCompletedEventHandler(object sender, getSongCompletedEventArgs e); /// <remarks/> - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1434")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class getSongCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -860,11 +860,11 @@ } /// <remarks/> - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1434")] public delegate void getSongResultCompletedEventHandler(object sender, getSongResultCompletedEventArgs e); /// <remarks/> - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1434")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class getSongResultCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -886,11 +886,11 @@ } /// <remarks/> - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1434")] public delegate void getArtistCompletedEventHandler(object sender, getArtistCompletedEventArgs e); /// <remarks/> - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1434")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class getArtistCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -920,11 +920,11 @@ } /// <remarks/> - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1434")] public delegate void getAlbumCompletedEventHandler(object sender, getAlbumCompletedEventArgs e); /// <remarks/> - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1434")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class getAlbumCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -978,11 +978,11 @@ } /// <remarks/> - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1434")] public delegate void postArtistCompletedEventHandler(object sender, postArtistCompletedEventArgs e); /// <remarks/> - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1434")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class postArtistCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -1020,11 +1020,11 @@ } /// <remarks/> - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1434")] public delegate void postAlbumCompletedEventHandler(object sender, postAlbumCompletedEventArgs e); /// <remarks/> - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1434")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class postAlbumCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -1078,11 +1078,11 @@ } /// <remarks/> - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1434")] public delegate void postSongCompletedEventHandler(object sender, postSongCompletedEventArgs e); /// <remarks/> - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1434")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class postSongCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { Modified: trunk/plugins/MyLyrics/My Lyrics/DatabaseUtil.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/DatabaseUtil.cs 2008-12-11 17:00:53 UTC (rev 2415) +++ trunk/plugins/MyLyrics/My Lyrics/DatabaseUtil.cs 2008-12-11 17:13:03 UTC (rev 2416) @@ -61,8 +61,11 @@ return artist + "-" + title; } + public static void WriteToLyricsDatabase(LyricsDatabase lyricsDB, LyricsDatabase lyricsMarkedDB, string capArtist, string capTitle, string lyric, string site) { + lyric = LyricUtil.CleanLyrics(lyric); + if (DatabaseUtil.IsTrackInLyricsDatabase(lyricsDB, capArtist, capTitle).Equals(DatabaseUtil.LYRIC_NOT_FOUND)) { lyricsDB.Add(DatabaseUtil.CorrectKeyFormat(capArtist, capTitle), new LyricsItem(capArtist, capTitle, lyric, site)); @@ -76,6 +79,8 @@ public static void ReplaceInLyricsDatabase(LyricsDatabase currentLyricsDB, string capArtist, string capTitle, string lyric, string site) { + lyric = LyricUtil.CleanLyrics(lyric); + LyricsDatabase otherDatabase = GetOtherLyricsDatabase(currentLyricsDB); string key = DatabaseUtil.CorrectKeyFormat(capArtist, capTitle); Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs 2008-12-11 17:00:53 UTC (rev 2415) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs 2008-12-11 17:13:03 UTC (rev 2416) @@ -36,11 +36,11 @@ this.label4 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); this.panel1 = new System.Windows.Forms.Panel(); + this.label8 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); 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(); @@ -61,7 +61,7 @@ // 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.ForeColor = System.Drawing.Color.Black; this.lbInfo2.Location = new System.Drawing.Point(26, 153); this.lbInfo2.Name = "lbInfo2"; this.lbInfo2.Size = new System.Drawing.Size(326, 17); @@ -72,12 +72,12 @@ // 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.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(225, 17); + this.lbInfo1.Size = new System.Drawing.Size(246, 17); this.lbInfo1.TabIndex = 3; - this.lbInfo1.Text = "MyLyrics plugin, version 1.00"; + this.lbInfo1.Text = "MyLyrics plugin, version 1.1 RC1"; // // label2 // @@ -93,7 +93,7 @@ // 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.ForeColor = System.Drawing.Color.Black; this.label4.Location = new System.Drawing.Point(3, 4); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(100, 13); @@ -127,58 +127,58 @@ this.panel1.Size = new System.Drawing.Size(480, 251); this.panel1.TabIndex = 8; // - // label3 + // label8 // - 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"); + 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"); // - // label1 + // label7 // - 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:"; + 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.Black; + 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"; // // 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.ForeColor = System.Drawing.Color.Black; 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 + // label1 // - 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"; + 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.Black; + 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:"; // - // label8 + // label3 // - 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"); + 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"); // // linkLabelForum // Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.resx =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.resx 2008-12-11 17:00:53 UTC (rev 2415) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.resx 2008-12-11 17:13:03 UTC (rev 2416) @@ -125,10 +125,10 @@ <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="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 Lyric" dialog accessable from the "Lyrics database" tab, and choose which sites you want to query in your searches.</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 Lyric" 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/FindLyric.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/FindLyric.Designer.cs 2008-12-11 17:00:53 UTC (rev 2415) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/FindLyric.Designer.cs 2008-12-11 17:13:03 UTC (rev 2416) @@ -42,16 +42,15 @@ this.groupBox2 = new System.Windows.Forms.GroupBox(); this.tbLyrics = new System.Windows.Forms.TextBox(); this.gbLyricSites = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.cbActionext = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.btCancel = new System.Windows.Forms.Button(); this.cbHotLyrics = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.cbSeekLyrics = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.cbLyricsOnDemand = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.cbLyrics007 = new MediaPortal.UserInterface.Controls.MPCheckBox(); - this.cbEvilLabs = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.cbLyricWiki = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.btClose = new System.Windows.Forms.Button(); this.btUpdate = new System.Windows.Forms.Button(); - this.cbActionext = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.gbSearchInfo.SuspendLayout(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); @@ -137,8 +136,8 @@ this.lvSearchResults.TabIndex = 10; this.lvSearchResults.UseCompatibleStateImageBehavior = false; this.lvSearchResults.View = System.Windows.Forms.View.Details; - this.lvSearchResults.DoubleClick += new System.EventHandler(this.lvSearchResults_DoubleClick); this.lvSearchResults.SelectedIndexChanged += new System.EventHandler(this.lvSearchResults_SelectedIndexChanged); + this.lvSearchResults.DoubleClick += new System.EventHandler(this.lvSearchResults_DoubleClick); // // cbSite // @@ -183,7 +182,6 @@ this.gbLyricSites.Controls.Add(this.cbSeekLyrics); this.gbLyricSites.Controls.Add(this.cbLyricsOnDemand); this.gbLyricSites.Controls.Add(this.cbLyrics007); - this.gbLyricSites.Controls.Add(this.cbEvilLabs); this.gbLyricSites.Controls.Add(this.cbLyricWiki); this.gbLyricSites.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.gbLyricSites.Location = new System.Drawing.Point(12, 103); @@ -193,6 +191,19 @@ this.gbLyricSites.TabStop = false; this.gbLyricSites.Text = "Lyric sites to search"; // + // cbActionext + // + this.cbActionext.AutoSize = true; + 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.Name = "cbActionext"; + this.cbActionext.Size = new System.Drawing.Size(68, 17); + this.cbActionext.TabIndex = 17; + this.cbActionext.Text = "Actionext"; + this.cbActionext.UseVisualStyleBackColor = true; + // // btCancel // this.btCancel.Location = new System.Drawing.Point(352, 67); @@ -255,19 +266,6 @@ this.cbLyrics007.Text = "Lyrics 007"; this.cbLyrics007.UseVisualStyleBackColor = true; // - // cbEvilLabs - // - this.cbEvilLabs.AutoSize = true; - this.cbEvilLabs.Checked = true; - this.cbEvilLabs.CheckState = System.Windows.Forms.CheckState.Checked; - this.cbEvilLabs.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.cbEvilLabs.Location = new System.Drawing.Point(222, 21); - this.cbEvilLabs.Name = "cbEvilLabs"; - this.cbEvilLabs.Size = new System.Drawing.Size(67, 17); - this.cbEvilLabs.TabIndex = 16; - this.cbEvilLabs.Text = "Evil Labs"; - this.cbEvilLabs.UseVisualStyleBackColor = true; - // // cbLyricWiki // this.cbLyricWiki.AutoSize = true; @@ -302,24 +300,11 @@ this.btUpdate.UseVisualStyleBackColor = true; this.btUpdate.Click += new System.EventHandler(this.btUpdate_Click); // - // cbActionext - // - this.cbActionext.AutoSize = true; - 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.Name = "cbActionext"; - this.cbActionext.Size = new System.Drawing.Size(68, 17); - this.cbActionext.TabIndex = 17; - this.cbActionext.Text = "Actionext"; - this.cbActionext.UseVisualStyleBackColor = true; - // // FindLyric // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(456, 584); + this.ClientSize = new System.Drawing.Size(448, 575); this.ControlBox = false; this.Controls.Add(this.btUpdate); this.Controls.Add(this.btClose); @@ -361,7 +346,6 @@ internal MediaPortal.UserInterface.Controls.MPCheckBox cbSeekLyrics; internal MediaPortal.UserInterface.Controls.MPCheckBox cbLyricsOnDemand; internal MediaPortal.UserInterface.Controls.MPCheckBox cbLyrics007; - internal MediaPortal.UserInterface.Controls.MPCheckBox cbEvilLabs; internal MediaPortal.UserInterface.Controls.MPCheckBox cbLyricWiki; private System.Windows.Forms.ListView lvSearchResults; private System.Windows.Forms.ColumnHeader cbSite; Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/FindLyric.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/FindLyric.cs 2008-12-11 17:00:53 UTC (rev 2415) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/FindLyric.cs 2008-12-11 17:13:03 UTC (rev 2416) @@ -80,7 +80,6 @@ using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MediaPortal.xml")) { cbLyricWiki.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useLyricWiki", "True")).ToString().Equals("True") ? true : false; - cbEvilLabs.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useEvilLabs", "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; @@ -150,10 +149,6 @@ { sitesToSearch.Add("LyricWiki"); } - if (cbEvilLabs.Checked) - { - sitesToSearch.Add("EvilLabs"); - } if (cbActionext.Checked) { sitesToSearch.Add("Actionext"); Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.Designer.cs 2008-12-11 17:00:53 UTC (rev 2415) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.Designer.cs 2008-12-11 17:13:03 UTC (rev 2416) @@ -33,7 +33,6 @@ this.lbDatabase = new MediaPortal.UserInterface.Controls.MPLabel(); this.lbLRCTest = new System.Windows.Forms.Label(); this.lbSongs2 = new MediaPortal.UserInterface.Controls.MPLabel(); - this.tbLyrics = new MediaPortal.UserInterface.Controls.MPTextBox(); this.lbSongs = new MediaPortal.UserInterface.Controls.MPLabel(); this.lbArtists2 = new MediaPortal.UserInterface.Controls.MPLabel(); this.lbTitle = new MediaPortal.UserInterface.Controls.MPLabel(); @@ -44,6 +43,7 @@ this.btResetLyricsDatabase = new System.Windows.Forms.Button(); this.lbResetDatabase = new MediaPortal.UserInterface.Controls.MPLabel(); this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog(); + this.tbLyrics = new System.Windows.Forms.TextBox(); this.gbLibrary.SuspendLayout(); this.gbExport.SuspendLayout(); this.gbImport.SuspendLayout(); @@ -94,6 +94,7 @@ // // gbLibrary // + this.gbLibrary.Controls.Add(this.tbLyrics); this.gbLibrary.Controls.Add(this.gbExport); this.gbLibrary.Controls.Add(this.gbImport); this.gbLibrary.Controls.Add(this.gbEditLyrics); @@ -102,7 +103,6 @@ this.gbLibrary.Controls.Add(this.lbDatabase); this.gbLibrary.Controls.Add(this.lbLRCTest); this.gbLibrary.Controls.Add(this.lbSongs2); - this.gbLibrary.Controls.Add(this.tbLyrics); this.gbLibrary.Controls.Add(this.lbSongs); this.gbLibrary.Controls.Add(this.lbArtists2); this.gbLibrary.Controls.Add(this.lbTitle); @@ -269,19 +269,6 @@ this.lbSongs2.TabIndex = 23; this.lbSongs2.Text = "-"; // - // tbLyrics - // - this.tbLyrics.AllowDrop = true; - this.tbLyrics.BorderColor = System.Drawing.Color.Empty; - this.tbLyrics.Enabled = false; - this.tbLyrics.Location = new System.Drawing.Point(235, 78); - this.tbLyrics.Multiline = true; - this.tbLyrics.Name = "tbLyrics"; - this.tbLyrics.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; - this.tbLyrics.Size = new System.Drawing.Size(298, 213); - this.tbLyrics.TabIndex = 6; - this.tbLyrics.KeyUp += new System.Windows.Forms.KeyEventHandler(this.tbLyrics_KeyUp); - // // lbSongs // this.lbSongs.Location = new System.Drawing.Point(11, 62); @@ -373,6 +360,15 @@ "erns [Artist]-[Title].txt and *.lrc will be included to the lyrics database."; this.folderBrowserDialog1.ShowNewFolderButton = false; // + // tbLyrics + // + this.tbLyrics.Location = new System.Drawing.Point(241, 78); + this.tbLyrics.Multiline = true; + thi... [truncated message content] |
From: <sa...@us...> - 2008-12-17 17:43:26
|
Revision: 2445 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2445&view=rev Author: saamand Date: 2008-12-17 17:43:20 +0000 (Wed, 17 Dec 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MyLyrics/LyricsEngine/LyricUtil.cs trunk/plugins/MyLyrics/LyricsEngine/LyricsController.cs trunk/plugins/MyLyrics/My Lyrics/DatabaseUtil.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.resx trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/FindLyric.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.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 trunk/plugins/MyLyrics/My Lyrics/TagReaderUtil.cs Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricUtil.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricUtil.cs 2008-12-17 16:52:29 UTC (rev 2444) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricUtil.cs 2008-12-17 17:43:20 UTC (rev 2445) @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Text; +using System.Text.RegularExpressions; namespace LyricsEngine { @@ -78,11 +79,31 @@ return str; } - public static string CleanLyrics(string lyrics) + + public static string FixLyrics(string lyrics) { - while (lyrics.Contains(@"''")) + lyrics = Regex.Replace(lyrics, "('){2,}", "'"); + return lyrics; + } + + public static string FixLyrics(string lyrics, string[] find, string[] replace) + { + lyrics = FixLyrics(lyrics); + + + if (find != null) { - lyrics = lyrics.Replace(@"''", "'"); + int valueIndex = 0; + + foreach (string findValue in find) + { + + if (findValue != "") + { + lyrics = lyrics.Replace(findValue, replace[valueIndex]); + valueIndex++; + } + } } return lyrics; Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsController.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsController.cs 2008-12-17 16:52:29 UTC (rev 2444) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsController.cs 2008-12-17 17:43:20 UTC (rev 2445) @@ -38,12 +38,16 @@ ManualResetEvent m_EventStopped_LyricController; private string[] lyricsSites; + private string[] m_findArray; + private string[] m_replaceArray; public LyricsController(ILyricForm mainForm, ManualResetEvent eventStopThread, string[] lyricSites, - bool allowAllToComplete, bool automaticUpdate) + bool allowAllToComplete, bool automaticUpdate, + string find, string replace) { + this.m_Form = mainForm; this.m_allowAllToComplete = allowAllToComplete; this.m_automaticUpdate = automaticUpdate; @@ -73,6 +77,15 @@ m_EventStopped_LyricController = new ManualResetEvent(false); LyricSearch.Abort = false; + + if (!string.IsNullOrEmpty(find) && !string.IsNullOrEmpty(replace)) + { + if (find != "") + { + m_findArray = find.Split(','); + m_replaceArray = replace.Split(','); + } + } } @@ -185,8 +198,9 @@ internal void LyricFound(String lyricStrings, String artist, String title, String site) { - string cleanLyric = LyricUtil.CleanLyrics(lyricStrings); + string cleanLyric = LyricUtil.FixLyrics(lyricStrings, m_findArray, m_replaceArray); + --m_noOfCurrentSearches; if (m_allowAllToComplete || m_StopSearches == false) Modified: trunk/plugins/MyLyrics/My Lyrics/DatabaseUtil.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/DatabaseUtil.cs 2008-12-17 16:52:29 UTC (rev 2444) +++ trunk/plugins/MyLyrics/My Lyrics/DatabaseUtil.cs 2008-12-17 17:43:20 UTC (rev 2445) @@ -64,8 +64,6 @@ public static void WriteToLyricsDatabase(LyricsDatabase lyricsDB, LyricsDatabase lyricsMarkedDB, string capArtist, string capTitle, string lyric, string site) { - lyric = LyricUtil.CleanLyrics(lyric); - if (DatabaseUtil.IsTrackInLyricsDatabase(lyricsDB, capArtist, capTitle).Equals(DatabaseUtil.LYRIC_NOT_FOUND)) { lyricsDB.Add(DatabaseUtil.CorrectKeyFormat(capArtist, capTitle), new LyricsItem(capArtist, capTitle, lyric, site)); @@ -79,8 +77,6 @@ public static void ReplaceInLyricsDatabase(LyricsDatabase currentLyricsDB, string capArtist, string capTitle, string lyric, string site) { - lyric = LyricUtil.CleanLyrics(lyric); - LyricsDatabase otherDatabase = GetOtherLyricsDatabase(currentLyricsDB); string key = DatabaseUtil.CorrectKeyFormat(capArtist, capTitle); Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs 2008-12-17 16:52:29 UTC (rev 2444) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs 2008-12-17 17:43:20 UTC (rev 2445) @@ -42,6 +42,9 @@ this.label1 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.linkLabelForum = new System.Windows.Forms.LinkLabel(); + this.label9 = new System.Windows.Forms.Label(); + this.label10 = new System.Windows.Forms.Label(); + this.label11 = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.SuspendLayout(); // @@ -60,60 +63,62 @@ // 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.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lbInfo2.ForeColor = System.Drawing.Color.Black; - this.lbInfo2.Location = new System.Drawing.Point(26, 153); + this.lbInfo2.Location = new System.Drawing.Point(26, 150); this.lbInfo2.Name = "lbInfo2"; - this.lbInfo2.Size = new System.Drawing.Size(326, 17); + this.lbInfo2.Size = new System.Drawing.Size(288, 18); this.lbInfo2.TabIndex = 2; - this.lbInfo2.Text = "The four tabs of the MyLyrics configuration:"; + this.lbInfo2.Text = "The five 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.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 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(246, 17); + this.lbInfo1.Size = new System.Drawing.Size(223, 18); this.lbInfo1.TabIndex = 3; this.lbInfo1.Text = "MyLyrics plugin, version 1.1 RC1"; // // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(12, 17); + this.label2.Location = new System.Drawing.Point(12, 18); this.label2.MaximumSize = new System.Drawing.Size(460, 0); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(445, 39); + this.label2.Size = new System.Drawing.Size(432, 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.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label4.ForeColor = System.Drawing.Color.Black; - this.label4.Location = new System.Drawing.Point(3, 4); + this.label4.Location = new System.Drawing.Point(3, 1); this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(100, 13); + this.label4.Size = new System.Drawing.Size(95, 15); 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.Location = new System.Drawing.Point(12, 128); this.label5.MaximumSize = new System.Drawing.Size(460, 0); this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(458, 26); + this.label5.Size = new System.Drawing.Size(371, 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."; + this.label5.Text = "- Search lyrics for your complete MP music database in a single batch search.\r\n- " + + "Search lyrics for songs in your marked database database."; // // panel1 // this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + this.panel1.Controls.Add(this.label10); + this.panel1.Controls.Add(this.label9); this.panel1.Controls.Add(this.label8); this.panel1.Controls.Add(this.label7); this.panel1.Controls.Add(this.label6); @@ -124,49 +129,49 @@ 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.Size = new System.Drawing.Size(480, 269); this.panel1.TabIndex = 8; // // label8 // this.label8.AutoSize = true; - this.label8.Location = new System.Drawing.Point(12, 189); + this.label8.Location = new System.Drawing.Point(12, 218); this.label8.MaximumSize = new System.Drawing.Size(460, 0); this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(454, 52); + this.label8.Size = new System.Drawing.Size(418, 39); this.label8.TabIndex = 11; this.label8.Text = resources.GetString("label8.Text"); // // 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.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label7.ForeColor = System.Drawing.Color.Black; - this.label7.Location = new System.Drawing.Point(3, 176); + this.label7.Location = new System.Drawing.Point(3, 201); this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(53, 13); + this.label7.Size = new System.Drawing.Size(51, 15); this.label7.TabIndex = 10; this.label7.Text = "Settings"; // // 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.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label6.ForeColor = System.Drawing.Color.Black; - this.label6.Location = new System.Drawing.Point(3, 127); + this.label6.Location = new System.Drawing.Point(3, 112); this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(136, 13); + this.label6.Size = new System.Drawing.Size(130, 15); this.label6.TabIndex = 9; this.label6.Text = "Music database batch:"; // // 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.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label1.ForeColor = System.Drawing.Color.Black; - this.label1.Location = new System.Drawing.Point(3, 66); + this.label1.Location = new System.Drawing.Point(3, 62); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(144, 13); + this.label1.Size = new System.Drawing.Size(140, 15); this.label1.TabIndex = 8; this.label1.Text = "Music database browse:"; // @@ -176,27 +181,64 @@ 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.Size = new System.Drawing.Size(302, 26); this.label3.TabIndex = 7; - this.label3.Text = resources.GetString("label3.Text"); + this.label3.Text = "- Browse your MP music database.\r\n- Manually select the songs that you would like" + + " to find lyrics for."; // // linkLabelForum // this.linkLabelForum.AutoSize = true; - this.linkLabelForum.LinkColor = System.Drawing.Color.Navy; - this.linkLabelForum.Location = new System.Drawing.Point(364, 436); + this.linkLabelForum.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.linkLabelForum.ForeColor = System.Drawing.Color.Black; + this.linkLabelForum.LinkColor = System.Drawing.SystemColors.MenuHighlight; + this.linkLabelForum.Location = new System.Drawing.Point(354, 456); this.linkLabelForum.Name = "linkLabelForum"; - this.linkLabelForum.Size = new System.Drawing.Size(145, 13); + this.linkLabelForum.Size = new System.Drawing.Size(168, 15); 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); // + // label9 + // + this.label9.AutoSize = true; + this.label9.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label9.ForeColor = System.Drawing.Color.Black; + this.label9.Location = new System.Drawing.Point(3, 163); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(89, 15); + this.label9.TabIndex = 12; + this.label9.Text = "Find && replace:"; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(12, 180); + this.label10.MaximumSize = new System.Drawing.Size(460, 0); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(334, 13); + this.label10.TabIndex = 13; + this.label10.Text = "- Select words to be found and replace during viewing and searching."; + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label11.ForeColor = System.Drawing.Color.Black; + this.label11.Location = new System.Drawing.Point(34, 456); + this.label11.MaximumSize = new System.Drawing.Size(460, 0); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(314, 15); + this.label11.TabIndex = 14; + this.label11.Text = "For bugs, issues and feature requests use the MP forum:"; + // // Information // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.label11); this.Controls.Add(this.linkLabelForum); this.Controls.Add(this.panel1); this.Controls.Add(this.lbInfo1); @@ -226,5 +268,8 @@ private System.Windows.Forms.Label label8; private System.Windows.Forms.Label label7; private System.Windows.Forms.LinkLabel linkLabelForum; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.Label label11; } } Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.resx =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.resx 2008-12-17 16:52:29 UTC (rev 2444) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.resx 2008-12-17 17:43:20 UTC (rev 2445) @@ -123,12 +123,13 @@ 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> + <value>- See your lyrics database (containing the songs with a matching lyric). +- See your marked database (containing the songs that was searched without a matching). +- You can modify, import, and find an alternative title for a known song amont other things.</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 Lyric" dialog accessable from the "Lyrics database" tab, and choose which sites you want to query in your searches.</value> + <value>- Set up the plugin as you prefer. E.g. which sites to query in your searches. +- Choose the plugin alias and if a found lyric should be stored in the tag of the music file. +- Tweak the settings regarding the "Find Lyric" dialog. </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> </root> \ 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-17 16:52:29 UTC (rev 2444) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/FindLyric.cs 2008-12-17 17:43:20 UTC (rev 2445) @@ -42,6 +42,9 @@ bool m_automaticWriteToMusicTag = true; bool markedDatabase; + string m_find = string.Empty; + string m_replace = string.Empty; + string[] m_strippedPrefixStrings = null; List<string> sitesToSearch; @@ -89,6 +92,9 @@ m_automaticUpdate = xmlreader.GetValueAsBool("myLyrics", "automaticUpdateWhenFirstFound", false); m_moveLyricFromMarkedDatabase = xmlreader.GetValueAsBool("myLyrics", "moveLyricFromMarkedDatabase", true); m_automaticWriteToMusicTag = xmlreader.GetValueAsBool("myLyrics", "automaticWriteToMusicTag", true); + + m_find = xmlreader.GetValueAsString("myLyrics", "find", ""); + m_replace = xmlreader.GetValueAsString("myLyrics", "replace", ""); } m_strippedPrefixStrings = MediaPortalUtil.GetStrippedPrefixStringArray(); @@ -171,7 +177,7 @@ } // If automaticUpdate is set then return after the first positive search - lc = new LyricsController(this, m_EventStopThread, (string[])sitesToSearch.ToArray(), true, automaticUpdate); + lc = new LyricsController(this, m_EventStopThread, (string[])sitesToSearch.ToArray(), true, automaticUpdate, m_find, m_replace); ThreadStart job = delegate { Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.cs 2008-12-17 16:52:29 UTC (rev 2444) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.cs 2008-12-17 17:43:20 UTC (rev 2445) @@ -325,7 +325,7 @@ string capArtist = LyricUtil.CapatalizeString(m_CurrentArtist); string capTitle = LyricUtil.CapatalizeString(m_CurrentTitle); - string lyrics = LyricUtil.CleanLyrics(tbLyrics.Text); + string lyrics = LyricUtil.FixLyrics(tbLyrics.Text); CurrentDB[DatabaseUtil.CorrectKeyFormat(capArtist, capTitle)].Lyrics = lyrics; DatabaseUtil.SerializeDB(CurrentDB); Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.cs 2008-12-17 16:52:29 UTC (rev 2444) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.cs 2008-12-17 17:43:20 UTC (rev 2445) @@ -46,6 +46,9 @@ Queue<string[]> songs; LyricsController lc; + string m_find = string.Empty; + string m_replace = string.Empty; + public MusicDatabaseBrowse(MyLyricsSetup parent) { this.parent = parent; @@ -252,6 +255,9 @@ sitesToSearch.Add("SeekLyrics"); if (((string)xmlreader.GetValueAsString("myLyrics", "useHotLyrics", "True")).ToString().Equals("True")) sitesToSearch.Add("HotLyrics"); + + m_find = xmlreader.GetValueAsString("myLyrics", "find", ""); + m_replace = xmlreader.GetValueAsString("myLyrics", "replace", ""); } m_strippedPrefixStrings = MediaPortalUtil.GetStrippedPrefixStringArray(); @@ -259,7 +265,7 @@ 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); + lc = new LyricsController(this, m_EventStopThread, (string[])sitesToSearch.ToArray(), false, false, m_find, m_replace); m_noOfSearchesToComplete = songs.Count; lc.NoOfLyricsToSearch = m_noOfSearchesToComplete; Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs 2008-12-17 16:52:29 UTC (rev 2444) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs 2008-12-17 17:43:20 UTC (rev 2445) @@ -97,8 +97,9 @@ this.lbSpeed = new MediaPortal.UserInterface.Controls.MPLabel(); this.rdDefault = new System.Windows.Forms.RadioButton(); this.rbUserDefined = new System.Windows.Forms.RadioButton(); - this.tbNote = new MediaPortal.UserInterface.Controls.MPLabel(); this.tabPageReplace = new System.Windows.Forms.TabPage(); + this.mpGroupBox4 = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.lbArtist = new MediaPortal.UserInterface.Controls.MPLabel(); this.dbGridView = new System.Windows.Forms.DataGridView(); this.Find = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Replace = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -121,6 +122,7 @@ this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.trackBar)).BeginInit(); this.tabPageReplace.SuspendLayout(); + this.mpGroupBox4.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dbGridView)).BeginInit(); this.SuspendLayout(); // @@ -136,7 +138,7 @@ this.tabControl.Location = new System.Drawing.Point(0, 0); this.tabControl.Name = "tabControl"; this.tabControl.SelectedIndex = 0; - this.tabControl.Size = new System.Drawing.Size(558, 524); + this.tabControl.Size = new System.Drawing.Size(558, 530); this.tabControl.TabIndex = 1; this.tabControl.SelectedIndexChanged += new System.EventHandler(this.tabControl_SelectedIndexChanged); // @@ -145,7 +147,7 @@ this.tabPageLyricsDatabase.Location = new System.Drawing.Point(4, 22); this.tabPageLyricsDatabase.Name = "tabPageLyricsDatabase"; this.tabPageLyricsDatabase.Padding = new System.Windows.Forms.Padding(3); - this.tabPageLyricsDatabase.Size = new System.Drawing.Size(550, 498); + this.tabPageLyricsDatabase.Size = new System.Drawing.Size(550, 504); this.tabPageLyricsDatabase.TabIndex = 1; this.tabPageLyricsDatabase.Text = "Lyrics database"; this.tabPageLyricsDatabase.UseVisualStyleBackColor = true; @@ -155,7 +157,7 @@ this.tabPageMusicDatabaseBrowse.Location = new System.Drawing.Point(4, 22); this.tabPageMusicDatabaseBrowse.Name = "tabPageMusicDatabaseBrowse"; this.tabPageMusicDatabaseBrowse.Padding = new System.Windows.Forms.Padding(3); - this.tabPageMusicDatabaseBrowse.Size = new System.Drawing.Size(550, 498); + this.tabPageMusicDatabaseBrowse.Size = new System.Drawing.Size(550, 504); this.tabPageMusicDatabaseBrowse.TabIndex = 3; this.tabPageMusicDatabaseBrowse.Text = "Music database browse"; this.tabPageMusicDatabaseBrowse.UseVisualStyleBackColor = true; @@ -170,7 +172,7 @@ this.tabPageDatabase.Location = new System.Drawing.Point(4, 22); this.tabPageDatabase.Name = "tabPageDatabase"; this.tabPageDatabase.Padding = new System.Windows.Forms.Padding(3); - this.tabPageDatabase.Size = new System.Drawing.Size(550, 498); + this.tabPageDatabase.Size = new System.Drawing.Size(550, 504); this.tabPageDatabase.TabIndex = 2; this.tabPageDatabase.Text = "Music database batch search"; this.tabPageDatabase.UseVisualStyleBackColor = true; @@ -557,7 +559,7 @@ this.lbSongsWithLyric.Name = "lbSongsWithLyric"; this.lbSongsWithLyric.Size = new System.Drawing.Size(91, 15); this.lbSongsWithLyric.TabIndex = 22; - this.lbSongsWithLyric.Text = "Songs with lyric:"; + this.lbSongsWithLyric.Text = "Songs with lyrics:"; // // lbTotalSongs2 // @@ -600,7 +602,7 @@ this.tabPageSetup.Location = new System.Drawing.Point(4, 22); this.tabPageSetup.Name = "tabPageSetup"; this.tabPageSetup.Padding = new System.Windows.Forms.Padding(3); - this.tabPageSetup.Size = new System.Drawing.Size(550, 498); + this.tabPageSetup.Size = new System.Drawing.Size(550, 504); this.tabPageSetup.TabIndex = 2; this.tabPageSetup.Text = "Settings"; this.tabPageSetup.UseVisualStyleBackColor = true; @@ -609,7 +611,7 @@ // this.gbTag.Controls.Add(this.cbMusicTag); this.gbTag.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.gbTag.Location = new System.Drawing.Point(5, 278); + this.gbTag.Location = new System.Drawing.Point(4, 265); this.gbTag.Name = "gbTag"; this.gbTag.Size = new System.Drawing.Size(538, 49); this.gbTag.TabIndex = 31; @@ -624,9 +626,9 @@ this.cbMusicTag.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.cbMusicTag.Location = new System.Drawing.Point(16, 23); this.cbMusicTag.Name = "cbMusicTag"; - this.cbMusicTag.Size = new System.Drawing.Size(198, 17); + this.cbMusicTag.Size = new System.Drawing.Size(203, 17); this.cbMusicTag.TabIndex = 6; - this.cbMusicTag.Text = "Write newly found lyric into music tag"; + this.cbMusicTag.Text = "Write newly found lyrics into music tag"; this.cbMusicTag.UseVisualStyleBackColor = true; this.cbMusicTag.Leave += new System.EventHandler(this.WriteMediaPortalXML); // @@ -636,7 +638,7 @@ this.mpGroupBox3.Controls.Add(this.cbMoveSongFrom); this.mpGroupBox3.Controls.Add(this.cbAutoFetch); this.mpGroupBox3.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.mpGroupBox3.Location = new System.Drawing.Point(5, 333); + this.mpGroupBox3.Location = new System.Drawing.Point(5, 320); this.mpGroupBox3.Name = "mpGroupBox3"; this.mpGroupBox3.Size = new System.Drawing.Size(538, 92); this.mpGroupBox3.TabIndex = 30; @@ -677,9 +679,9 @@ this.cbAutoFetch.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.cbAutoFetch.Location = new System.Drawing.Point(16, 23); this.cbAutoFetch.Name = "cbAutoFetch"; - this.cbAutoFetch.Size = new System.Drawing.Size(119, 17); + this.cbAutoFetch.Size = new System.Drawing.Size(124, 17); this.cbAutoFetch.TabIndex = 6; - this.cbAutoFetch.Text = "Automatic fetch lyric"; + this.cbAutoFetch.Text = "Automatic fetch lyrics"; this.cbAutoFetch.UseVisualStyleBackColor = true; this.cbAutoFetch.Leave += new System.EventHandler(this.WriteMediaPortalXML); // @@ -721,11 +723,10 @@ this.gbLyricSites.Controls.Add(this.groupBox1); this.gbLyricSites.Controls.Add(this.rdDefault); this.gbLyricSites.Controls.Add(this.rbUserDefined); - this.gbLyricSites.Controls.Add(this.tbNote); this.gbLyricSites.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.gbLyricSites.Location = new System.Drawing.Point(5, 70); this.gbLyricSites.Name = "gbLyricSites"; - this.gbLyricSites.Size = new System.Drawing.Size(538, 202); + this.gbLyricSites.Size = new System.Drawing.Size(538, 189); this.gbLyricSites.TabIndex = 28; this.gbLyricSites.TabStop = false; this.gbLyricSites.Text = "Lyrics sites settings"; @@ -898,36 +899,47 @@ this.rbUserDefined.UseVisualStyleBackColor = true; this.rbUserDefined.Leave += new System.EventHandler(this.rdTrackBar_CheckedChanged); // - // tbNote - // - this.tbNote.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.tbNote.Location = new System.Drawing.Point(13, 178); - this.tbNote.Margin = new System.Windows.Forms.Padding(0); - this.tbNote.Name = "tbNote"; - this.tbNote.Size = new System.Drawing.Size(377, 18); - this.tbNote.TabIndex = 19; - this.tbNote.Text = "Seek Lyrics should currently not be used due to instable server"; - // // tabPageReplace // - this.tabPageReplace.Controls.Add(this.dbGridView); + this.tabPageReplace.Controls.Add(this.mpGroupBox4); this.tabPageReplace.Location = new System.Drawing.Point(4, 22); this.tabPageReplace.Name = "tabPageReplace"; this.tabPageReplace.Padding = new System.Windows.Forms.Padding(3); - this.tabPageReplace.Size = new System.Drawing.Size(550, 498); + this.tabPageReplace.Size = new System.Drawing.Size(550, 504); this.tabPageReplace.TabIndex = 5; this.tabPageReplace.Text = "Find & Replace"; this.tabPageReplace.UseVisualStyleBackColor = true; // + // mpGroupBox4 + // + this.mpGroupBox4.Controls.Add(this.lbArtist); + this.mpGroupBox4.Controls.Add(this.dbGridView); + this.mpGroupBox4.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.mpGroupBox4.Location = new System.Drawing.Point(6, 6); + this.mpGroupBox4.Name = "mpGroupBox4"; + this.mpGroupBox4.Size = new System.Drawing.Size(536, 453); + this.mpGroupBox4.TabIndex = 29; + this.mpGroupBox4.TabStop = false; + this.mpGroupBox4.Text = "Find && Replace setting"; + // + // lbArtist + // + this.lbArtist.AutoSize = true; + this.lbArtist.Location = new System.Drawing.Point(6, 26); + this.lbArtist.Name = "lbArtist"; + this.lbArtist.Size = new System.Drawing.Size(302, 13); + this.lbArtist.TabIndex = 1; + this.lbArtist.Text = "Select words to be found and replaced when lyrics are caught."; + // // dbGridView // this.dbGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dbGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.Find, this.Replace}); - this.dbGridView.Location = new System.Drawing.Point(8, 6); + this.dbGridView.Location = new System.Drawing.Point(9, 55); this.dbGridView.Name = "dbGridView"; - this.dbGridView.Size = new System.Drawing.Size(244, 439); + this.dbGridView.Size = new System.Drawing.Size(244, 386); this.dbGridView.TabIndex = 0; this.dbGridView.Leave += new System.EventHandler(this.WriteMediaPortalXML); // @@ -946,7 +958,7 @@ this.tabPageAbout.Location = new System.Drawing.Point(4, 22); this.tabPageAbout.Name = "tabPageAbout"; this.tabPageAbout.Padding = new System.Windows.Forms.Padding(3); - this.tabPageAbout.Size = new System.Drawing.Size(550, 498); + this.tabPageAbout.Size = new System.Drawing.Size(550, 504); this.tabPageAbout.TabIndex = 4; this.tabPageAbout.Text = "About"; this.tabPageAbout.UseVisualStyleBackColor = true; @@ -973,7 +985,7 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(558, 524); + this.ClientSize = new System.Drawing.Size(558, 530); this.ControlBox = false; this.Controls.Add(this.btClose); this.Controls.Add(this.tabControl); @@ -1010,6 +1022,8 @@ this.groupBox1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.trackBar)).EndInit(); this.tabPageReplace.ResumeLayout(false); + this.mpGroupBox4.ResumeLayout(false); + this.mpGroupBox4.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.dbGridView)).EndInit(); this.ResumeLayout(false); @@ -1058,7 +1072,6 @@ private MediaPortal.UserInterface.Controls.MPLabel lbPluginName; private MediaPortal.UserInterface.Controls.MPGroupBox gbLyricSites; internal MediaPortal.UserInterface.Controls.MPCheckBox cbHotLyrics; - private MediaPortal.UserInterface.Controls.MPLabel tbNote; internal MediaPortal.UserInterface.Controls.MPCheckBox cbSeekLyrics; internal MediaPortal.UserInterface.Controls.MPCheckBox cbLyricsOnDemand; internal MediaPortal.UserInterface.Controls.MPCheckBox cbLyrics007; @@ -1094,5 +1107,7 @@ private System.Windows.Forms.DataGridView dbGridView; private System.Windows.Forms.DataGridViewTextBoxColumn Find; private System.Windows.Forms.DataGridViewTextBoxColumn Replace; + private MediaPortal.UserInterface.Controls.MPGroupBox mpGroupBox4; + private MediaPortal.UserInterface.Controls.MPLabel lbArtist; } } \ 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-17 16:52:29 UTC (rev 2444) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.cs 2008-12-17 17:43:20 UTC (rev 2445) @@ -81,6 +81,7 @@ bool m_automaticWriteToMusicTag = true; + string[] m_strippedPrefixStrings; const int m_NoOfCurrentSearchesAllowed = 6; @@ -92,6 +93,9 @@ private Queue lyricConfigInfosQueue; string[] sitesToSearchArray = null; + string m_find = string.Empty; + string m_replace = string.Empty; + // Timer variables int hour = 0; int min = 0; @@ -165,17 +169,17 @@ 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; - trackBar.Value = ((int)xmlreader.GetValueAsInt("myLyrics", "defaultSitesModeValue", 2)); - string find = xmlreader.GetValueAsString("myLyrics", "find", ""); - string replace = xmlreader.GetValueAsString("myLyrics", "replace", ""); + m_find = xmlreader.GetValueAsString("myLyrics", "find", ""); + m_replace = xmlreader.GetValueAsString("myLyrics", "replace", ""); - if (find != "") + if (m_find != "") { - string[] findArray = find.Split(','); - string[] replaceArray = replace.Split(','); + string[] findArray = m_find.Split(','); + string[] replaceArray = m_replace.Split(','); int valueIndex = 0; foreach (string findValue in findArray) @@ -770,9 +774,14 @@ // create worker thread instance if (lyricConfigInfosQueue.Count > 0) { - // start running the lyricController - lc = new LyricsController(this, m_EventStopThread, sitesToSearchArray, false, false); + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MediaPortal.xml")) + { + m_find = xmlreader.GetValueAsString("myLyrics", "find", ""); + m_replace = xmlreader.GetValueAsString("myLyrics", "replace", ""); + } + lc = new LyricsController(this, m_EventStopThread, sitesToSearchArray, false, false, m_find, m_replace); + lc.NoOfLyricsToSearch = lyricConfigInfosQueue.Count; ThreadStart runLyricController = delegate { @@ -1052,7 +1061,7 @@ foreach (DataGridViewRow row in dbGridView.Rows) { - if (row.Cells[0].Value != null) + if (row.Cells[0].Value != null && row.Cells[1].Value != null) { find.Append(row.Cells[0].Value.ToString().Replace(",","") + ","); replace.Append(row.Cells[1].Value.ToString().Replace(",", "") + ","); Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2008-12-17 16:52:29 UTC (rev 2444) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2008-12-17 17:43:20 UTC (rev 2445) @@ -43,6 +43,8 @@ string skin = ""; + bool deinitAlreadyCalled = false; + bool exitingMyLyrics = false; bool newTrack = false; bool alreadyValidLRC = false; @@ -80,8 +82,8 @@ int m_crossfade = 0; - string[] m_findArray = null; - string[] m_replaceArray = null; + string m_Find = string.Empty; + string m_Replace = string.Empty; string[] m_strippedPrefixStrings = null; @@ -204,7 +206,7 @@ { CurrentTrackTag.Artist = LyricUtil.CapatalizeString(GUIPropertyManager.GetProperty("#Play.Current.Artist")); CurrentTrackTag.Title = LyricUtil.CapatalizeString(GUIPropertyManager.GetProperty("#Play.Current.Title")); - CurrentTrackTag.Lyrics = TagReaderUtil.FixLyrics(CurrentTrackTag.Lyrics,m_findArray,m_replaceArray); + CurrentTrackTag.Lyrics = LyricUtil.FixLyrics(CurrentTrackTag.Lyrics); if (selectedScreen == (int)MyLyricsSettings.Screen.LRC_BASIC || selectedScreen == (int)MyLyricsSettings.Screen.LRC_WIDE) { @@ -348,15 +350,8 @@ m_crossfade = xmlreader.GetValueAsInt("audioplayer", "crossfade", 2000); - string find = xmlreader.GetValueAsString("myLyrics", "find", ""); - string replace = xmlreader.GetValueAsString("myLyrics", "replace", ""); - - if (find != "") - { - m_findArray = find.Split(','); - m_replaceArray = replace.Split(','); - } - + m_Find = xmlreader.GetValueAsString("myLyrics", "find", ""); + m_Replace = xmlreader.GetValueAsString("myLyrics", "replace", ""); } m_strippedPrefixStrings = MediaPortalUtil.GetStrippedPrefixStringArray(); @@ -427,6 +422,8 @@ exitingMyLyrics = false; base.OnMessage(message); + deinitAlreadyCalled = false; + LoadSettings(); LyricDiagnostics.OpenLog(MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Log, logName)); @@ -435,23 +432,29 @@ } case GUIMessage.MessageType.GUI_MSG_WINDOW_DEINIT: { - StopThread(); - resetAll(); - - if (m_WriteTagTimer != null) + if (deinitAlreadyCalled == false) { - m_WriteTagTimer.Stop(); - m_WriteTagTimer.Close(); - m_WriteTagTimer.Dispose(); - m_WriteTagTimer = null; - } + deinitAlreadyCalled = true; - //deregister the handler! - GUIPropertyManager.OnPropertyChanged -= new GUIPropertyManager.OnPropertyChangedHandler(trackChangeHandler); + StopThread(); + resetAll(); - LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Stop, 0, LyricDiagnostics.ElapsedTimeString() + "MyLyrics closes."); + if (m_WriteTagTimer != null) + { + m_WriteTagTimer.Stop(); + m_WriteTagTimer.Close(); + m_WriteTagTimer.Dispose(); + m_WriteTagTimer = null; + } - GUIWindowManager.ShowPreviousWindow(); + //deregister the handler! + GUIPropertyManager.OnPropertyChanged -= new GUIPropertyManager.OnPropertyChangedHandler(trackChangeHandler); + + LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Stop, 0, LyricDiagnostics.ElapsedTimeString() + "MyLyrics closes."); + + GUIWindowManager.ShowPreviousWindow(); + + } break; } } @@ -477,62 +480,62 @@ switch (action.wID) { case Action.ActionType.ACTION_PREVIOUS_MENU: - { - GUIWindowManager.ShowPreviousWindow(); - break; - } - case Action.ActionType.ACTION_KEY_PRESSED: - { - if (action.m_key.KeyChar.Equals(13)) { - tagLine(); + GUIWindowManager.ShowPreviousWindow(); + break; } - else if (action.m_key.KeyChar.Equals(40) || action.m_key.KeyChar.Equals(101)) + case Action.ActionType.ACTION_KEY_PRESSED: { - lyricsFound = false; - if (selectedScreen != (int)MyLyricsSettings.Screen.LRC_EDITOR) + if (action.m_key.KeyChar.Equals(13)) { - resetGUI((int)MyLyricsSettings.Screen.LRC_EDITOR); - + tagLine(); } - else + else if (action.m_key.KeyChar.Equals(40) || action.m_key.KeyChar.Equals(101)) { - // parameter could be anything but LRC_EDITOR. Will find correct type when running findLyric(). - resetGUI((int)MyLyricsSettings.Screen.LYRICS_BASIC); - } + lyricsFound = false; + if (selectedScreen != (int)MyLyricsSettings.Screen.LRC_EDITOR) + { + resetGUI((int)MyLyricsSettings.Screen.LRC_EDITOR); - newTrack = true; - Process(); - } - else if (action.m_key.KeyChar.Equals(35) || action.m_key.KeyChar.Equals(119)) - { - if (selectedScreen == (int)MyLyricsSettings.Screen.LYRICS_BASIC) - { - basicScreenSelected = false; - resetGUI((int)MyLyricsSettings.Screen.LYRICS_WIDE); - GUIControl.SetControlLabel(GetID, (int)GUI_Lyrics_Controls.CONTROL_LyricWide, m_LyricText); - GUIControl.FocusControl(GetID, (int)GUI_Lyrics_Controls.CONTROL_LyricWide); + } + else + { + // parameter could be anything but LRC_EDITOR. Will find correct type when running findLyric(). + resetGUI((int)MyLyricsSettings.Screen.LYRICS_BASIC); + } + + newTrack = true; + Process(); } - else if (selectedScreen == (int)MyLyricsSettings.Screen.LYRICS_WIDE) + else if (action.m_key.KeyChar.Equals(35) || action.m_key.KeyChar.Equals(119)) { - basicScreenSelected = true; - resetGUI((int)MyLyricsSettings.Screen.LYRICS_BASIC); - GUIControl.SetControlLabel(GetID, (int)GUI_Lyrics_Controls.CONTROL_Lyric, m_LyricText); - GUIControl.FocusControl(GetID, (int)GUI_Lyrics_Controls.CONTROL_Lyric); + if (selectedScreen == (int)MyLyricsSettings.Screen.LYRICS_BASIC) + { + basicScreenSelected = false; + resetGUI((int)MyLyricsSettings.Screen.LYRICS_WIDE); + GUIControl.SetControlLabel(GetID, (int)GUI_Lyrics_Controls.CONTROL_LyricWide, m_LyricText); + GUIControl.FocusControl(GetID, (int)GUI_Lyrics_Controls.CONTROL_LyricWide); + } + else if (selectedScreen == (int)MyLyricsSettings.Screen.LYRICS_WIDE) + { + basicScreenSelected = true; + resetGUI((int)MyLyricsSettings.Screen.LYRICS_BASIC); + GUIControl.SetControlLabel(GetID, (int)GUI_Lyrics_Controls.CONTROL_Lyric, m_LyricText); + GUIControl.FocusControl(GetID, (int)GUI_Lyrics_Controls.CONTROL_Lyric); + } + else if (selectedScreen == (int)MyLyricsSettings.Screen.LRC_BASIC) + { + basicScreenSelected = false; + findLyric(); + } + else if (selectedScreen == (int)MyLyricsSettings.Screen.LRC_WIDE) + { + basicScreenSelected = true; + findLyric(); + } } - else if (selectedScreen == (int)MyLyricsSettings.Screen.LRC_BASIC) - { - basicScreenSelected = false; - findLyric(); - } - else if (selectedScreen == (int)MyLyricsSettings.Screen.LRC_WIDE) - { - basicScreenSelected = true; - findLyric(); - } + break; } - break; - } case Action.ActionType.ACTION_REWIND: case Action.ActionType.ACTION_FORWARD: case Action.ActionType.ACTION_MUSIC_FORWARD: @@ -540,9 +543,15 @@ case Action.ActionType.ACTION_MUSIC_REWIND: case Action.ActionType.ACTION_PAUSE: case Action.ActionType.ACTION_PLAY: - { - break; - } + { + break; + } + case Action.ActionType.ACTION_EXIT: + case Action.ActionType.ACTION_END: + case Action.ActionType.ACTION_SHUTDOWN: + { + break; + } } base.OnAction(action); } @@ -707,7 +716,7 @@ // 2) Lyric in music tag else if (CurrentTrackTag.Lyrics.Length != 0) { - CurrentTrackTag.Lyrics = TagReaderUtil.FixLyrics(CurrentTrackTag.Lyrics,m_findArray,m_replaceArray); + CurrentTrackTag.Lyrics = LyricUtil.FixLyrics(CurrentTrackTag.Lyrics); ShowLyricOnScreen(CurrentTrackTag.Lyrics, CurrentTrackTag.FileName); } @@ -722,7 +731,7 @@ { lyricsFound = false; - lc = new LyricsController(this, m_EventStopThread, m_sitesToSearch, false, false); + lc = new LyricsController(this, m_EventStopThread, m_sitesToSearch, false, false, m_Find, m_Replace); // create worker thread instance ThreadStart job = delegate { @@ -911,7 +920,7 @@ GUIControl.FocusControl(GetID, (int)GUI_Lyrics_Controls.CONTROL_LyricWide); } - + } } @@ -1029,7 +1038,7 @@ if (selectedScreen == (int)MyLyricsSettings.Screen.LYRICS_BASIC) { GUIPropertyManager.OnPropertyChanged += new GUIPropertyManager.OnPropertyChangedHandler(trackChangeHandler); - + GUIControl.SetControlLabel(GetID, (int)GUI_General_Controls.CONTROL_TITLE, "Lyrics basic"); GUIControl.ClearControl(GetID, (int)GUI_Lyrics_Controls.CONTROL_Lyric); Modified: trunk/plugins/MyLyrics/My Lyrics/TagReaderUtil.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/TagReaderUtil.cs 2008-12-17 16:52:29 UTC (rev 2444) +++ trunk/plugins/MyLyrics/My Lyrics/TagReaderUtil.cs 2008-12-17 17:43:20 UTC (rev 2445) @@ -44,34 +44,5 @@ else return false; } - - public static string FixLyrics(string lyrics) - { - lyrics = Regex.Replace(lyrics, "('){2,}", "'"); - return lyrics; - } - - public static string FixLyrics(string lyrics, string[] find, string[] replace) - { - lyrics = Regex.Replace(lyrics, "('){2,}", "'"); - - - if (find != null) - { - int valueIndex = 0; - - foreach (string findValue in find) - { - - if (findValue != "") - { - lyrics = lyrics.Replace(findValue, replace[valueIndex]); - valueIndex++; - } - } - } - - return lyrics; - } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2008-12-18 15:29:55
|
Revision: 2448 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2448&view=rev Author: saamand Date: 2008-12-18 15:29:52 +0000 (Thu, 18 Dec 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MyLyrics/LyricsEngine/LyricSearch.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/ExportTags.Designer.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/ImportTags.Designer.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.Designer.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.resx trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs Added Paths: ----------- trunk/plugins/MyLyrics/Skin/Blue3wide/ trunk/plugins/MyLyrics/Skin/Blue3wide/myLyrics.xml Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricSearch.cs =================================================================== (Binary files differ) Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs 2008-12-18 10:24:52 UTC (rev 2447) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs 2008-12-18 15:29:52 UTC (rev 2448) @@ -36,14 +36,14 @@ this.label4 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); this.panel1 = new System.Windows.Forms.Panel(); + this.label10 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); this.label8 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.linkLabelForum = new System.Windows.Forms.LinkLabel(); - this.label9 = new System.Windows.Forms.Label(); - this.label10 = new System.Windows.Forms.Label(); this.label11 = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.SuspendLayout(); @@ -132,6 +132,27 @@ this.panel1.Size = new System.Drawing.Size(480, 269); this.panel1.TabIndex = 8; // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(12, 180); + this.label10.MaximumSize = new System.Drawing.Size(460, 0); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(334, 13); + this.label10.TabIndex = 13; + this.label10.Text = "- Select words to be found and replace during viewing and searching."; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label9.ForeColor = System.Drawing.Color.Black; + this.label9.Location = new System.Drawing.Point(3, 163); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(89, 15); + this.label9.TabIndex = 12; + this.label9.Text = "Find && replace:"; + // // label8 // this.label8.AutoSize = true; @@ -201,27 +222,6 @@ this.linkLabelForum.Text = "MyLyrics plugin forum section"; this.linkLabelForum.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabelForum_LinkClicked); // - // label9 - // - this.label9.AutoSize = true; - this.label9.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label9.ForeColor = System.Drawing.Color.Black; - this.label9.Location = new System.Drawing.Point(3, 163); - this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(89, 15); - this.label9.TabIndex = 12; - this.label9.Text = "Find && replace:"; - // - // label10 - // - this.label10.AutoSize = true; - this.label10.Location = new System.Drawing.Point(12, 180); - this.label10.MaximumSize = new System.Drawing.Size(460, 0); - this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(334, 13); - this.label10.TabIndex = 13; - this.label10.Text = "- Select words to be found and replace during viewing and searching."; - // // label11 // this.label11.AutoSize = true; Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/ExportTags.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/ExportTags.Designer.cs 2008-12-18 10:24:52 UTC (rev 2447) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/ExportTags.Designer.cs 2008-12-18 15:29:52 UTC (rev 2448) @@ -179,7 +179,7 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(268, 191); + this.ClientSize = new System.Drawing.Size(264, 191); this.ControlBox = false; this.Controls.Add(this.lbCurrentArtist); this.Controls.Add(this.btClose); Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/ImportTags.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/ImportTags.Designer.cs 2008-12-18 10:24:52 UTC (rev 2447) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/ImportTags.Designer.cs 2008-12-18 15:29:52 UTC (rev 2448) @@ -74,7 +74,7 @@ // // btStart // - this.btStart.Location = new System.Drawing.Point(13, 166); + this.btStart.Location = new System.Drawing.Point(13, 163); this.btStart.Name = "btStart"; this.btStart.Size = new System.Drawing.Size(66, 23); this.btStart.TabIndex = 2; @@ -148,7 +148,7 @@ // // btCancel // - this.btCancel.Location = new System.Drawing.Point(85, 166); + this.btCancel.Location = new System.Drawing.Point(85, 163); this.btCancel.Name = "btCancel"; this.btCancel.Size = new System.Drawing.Size(66, 23); this.btCancel.TabIndex = 14; @@ -158,7 +158,7 @@ // // btClose // - this.btClose.Location = new System.Drawing.Point(196, 166); + this.btClose.Location = new System.Drawing.Point(196, 163); this.btClose.Name = "btClose"; this.btClose.Size = new System.Drawing.Size(66, 23); this.btClose.TabIndex = 15; @@ -179,7 +179,7 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(268, 191); + this.ClientSize = new System.Drawing.Size(264, 192); this.ControlBox = false; this.Controls.Add(this.lbCurrentArtist); this.Controls.Add(this.btClose); Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.Designer.cs 2008-12-18 10:24:52 UTC (rev 2447) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.Designer.cs 2008-12-18 15:29:52 UTC (rev 2448) @@ -19,6 +19,8 @@ this.btDelete = new System.Windows.Forms.Button(); this.btAdd = new System.Windows.Forms.Button(); this.gbLibrary = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.btRefresh = new System.Windows.Forms.Button(); + this.tbLyrics = new System.Windows.Forms.TextBox(); this.gbExport = new MediaPortal.UserInterface.Controls.MPGroupBox(); this.btExportTags = new MediaPortal.UserInterface.Controls.MPButton(); this.btImportTags = new MediaPortal.UserInterface.Controls.MPButton(); @@ -43,7 +45,6 @@ this.btResetLyricsDatabase = new System.Windows.Forms.Button(); this.lbResetDatabase = new MediaPortal.UserInterface.Controls.MPLabel(); this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog(); - this.tbLyrics = new System.Windows.Forms.TextBox(); this.gbLibrary.SuspendLayout(); this.gbExport.SuspendLayout(); this.gbImport.SuspendLayout(); @@ -94,6 +95,7 @@ // // gbLibrary // + this.gbLibrary.Controls.Add(this.btRefresh); this.gbLibrary.Controls.Add(this.tbLyrics); this.gbLibrary.Controls.Add(this.gbExport); this.gbLibrary.Controls.Add(this.gbImport); @@ -117,6 +119,25 @@ this.gbLibrary.TabStop = false; this.gbLibrary.Text = "Editor"; // + // btRefresh + // + this.btRefresh.Location = new System.Drawing.Point(242, 15); + this.btRefresh.Name = "btRefresh"; + this.btRefresh.Size = new System.Drawing.Size(55, 21); + this.btRefresh.TabIndex = 36; + this.btRefresh.Text = "&Refresh"; + this.btRefresh.UseVisualStyleBackColor = true; + this.btRefresh.Click += new System.EventHandler(this.btRefresh_Click); + // + // tbLyrics + // + this.tbLyrics.Location = new System.Drawing.Point(241, 78); + this.tbLyrics.Multiline = true; + this.tbLyrics.Name = "tbLyrics"; + this.tbLyrics.Size = new System.Drawing.Size(285, 213); + this.tbLyrics.TabIndex = 35; + this.tbLyrics.KeyUp += new System.Windows.Forms.KeyEventHandler(this.tbLyrics_KeyUp); + // // gbExport // this.gbExport.Controls.Add(this.btExportTags); @@ -360,15 +381,6 @@ "erns [Artist]-[Title].txt and *.lrc will be included to the lyrics database."; this.folderBrowserDialog1.ShowNewFolderButton = false; // - // tbLyrics - // - this.tbLyrics.Location = new System.Drawing.Point(241, 78); - this.tbLyrics.Multiline = true; - this.tbLyrics.Name = "tbLyrics"; - this.tbLyrics.Size = new System.Drawing.Size(285, 213); - this.tbLyrics.TabIndex = 35; - this.tbLyrics.KeyUp += new System.Windows.Forms.KeyEventHandler(this.tbLyrics_KeyUp); - // // LyricsLibrary // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -420,5 +432,6 @@ private MediaPortal.UserInterface.Controls.MPGroupBox gbExport; internal MediaPortal.UserInterface.Controls.MPButton btImportTags; private System.Windows.Forms.TextBox tbLyrics; + internal System.Windows.Forms.Button btRefresh; } } Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.cs 2008-12-18 10:24:52 UTC (rev 2447) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.cs 2008-12-18 15:29:52 UTC (rev 2448) @@ -857,5 +857,10 @@ ExportTags exportTags = new ExportTags(); exportTags.ShowDialog(); } + + private void btRefresh_Click(object sender, EventArgs e) + { + updateLyricsTree(); + } } } Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs 2008-12-18 10:24:52 UTC (rev 2447) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs 2008-12-18 15:29:52 UTC (rev 2448) @@ -559,7 +559,7 @@ this.lbSongsWithLyric.Name = "lbSongsWithLyric"; this.lbSongsWithLyric.Size = new System.Drawing.Size(91, 15); this.lbSongsWithLyric.TabIndex = 22; - this.lbSongsWithLyric.Text = "Songs with lyrics:"; + this.lbSongsWithLyric.Text = "Songs with lyric:"; // // lbTotalSongs2 // Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.resx =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.resx 2008-12-18 10:24:52 UTC (rev 2447) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.resx 2008-12-18 15:29:52 UTC (rev 2448) @@ -123,6 +123,12 @@ <metadata name="Replace.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> + <metadata name="Find.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </metadata> + <metadata name="Replace.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </metadata> <metadata name="bgWorkerSearch.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>6, 4</value> </metadata> Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2008-12-18 10:24:52 UTC (rev 2447) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2008-12-18 15:29:52 UTC (rev 2448) @@ -43,12 +43,12 @@ string skin = ""; - bool deinitAlreadyCalled = false; - bool exitingMyLyrics = false; bool newTrack = false; bool alreadyValidLRC = false; + bool m_OkToCallPreviousMenu = false; + private string CurrentThumbFileName = string.Empty; private MusicTag PreviousTrackTag = null; private MusicTag CurrentTrackTag = null; @@ -413,56 +413,35 @@ { } - public override bool OnMessage(GUIMessage message) - { - switch (message.Message) - { - case GUIMessage.MessageType.GUI_MSG_WINDOW_INIT: - { - exitingMyLyrics = false; - base.OnMessage(message); + //public override bool OnMessage(GUIMessage message) + //{ + // switch (message.Message) + // { + // case GUIMessage.MessageType.GUI_MSG_WINDOW_INIT: + // { + // } + // case GUIMessage.MessageType.GUI_MSG_WINDOW_DEINIT: + // { + // //m_MPisClosing = true; + // //++m_NoDenitPageIsCalled; + // //break; + // } + // } - deinitAlreadyCalled = false; + // return base.OnMessage(message); + //} - LoadSettings(); + protected override void OnPageLoad() + { + exitingMyLyrics = false; - LyricDiagnostics.OpenLog(MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Log, logName)); - LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Start, 0, LyricDiagnostics.ElapsedTimeString() + "MyLyrics opens."); - return true; - } - case GUIMessage.MessageType.GUI_MSG_WINDOW_DEINIT: - { - if (deinitAlreadyCalled == false) - { - deinitAlreadyCalled = true; + LoadSettings(); - StopThread(); - resetAll(); + m_OkToCallPreviousMenu = false; - if (m_WriteTagTimer != null) - { - m_WriteTagTimer.Stop(); - m_WriteTagTimer.Close(); - m_WriteTagTimer.Dispose(); - m_WriteTagTimer = null; - } + LyricDiagnostics.OpenLog(MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Log, logName)); + LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Start, 0, LyricDiagnostics.ElapsedTimeString() + "MyLyrics opens."); - //deregister the handler! - GUIPropertyManager.OnPropertyChanged -= new GUIPropertyManager.OnPropertyChangedHandler(trackChangeHandler); - - LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Stop, 0, LyricDiagnostics.ElapsedTimeString() + "MyLyrics closes."); - - GUIWindowManager.ShowPreviousWindow(); - - } - break; - } - } - return base.OnMessage(message); - } - - protected override void OnPageLoad() - { base.OnPageLoad(); if (ImageChangeTimer == null) @@ -474,15 +453,42 @@ } } + protected override void OnPageDestroy(int new_windowId) + { + StopThread(); + resetAll(); + + if (m_WriteTagTimer != null) + { + m_WriteTagTimer.Stop(); + m_WriteTagTimer.Close(); + m_WriteTagTimer.Dispose(); + m_WriteTagTimer = null; + } + + //deregister the handler! + GUIPropertyManager.OnPropertyChanged -= new GUIPropertyManager.OnPropertyChangedHandler(trackChangeHandler); + + LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Stop, 0, LyricDiagnostics.ElapsedTimeString() + "MyLyrics closes."); + + // Is MP closing? If not call ShowPreviousWindow() + if (m_OkToCallPreviousMenu == true) + { + GUIWindowManager.ShowPreviousWindow(); + } + } + + public override void OnAction(Action action) { switch (action.wID) { case Action.ActionType.ACTION_PREVIOUS_MENU: { + m_OkToCallPreviousMenu = true; GUIWindowManager.ShowPreviousWindow(); - break; + return; } case Action.ActionType.ACTION_KEY_PRESSED: { Added: trunk/plugins/MyLyrics/Skin/Blue3wide/myLyrics.xml =================================================================== --- trunk/plugins/MyLyrics/Skin/Blue3wide/myLyrics.xml (rev 0) +++ trunk/plugins/MyLyrics/Skin/Blue3wide/myLyrics.xml 2008-12-18 15:29:52 UTC (rev 2448) @@ -0,0 +1,966 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<window> + <id>90478</id> + <defaultcontrol>20</defaultcontrol> + <allowoverlay>no</allowoverlay> + <controls> + <control> + <type>image</type> + <description>background image</description> + <id>0</id> + <texture>background.png</texture> + </control> + <control> + <type>textbox</type> + <description>The Lyric area</description> + <id>21</id> + <posX>110</posX> + <posY>120</posY> + <width>1160</width> + <height>480</height> + <onleft>2</onleft> + <onright>2</onright> + <onup>2</onup> + <ondown>2</ondown> + <image>icon-folder.png</image> + <label>-</label> + <seperator>----------------------------------------------------------------------------------------------</seperator> + <text>6</text> + <font>font14</font> + <SpinPosX>48</SpinPosX> + <SpinPosY>442</SpinPosY> + </control> + <control> + <type>label</type> + <description>Status</description> + <id>11</id> + <posX>110</posX> + <posY>120</posY> + <label>No media playing</label> + <font>font12</font> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>image</type> + <description>menu background image</description> + <id>34</id> + <posX>58</posX> + <posY>566</posY> + <width>1250</width> + <height>189</height> + <!--<texture>osd_bg.png</texture> + <animation effect="fade" time="150">WindowOpen</animation>--> + </control> + <control> + <type>fadelabel</type> + <description>track label</description> + <id>33</id> + <posX>262</posX> + <posY>682</posY> + <width>600</width> + <height>28</height> + <label>#Play.Current.Track</label> + <font>font16</font> + <animation effect="fade" time="150">WindowOpen</animation> + </control> + <control> + <type>fadelabel</type> + <description>track label</description> + <id>32</id> + <posX>262</posX> + <posY>646</posY> + <width>600</width> + <height>26</height> + <label>#Play.Current.Artist</label> + <font>font16</font> + <animation effect="fade" time="150">WindowOpen</animation> + </control> + <control> + <type>fadelabel</type> + <description>track label</description> + <id>30</id> + <posX>262</posX> + <posY>602</posY> + <width>600</width> + <height>26</height> + <label>#Play.Current.Title</label> + <font>font18</font> + <animation effect="fade" time="150">WindowOpen</animation> + </control> + <control> + <type>textbox</type> + <description>The Lyric area</description> + <id>20</id> + <posX>110</posX> + <posY>120</posY> + <width>760</width> + <height>480</height> + <onleft>2</onleft> + <onright>2</onright> + <onup>2</onup> + <ondown>2</ondown> + <image>icon-folder.png</image> + <label>-</label> + <seperator>----------------------------------------------------------------------------------------------</seperator> + <text>6</text> + <font>font14</font> + <SpinPosX>48</SpinPosX> + <SpinPosY>442</SpinPosY> + </control> + <control> + <type>image</type> + <description>title image</description> + <id>35</id> + <posX>113</posX> + <posY>26</posY> + <texture flipY="true" diffuse="Thumb_Mask.png">music_logo.png</texture> + <animation effect="fade" time="150">WindowOpen</animation> + </control> + <control> + <type>image</type> + <description>nowplaying background</description> + <id>31</id> + <posX>886</posX> + <posY>56</posY> + <width>400</width> + <height>484</height> + <texture>nowplaying_background.png</texture> + <animation effect="fade" time="150">WindowOpen</animation> + </control> + <control> + <type>image</type> + <description>album art image</description> + <id>112</id> + <posX>908</posX> + <posY>122</posY> + <width>350</width> + <height>350</height> + <texture>-</texture> + <centered>yes</centered> + <zoom>yes</zoom> + </control> + <control> + <type>fadelabel</type> + <description>year label</description> + <id>27</id> + <posX>1258</posX> + <posY>86</posY> + <width>150</width> + <label>#Play.Current.Year</label> + <font>font13</font> + <align>right</align> + <!-- <textcolor>white</textcolor> --> + </control> + <control> + <type>label</type> + <description>album label</description> + <id>26</id> + <posX>908</posX> + <posY>86</posY> + <width>230</width> + <label>#Play.Current.Album</label> + <font>font13</font> + <align>left</align> + <!-- <textcolor>white</textcolor> --> + <animation effect="fade" time="150">WindowOpen</animation> + </control> + <control> + <type>image</type> + <id>117</id> + <posX>970</posX> + <posY>482</posY> + <width>220</width> + <texture>osd_progress_background.png</texture> + <animation effect="fade" time="150">WindowOpen</animation> + </control> + <control> + <type>progress</type> + <description>track progress</description> + <id>118</id> + <posX>960</posX> + <posY>482</posY> + <width>240</width> + </control> + <control> + <type>label</type> + <description>track progress label</description> + <id>24</id> + <posX>908</posX> + <posY>482</posY> + <label>#currentplaytime</label> + <font>font14</font> + <align>left</align> + <textcolor>80ffffff</textcolor> + <animation effect="fade" time="150">WindowOpen</animation> + </control> + <control> + <type>label</type> + <description>track duration label</description> + <id>25</id> + <posX>1258</posX> + <posY>482</posY> + <label>#duration</label> + <font>font14</font> + <align>right</align> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>up next label</description> + <id>20</id> + <posX>1239</posX> + <posY>609</posY> + <label>4541</label> + <font>font14</font> + <align>right</align> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>fadelabel</type> + <description>next track label</description> + <id>121</id> + <posX>1237</posX> + <posY>684</posY> + <width>300</width> + <label>#Play.Next.Title</label> + <align>right</align> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>fadelabel</type> + <description>next artist label</description> + <id>123</id> + <posX>1235</posX> + <posY>652</posY> + <width>300</width> + <label>#Play.Next.Artist</label> + <align>right</align> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 0</description> + <id>400</id> + <width>1160</width> + <posX>112</posX> + <posY>120</posY> + <colordiffuse>80ffffff</colordiffuse> + <label>line 0</label> + <font>font14</font> + <textcolor>80ffffff</textcolor> + <disabledcolor>ffffffff</disabledcolor> + </control> + <control> + <type>label</type> + <description>line 0</description> + <id>500</id> + <width>1160</width> + <posX>112</posX> + <posY>120</posY> + <label>line 0</label> + <font>font14</font> + <textcolor>ffffffff</textcolor> + <disabledcolor>ffffffff</disabledcolor> + </control> + <control> + <type>label</type> + <description>line 1</description> + <id>401</id> + <width>1160</width> + <posX>112</posX> + <posY>152</posY> + <label>line 1</label> + <font>font14</font> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 1</description> + <id>501</id> + <width>1160</width> + <posX>112</posX> + <posY>152</posY> + <label>line 1</label> + <font>font14</font> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 2</description> + <id>402</id> + <width>1160</width> + <posX>112</posX> + <posY>184</posY> + <label>line 2</label> + <font>font14</font> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 2</description> + <id>502</id> + <width>1160</width> + <posX>112</posX> + <posY>184</posY> + <label>line 2</label> + <font>font14</font> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 3</description> + <id>403</id> + <width>1160</width> + <posX>112</posX> + <posY>216</posY> + <label>line 3</label> + <font>font14</font> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 3</description> + <id>503</id> + <width>1160</width> + <posX>112</posX> + <posY>216</posY> + <label>line 3</label> + <font>font14</font> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 4</description> + <id>404</id> + <width>1160</width> + <posX>112</posX> + <posY>248</posY> + <label>line 4</label> + <font>font14</font> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 4</description> + <id>504</id> + <width>1160</width> + <posX>112</posX> + <posY>248</posY> + <label>line 4</label> + <font>font14</font> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 5</description> + <id>405</id> + <width>1160</width> + <posX>112</posX> + <posY>280</posY> + <label>line 5</label> + <font>font14</font> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 5</description> + <id>505</id> + <width>1160</width> + <posX>112</posX> + <posY>280</posY> + <label>line 5</label> + <font>font14</font> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 6</description> + <id>406</id> + <width>1160</width> + <posX>112</posX> + <posY>312</posY> + <label>line 6</label> + <font>font14</font> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 6</description> + <id>506</id> + <width>1160</width> + <posX>112</posX> + <posY>312</posY> + <label>line 6</label> + <font>font14</font> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 7</description> + <id>407</id> + <width>1160</width> + <posX>112</posX> + <posY>344</posY> + <label>line 7</label> + <font>font14</font> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 7</description> + <id>507</id> + <width>1160</width> + <posX>112</posX> + <posY>344</posY> + <label>line 7</label> + <font>font14</font> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 8</description> + <id>408</id> + <width>1160</width> + <posX>112</posX> + <posY>376</posY> + <label>line 8</label> + <font>font14</font> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 8</description> + <id>508</id> + <width>1160</width> + <posX>112</posX> + <posY>376</posY> + <label>line 8</label> + <font>font14</font> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 9</description> + <id>409</id> + <width>1160</width> + <posX>112</posX> + <posY>408</posY> + <label>line 9</label> + <font>font14</font> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 9</description> + <id>509</id> + <width>1160</width> + <posX>112</posX> + <posY>408</posY> + <label>line 9</label> + <font>font14</font> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 10</description> + <id>410</id> + <width>1160</width> + <posX>112</posX> + <posY>440</posY> + <label>line 10</label> + <font>font14</font> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 10</description> + <id>510</id> + <width>1160</width> + <posX>112</posX> + <posY>440</posY> + <label>line 10</label> + <font>font14</font> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 11</description> + <id>411</id> + <width>1160</width> + <posX>112</posX> + <posY>472</posY> + <label>line 11</label> + <font>font14</font> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 11</description> + <id>511</id> + <width>1160</width> + <posX>112</posX> + <posY>472</posY> + <label>line 11</label> + <font>font14</font> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 12</description> + <id>412</id> + <width>1160</width> + <posX>112</posX> + <posY>504</posY> + <label>line 12</label> + <font>font14</font> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 12</description> + <id>512</id> + <width>1160</width> + <posX>112</posX> + <posY>504</posY> + <label>line 12</label> + <font>font14</font> + <textcolor>ffffffff</textcolor> + </control> + + + <control> + <type>label</type> + <description>line 0</description> + <id>200</id> + <width>1160</width> + <posX>112</posX> + <posY>120</posY> + <colordiffuse>80ffffff</colordiffuse> + <label>line 0</label> + <font>font14</font> + <textcolor>80ffffff</textcolor> + <disabledcolor>ffffffff</disabledcolor> + </control> + <control> + <type>label</type> + <description>line 0</description> + <id>300</id> + <width>1160</width> + <posX>112</posX> + <posY>120</posY> + <label>line 0</label> + <font>font14</font> + <textcolor>ffffffff</textcolor> + <disabledcolor>ffffffff</disabledcolor> + </control> + <control> + <type>label</type> + <description>line 1</description> + <id>201</id> + <width>1160</width> + <posX>112</posX> + <posY>152</posY> + <label>line 1</label> + <font>font14</font> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 1</description> + <id>301</id> + <width>1160</width> + <posX>112</posX> + <posY>152</posY> + <label>line 1</label> + <font>font14</font> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 2</description> + <id>202</id> + <width>1160</width> + <posX>112</posX> + <posY>184</posY> + <label>line 2</label> + <font>font14</font> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 2</description> + <id>302</id> + <width>1160</width> + <posX>112</posX> + <posY>184</posY> + <label>line 2</label> + <font>font14</font> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 3</description> + <id>203</id> + <width>1160</width> + <posX>112</posX> + <posY>216</posY> + <label>line 3</label> + <font>font14</font> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 3</description> + <id>303</id> + <width>1160</width> + <posX>112</posX> + <posY>216</posY> + <label>line 3</label> + <font>font14</font> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 4</description> + <id>204</id> + <width>1160</width> + <posX>112</posX> + <posY>248</posY> + <label>line 4</label> + <font>font14</font> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 4</description> + <id>304</id> + <width>1160</width> + <posX>112</posX> + <posY>248</posY> + <label>line 4</label> + <font>font14</font> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 5</description> + <id>205</id> + <width>1160</width> + <posX>112</posX> + <posY>280</posY> + <label>line 5</label> + <font>font14</font> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 5</description> + <id>305</id> + <width>1160</width> + <posX>112</posX> + <posY>280</posY> + <label>line 5</label> + <font>font14</font> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 6</description> + <id>206</id> + <width>1160</width> + <posX>112</posX> + <posY>312</posY> + <label>line 6</label> + <font>font14</font> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 6</description> + <id>306</id> + <width>1160</width> + <posX>112</posX> + <posY>312</posY> + <label>line 6</label> + <font>font14</font> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 7</description> + <id>207</id> + <width>1160</width> + <posX>112</posX> + <posY>344</posY> + <label>line 7</label> + <font>font14</font> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 7</description> + <id>307</id> + <width>1160</width> + <posX>112</posX> + <posY>344</posY> + <label>line 7</label> + <font>font14</font> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 8</description> + <id>208</id> + <width>1160</width> + <posX>112</posX> + <posY>376</posY> + <label>line 8</label> + <font>font14</font> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 8</description> + <id>308</id> + <width>1160</width> + <posX>112</posX> + <posY>376</posY> + <label>line 8</label> + <font>font14</font> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 9</description> + <id>209</id> + <width>1160</width> + <posX>112</posX> + <posY>408</posY> + <label>line 9</label> + <font>font14</font> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 9</description> + <id>309</id> + <width>1160</width> + <posX>112</posX> + <posY>408</posY> + <label>line 9</label> + <font>font14</font> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 10</description> + <id>210</id> + <width>1160</width> + <posX>112</posX> + <posY>440</posY> + <label>line 10</label> + <font>font14</font> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 10</description> + <id>310</id> + <width>1160</width> + <posX>112</posX> + <posY>440</posY> + <label>line 10</label> + <font>font14</font> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 11</description> + <id>211</id> + <width>1160</width> + <posX>112</posX> + <posY>472</posY> + <label>line 11</label> + <font>font14</font> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 11</description> + <id>311</id> + <width>1160</width> + <posX>112</posX> + <posY>472</posY> + <label>line 11</label> + <font>font14</font> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 12</description> + <id>212</id> + <width>1160</width> + <posX>112</posX> + <posY>504</posY> + <label>line 12</label> + <font>font14</font> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 12</description> + <id>312</id> + <width>1160</width> + <posX>112</posX> + <posY>504</posY> + <label>line 12</label> + <font>font14</font> + <textcolor>ffffffff</textcolor> + </control> + + + <control> + <type>label</type> + <description>time 0</description> + <id>600</id> + <width>100</width> + <posX>16</posX> + <posY>124</posY> + <label>(xx:xx:xx)</label> + <font>font10</font> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>time 1</description> + <id>601</id> + <width>100</width> + <posX>16</posX> + <posY>156</posY> + <label>(xx:xx:xx)</label> + <font>font10</font> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>time 2</description> + <id>602</id> + <width>100</width> + <posX>16</posX> + <posY>188</posY> + <label>(xx:xx:xx)</label> + <font>font10</font> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>time 3</description> + <id>603</id> + <width>100</width> + <posX>16</posX> + <posY>220</posY> + <label>(xx:xx:xx)</label> + <font>font10</font> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>time 4</description> + <id>604</id> + <width>100</width> + <posX>16</posX> + <posY>252</posY> + <label>(xx:xx:xx)</label> + <font>font10</font> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>time 5</description> + <id>605</id> + <width>100</width> + <posX>16</posX> + <posY>284</posY> + <label>(xx:xx:xx)</label> + <font>font10</font> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>time 6</description> + <id>606</id> + <width>100</width> + <posX>16</posX> + <posY>316</posY> + <label>(xx:xx:xx)</label> + <font>font10</font> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>time 7</description> + <id>607</id> + <width>100</width> + <posX>16</posX> + <posY>348</posY> + <label>(xx:xx:xx)</label> + <font>font10</font> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>time 8</description> + <id>608</id> + <width>100</width> + <posX>16</posX> + <posY>380</posY> + <label>(xx:xx:xx)</label> + <font>font10</font> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>time 9</description> + <id>609</id> + <width>100</width> + <posX>16</posX> + <posY>412</posY> + <label>(xx:xx:xx)</label> + <font>font10</font> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>time 10</description> + <id>610</id> + <width>100</width> + <posX>16</posX> + <posY>444</posY> + <label>(xx:xx:xx)</label> + <font>font10</font> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>time 11</description> + <id>611</id> + <width>100</width> + <posX>16</posX> + <posY>476</posY> + <label>(xx:xx:xx)</label> + <font>font10</font> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>time 12</description> + <id>612</id> + <width>100</width> + <posX>16</posX> + <posY>508</posY> + <label>(xx:xx:xx)</label> + <font>font10</font> + <textcolor>80ffffff</textcolor> + </control> + </controls> +</window> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2008-12-22 15:44:22
|
Revision: 2456 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2456&view=rev Author: saamand Date: 2008-12-22 15:44:17 +0000 (Mon, 22 Dec 2008) Log Message: ----------- MyLyrics version 1.10 final Modified Paths: -------------- trunk/plugins/MyLyrics/LyricsEngine/LRC/SimpleLRCTimeAndLineCollection.cs trunk/plugins/MyLyrics/LyricsEngine/LyricSearch.cs trunk/plugins/MyLyrics/LyricsEngine/LyricsController.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/About.Designer.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/AddNewSong.Designer.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/ExportTags.Designer.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/ExportTags.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/ImportTags.Designer.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/ImportTags.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 Configuration/MyLyricsSetup.resx trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj trunk/plugins/MyLyrics/My Lyrics/MyLyricsSettings.cs Added Paths: ----------- trunk/plugins/MyLyrics/change log.txt Modified: trunk/plugins/MyLyrics/LyricsEngine/LRC/SimpleLRCTimeAndLineCollection.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LRC/SimpleLRCTimeAndLineCollection.cs 2008-12-22 10:36:47 UTC (rev 2455) +++ trunk/plugins/MyLyrics/LyricsEngine/LRC/SimpleLRCTimeAndLineCollection.cs 2008-12-22 15:44:17 UTC (rev 2456) @@ -19,7 +19,7 @@ public int GetSimpleLRCTimeAndLineIndex(long time) { - if (time < ((SimpleLRCTimeAndLine)items[0]).Time) + if (time <= ((SimpleLRCTimeAndLine)items[0]).Time) { return 0; } Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricSearch.cs =================================================================== (Binary files differ) Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsController.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsController.cs 2008-12-22 10:36:47 UTC (rev 2455) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsController.cs 2008-12-22 15:44:17 UTC (rev 2456) @@ -58,17 +58,17 @@ m_noOfLyricsNotFound = 0; m_noOfCurrentSearches = 0; - ArrayList easySitesArrayList = new ArrayList(); + ArrayList sitesArrayList = new ArrayList(); // If search all, then include all foreach (string site in lyricSites) { if (Setup.IsMember(site)) { - easySitesArrayList.Add(site); + sitesArrayList.Add(site); } } - this.lyricsSites = (string[])easySitesArrayList.ToArray(typeof(string)); + this.lyricsSites = (string[])sitesArrayList.ToArray(typeof(string)); LyricSearch.LyricsSites = lyricsSites; Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/HotLyrics.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/HotLyrics.cs 2008-12-22 10:36:47 UTC (rev 2455) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/HotLyrics.cs 2008-12-22 15:44:17 UTC (rev 2456) @@ -23,7 +23,7 @@ public HotLyrics(string artist, string title, ManualResetEvent m_EventStop_SiteSearches, int timeLimit) { - this.timeLimit = timeLimit; + this.timeLimit = timeLimit / 2; timer = new System.Timers.Timer(); if (LyricDiagnostics.TraceSource != null) LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Information, 0, LyricDiagnostics.ElapsedTimeString() + "SeekLyrics(" + artist + ", " + title + ")"); @@ -119,7 +119,7 @@ } else { - System.Threading.Thread.Sleep(100); + System.Threading.Thread.Sleep(300); } } } @@ -192,7 +192,7 @@ } } } - catch (System.Reflection.TargetInvocationException) + catch { lyric = "Not found"; } Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Lyrics007.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Lyrics007.cs 2008-12-22 10:36:47 UTC (rev 2455) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Lyrics007.cs 2008-12-22 15:44:17 UTC (rev 2456) @@ -24,7 +24,7 @@ public Lyrics007(string artist, string title, ManualResetEvent m_EventStop_SiteSearches, int timeLimit) { - this.timeLimit = timeLimit; + this.timeLimit = timeLimit / 2; timer = new System.Timers.Timer(); if (LyricDiagnostics.TraceSource != null) LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Information, 0, LyricDiagnostics.ElapsedTimeString() + "Lyrics007(" + artist + ", " + title + ")"); @@ -52,14 +52,10 @@ while (complete == false) { - if (m_EventStop_SiteSearches.WaitOne(1, true)) + if (m_EventStop_SiteSearches.WaitOne(500, true)) { complete = true; } - else - { - System.Threading.Thread.Sleep(100); - } } } @@ -119,7 +115,7 @@ else lyric = "Not found"; } - catch (Exception) + catch { lyric = "Not found"; } Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyricsOnDemand.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyricsOnDemand.cs 2008-12-22 10:36:47 UTC (rev 2455) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyricsOnDemand.cs 2008-12-22 15:44:17 UTC (rev 2456) @@ -165,7 +165,7 @@ } } } - catch (System.Reflection.TargetInvocationException) + catch { lyric = "Not found"; } Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/SeekLyrics.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/SeekLyrics.cs 2008-12-22 10:36:47 UTC (rev 2455) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/SeekLyrics.cs 2008-12-22 15:44:17 UTC (rev 2456) @@ -149,7 +149,7 @@ else lyric = "Not found"; } - catch (System.Reflection.TargetInvocationException) + catch { lyric = "Not found"; } Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs 2008-12-22 10:36:47 UTC (rev 2455) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs 2008-12-22 15:44:17 UTC (rev 2456) @@ -80,7 +80,7 @@ this.lbInfo1.Name = "lbInfo1"; this.lbInfo1.Size = new System.Drawing.Size(223, 18); this.lbInfo1.TabIndex = 3; - this.lbInfo1.Text = "MyLyrics plugin, version 1.1 RC1"; + this.lbInfo1.Text = "MyLyrics plugin, version 1.10"; // // label2 // Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/AddNewSong.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/AddNewSong.Designer.cs 2008-12-22 10:36:47 UTC (rev 2455) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/AddNewSong.Designer.cs 2008-12-22 15:44:17 UTC (rev 2456) @@ -51,7 +51,7 @@ this.gbAddNew.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.gbAddNew.Location = new System.Drawing.Point(9, 12); this.gbAddNew.Name = "gbAddNew"; - this.gbAddNew.Size = new System.Drawing.Size(508, 294); + this.gbAddNew.Size = new System.Drawing.Size(508, 283); this.gbAddNew.TabIndex = 3; this.gbAddNew.TabStop = false; this.gbAddNew.Text = "Song Info"; @@ -62,7 +62,7 @@ this.tbLyric.Multiline = true; this.tbLyric.Name = "tbLyric"; this.tbLyric.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; - this.tbLyric.Size = new System.Drawing.Size(428, 204); + this.tbLyric.Size = new System.Drawing.Size(428, 196); this.tbLyric.TabIndex = 5; this.tbLyric.KeyUp += new System.Windows.Forms.KeyEventHandler(this.tbLyric_KeyUp); // @@ -114,7 +114,7 @@ // btOK // this.btOK.Enabled = false; - this.btOK.Location = new System.Drawing.Point(377, 312); + this.btOK.Location = new System.Drawing.Point(377, 301); this.btOK.Name = "btOK"; this.btOK.Size = new System.Drawing.Size(59, 23); this.btOK.TabIndex = 3; @@ -124,7 +124,7 @@ // // btClose // - this.btClose.Location = new System.Drawing.Point(442, 312); + this.btClose.Location = new System.Drawing.Point(442, 301); this.btClose.Name = "btClose"; this.btClose.Size = new System.Drawing.Size(59, 23); this.btClose.TabIndex = 4; @@ -132,12 +132,12 @@ this.btClose.UseVisualStyleBackColor = true; this.btClose.Click += new System.EventHandler(this.btClose_Click); // - // MyLyricsSetup_AddNewSong + // AddNewSong // this.AcceptButton = this.btOK; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(525, 340); + this.ClientSize = new System.Drawing.Size(517, 331); this.ControlBox = false; this.Controls.Add(this.btClose); this.Controls.Add(this.btOK); @@ -146,7 +146,7 @@ this.MaximumSize = new System.Drawing.Size(533, 367); this.MinimizeBox = false; this.MinimumSize = new System.Drawing.Size(533, 367); - this.Name = "MyLyricsSetup_AddNewSong"; + this.Name = "AddNewSong"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Add new lyric"; this.gbAddNew.ResumeLayout(false); Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/ExportTags.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/ExportTags.Designer.cs 2008-12-22 10:36:47 UTC (rev 2455) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/ExportTags.Designer.cs 2008-12-22 15:44:17 UTC (rev 2456) @@ -74,7 +74,7 @@ // // btStart // - this.btStart.Location = new System.Drawing.Point(13, 166); + this.btStart.Location = new System.Drawing.Point(12, 163); this.btStart.Name = "btStart"; this.btStart.Size = new System.Drawing.Size(66, 23); this.btStart.TabIndex = 2; @@ -148,7 +148,7 @@ // // btCancel // - this.btCancel.Location = new System.Drawing.Point(85, 166); + this.btCancel.Location = new System.Drawing.Point(84, 163); this.btCancel.Name = "btCancel"; this.btCancel.Size = new System.Drawing.Size(66, 23); this.btCancel.TabIndex = 14; @@ -158,7 +158,7 @@ // // btClose // - this.btClose.Location = new System.Drawing.Point(196, 166); + this.btClose.Location = new System.Drawing.Point(196, 163); this.btClose.Name = "btClose"; this.btClose.Size = new System.Drawing.Size(66, 23); this.btClose.TabIndex = 15; @@ -179,7 +179,7 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(264, 191); + this.ClientSize = new System.Drawing.Size(270, 189); this.ControlBox = false; this.Controls.Add(this.lbCurrentArtist); this.Controls.Add(this.btClose); Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/ExportTags.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/ExportTags.cs 2008-12-22 10:36:47 UTC (rev 2455) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/ExportTags.cs 2008-12-22 15:44:17 UTC (rev 2456) @@ -10,6 +10,7 @@ using System.Collections; using System.Threading; using System.IO; +using LyricsEngine.LRC; namespace MyLyrics { @@ -23,13 +24,13 @@ public ExportTags() { InitializeComponent(); - this.lbInfo.Text = "Press the 'Start'-button to begin the export"; - this.lbCurrentArtist.Text = "Note that the export cannot be undone"; + this.lbInfo.Text = "Press the 'Start'-button to begin the export."; + this.lbCurrentArtist.Text = "Note that the export cannot be undone."; } private void btStart_Click(object sender, EventArgs e) { - lbInfo.Text = string.Format("Currently exporting tags to the tracks of:"); + lbInfo.Text = string.Format("Currently exporting lyrics to musictags with:"); btStart.Enabled = false; btCancel.Enabled = true; @@ -80,11 +81,45 @@ if (DatabaseUtil.IsTrackInLyricsDatabase(MyLyricsSettings.LyricsDB, capArtist, capTitle).Equals(DatabaseUtil.LYRIC_FOUND)) { + string lyric = MyLyricsSettings.LyricsDB[DatabaseUtil.CorrectKeyFormat(capArtist, capTitle)].Lyrics; - if (TagReaderUtil.WriteLyrics(song.FileName, lyric)) + SimpleLRC lrcInLyricsDb = new SimpleLRC(capArtist, capTitle, lyric); + + // If the lyricsDB lyric is LRC always export + if (lrcInLyricsDb.IsValid) { - ++counter; + if (TagReaderUtil.WriteLyrics(song.FileName, lyric)) + { + ++counter; + } + continue; } + + MusicTag tag = MediaPortal.TagReader.TagReader.ReadTag(song.FileName); + + // If there is a musictag lyric + if (tag != null && !tag.Lyrics.Equals(string.Empty)) + { + // if there is no LRC lyric in the tag, then simple export + SimpleLRC lrcInTag = new SimpleLRC(capArtist, capTitle, tag.Lyrics); + if (!lrcInTag.IsValid) + { + if (TagReaderUtil.WriteLyrics(song.FileName, lyric)) + { + ++counter; + } + } + + continue; + } + // Al if no lyric in musictag simple export + else + { + if (TagReaderUtil.WriteLyrics(song.FileName, lyric)) + { + ++counter; + } + } } } } @@ -116,6 +151,8 @@ lbInfo.Text = "The export has ended."; lbCurrentArtist.Text = string.Empty; + progressBar.PerformStep(); + btStart.Enabled = true; btCancel.Enabled = false; btClose.Enabled = true; Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/ImportTags.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/ImportTags.Designer.cs 2008-12-22 10:36:47 UTC (rev 2455) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/ImportTags.Designer.cs 2008-12-22 15:44:17 UTC (rev 2456) @@ -49,8 +49,9 @@ // this.lbInfo.AutoSize = true; this.lbInfo.Location = new System.Drawing.Point(10, 12); + this.lbInfo.MinimumSize = new System.Drawing.Size(150, 13); this.lbInfo.Name = "lbInfo"; - this.lbInfo.Size = new System.Drawing.Size(30, 13); + this.lbInfo.Size = new System.Drawing.Size(150, 13); this.lbInfo.TabIndex = 0; this.lbInfo.Text = "[text]"; // @@ -144,7 +145,7 @@ this.lbLyricsFound.Name = "lbLyricsFound"; this.lbLyricsFound.Size = new System.Drawing.Size(162, 15); this.lbLyricsFound.TabIndex = 14; - this.lbLyricsFound.Text = "Lyrics found in tags:"; + this.lbLyricsFound.Text = "Lyrics to be imported:"; // // btCancel // @@ -169,9 +170,10 @@ // lbCurrentArtist // this.lbCurrentArtist.AutoSize = true; - this.lbCurrentArtist.Location = new System.Drawing.Point(10, 25); + this.lbCurrentArtist.Location = new System.Drawing.Point(10, 29); + this.lbCurrentArtist.MinimumSize = new System.Drawing.Size(150, 13); this.lbCurrentArtist.Name = "lbCurrentArtist"; - this.lbCurrentArtist.Size = new System.Drawing.Size(71, 13); + this.lbCurrentArtist.Size = new System.Drawing.Size(150, 13); this.lbCurrentArtist.TabIndex = 16; this.lbCurrentArtist.Text = "[current artist]"; // @@ -179,7 +181,7 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(264, 192); + this.ClientSize = new System.Drawing.Size(266, 193); this.ControlBox = false; this.Controls.Add(this.lbCurrentArtist); this.Controls.Add(this.btClose); Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/ImportTags.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/ImportTags.cs 2008-12-22 10:36:47 UTC (rev 2455) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/ImportTags.cs 2008-12-22 15:44:17 UTC (rev 2456) @@ -8,6 +8,7 @@ using MediaPortal.Music.Database; using MediaPortal.TagReader; using System.Collections; +using LyricsEngine.LRC; namespace MyLyrics { @@ -66,24 +67,35 @@ string artist = (string)artists[i]; bw.ReportProgress(counter, artist); - try + + mDB.GetSongsByArtist(artist, ref songs); + + foreach (Song song in songs) { - mDB.GetSongsByArtist(artist, ref songs); + MusicTag tag = TagReader.ReadTag(song.FileName); + if (tag != null && tag.Lyrics != string.Empty) + { + string capArtist = LyricsEngine.LyricUtil.CapatalizeString(tag.Artist); + string capTitle = LyricsEngine.LyricUtil.CapatalizeString(tag.Title); - foreach (Song song in songs) - { - MusicTag tag = TagReader.ReadTag(song.FileName); - if (tag != null && tag.Lyrics != string.Empty) + if (DatabaseUtil.IsTrackInLyricsDatabase(MyLyricsSettings.LyricsDB, capArtist, capTitle).Equals(DatabaseUtil.LYRIC_FOUND)) { + // If lyric exists in LyricsDb then only import (and overwrite) if it isn't an LRC-file + string lyricsText = (string)MyLyricsSettings.LyricsDB[DatabaseUtil.CorrectKeyFormat(capArtist, capTitle)].Lyrics; + SimpleLRC lrc = new SimpleLRC(capArtist, capTitle, lyricsText); + if (!lrc.IsValid) + { + tags.Add(tag); + ++counter; + } + } + else + { tags.Add(tag); ++counter; } } } - catch (Exception e2) - { - string s = e2.Message; - } } } Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.Designer.cs 2008-12-22 10:36:47 UTC (rev 2455) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.Designer.cs 2008-12-22 15:44:17 UTC (rev 2456) @@ -39,7 +39,8 @@ 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.bwOnlineSearch = new System.ComponentModel.BackgroundWorker(); + this.bwMusicTagSearch = new System.ComponentModel.BackgroundWorker(); this.gbMusicDatabase.SuspendLayout(); this.gbSelected.SuspendLayout(); this.SuspendLayout(); @@ -84,7 +85,7 @@ // columnHeaderSong // this.columnHeaderSong.Text = "Song"; - this.columnHeaderSong.Width = 205; + this.columnHeaderSong.Width = 204; // // columnHeaderDB // @@ -122,7 +123,7 @@ 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, 162); + 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; @@ -132,7 +133,7 @@ // columnHeaderArtist2 // this.columnHeaderArtist2.Text = "Artist"; - this.columnHeaderArtist2.Width = 178; + this.columnHeaderArtist2.Width = 177; // // columnHeaderSong2 // @@ -304,14 +305,22 @@ this.btSearch.UseVisualStyleBackColor = true; this.btSearch.Click += new System.EventHandler(this.btSearch_Click); // - // bw + // bwOnlineSearch // - 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); + this.bwOnlineSearch.WorkerReportsProgress = true; + this.bwOnlineSearch.WorkerSupportsCancellation = true; + this.bwOnlineSearch.DoWork += new System.ComponentModel.DoWorkEventHandler(this.bw_DoWork); + this.bwOnlineSearch.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.bw_RunWorkerCompleted); + this.bwOnlineSearch.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.bw_ProgressChanged); // + // bwMusicTagSearch + // + this.bwMusicTagSearch.WorkerReportsProgress = true; + this.bwMusicTagSearch.WorkerSupportsCancellation = true; + this.bwMusicTagSearch.DoWork += new System.ComponentModel.DoWorkEventHandler(this.bwMusicTagSearch_DoWork); + this.bwMusicTagSearch.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.bwMusicTagSearch_RunWorkerCompleted); + this.bwMusicTagSearch.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.bwMusicTagSearch_ProgressChanged); + // // MusicDatabaseBrowse // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -337,7 +346,6 @@ private System.Windows.Forms.ColumnHeader columnHeaderDB; private System.Windows.Forms.ColumnHeader columnHeaderStatus; private System.Windows.Forms.Label lbArtistNumber; - private System.Windows.Forms.ListView lvSelectedSongs; private System.Windows.Forms.ColumnHeader columnHeaderSong2; private System.Windows.Forms.ColumnHeader columnHeaderDatabase2; private System.Windows.Forms.ColumnHeader columnHeaderStatus2; @@ -352,12 +360,14 @@ private System.Windows.Forms.Button btRemove; private System.Windows.Forms.Button btDeselectAll2; private System.Windows.Forms.Button btSelectAll2; - private System.ComponentModel.BackgroundWorker bw; + private System.ComponentModel.BackgroundWorker bwOnlineSearch; private System.Windows.Forms.ImageList imageList; 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; + public System.Windows.Forms.ListView lvSelectedSongs; + private System.ComponentModel.BackgroundWorker bwMusicTagSearch; } } \ 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 2008-12-22 10:36:47 UTC (rev 2455) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.cs 2008-12-22 15:44:17 UTC (rev 2456) @@ -5,17 +5,18 @@ using System.Drawing; using System.Text; using System.Windows.Forms; -using MediaPortal.Music.Database; using System.Collections; using LyricsEngine; using System.Threading; +using MediaPortal.Music.Database; +using MediaPortal.TagReader; namespace MyLyrics { public partial class MusicDatabaseBrowse : UserControl, ILyricForm { - MyLyricsSetup parent; - string selectedArtist = String.Empty; + MyLyricsSetup m_Parent; + string m_SelectedArtist = String.Empty; public delegate void DelegateStringUpdate(String message, String site); public DelegateStringUpdate m_DelegateStringUpdate; @@ -31,8 +32,7 @@ public DelegateThreadException m_DelegateThreadException; int m_noOfCurrentlySearches = 0; - int NO_OF_SEARCHES_ALLOWED = 5; - int counter = 0; + int m_NO_OF_SEARCHES_ALLOWED = 5; int m_noOfSearchesToComplete = 0; int m_noOfSearchesCompleted = 0; @@ -43,24 +43,26 @@ Thread m_LyricControllerThread; ManualResetEvent m_EventStopThread; - Queue<string[]> songs; - LyricsController lc; + Queue<string[]> m_Songs = null; + LyricsController m_lc; string m_find = string.Empty; string m_replace = string.Empty; + MusicDatabase m_mDB = null; + public MusicDatabaseBrowse(MyLyricsSetup parent) { - this.parent = parent; + this.m_Parent = parent; InitializeComponent(); } private void ListboxArtistsUpdate(object sender, EventArgs e) { - MusicDatabase mDB = MusicDatabase.Instance; + m_mDB = MusicDatabase.Instance; ArrayList artists = new ArrayList(); //mdb.GetArtists(0, String.Empty, ref artists); - mDB.GetAllArtists(ref artists); + m_mDB.GetAllArtists(ref artists); lvArtists.Items.Clear(); lbSelectedArtist.Text = String.Empty; @@ -105,38 +107,73 @@ { foreach (ListViewItem lvi in lvSongs.SelectedItems) { - if (lvi.ImageIndex == -1) + AddToSelected(lvi); + } + + if (lvSelectedSongs.Items.Count > 0) + { + btSearch.Enabled = true; + btRemove.Enabled = true; + lvSelectedSongs.Sort(); + + } + } + + private void AddToSelected(ListViewItem lvi) + { + if (lvi.ImageIndex == -1) + { + ListViewItem newLvi = new ListViewItem(m_SelectedArtist); + + foreach (ListViewItem.ListViewSubItem lvsi in lvi.SubItems) { - ListViewItem newLvi = new ListViewItem(selectedArtist); + newLvi.SubItems.Add(lvsi); + } - foreach (ListViewItem.ListViewSubItem lvsi in lvi.SubItems) + newLvi.ImageIndex = lvi.ImageIndex; + + bool alreadySelected = false; + + foreach (ListViewItem item in lvSelectedSongs.Items) + { + if (item.SubItems[0].Text.Equals(m_SelectedArtist) && item.SubItems[1].Text.Equals(newLvi.SubItems[1].Text)) { - newLvi.SubItems.Add(lvsi); + alreadySelected = true; + continue; } + } - newLvi.ImageIndex = lvi.ImageIndex; - + if (!alreadySelected && !lvSelectedSongs.Items.ContainsKey(m_SelectedArtist + "-" + lvi.SubItems[0].Text)) + { lvSelectedSongs.Items.Add(newLvi); } } + } + private void btAddAll_Click(object sender, EventArgs e) + { + foreach (ListViewItem lvi in lvSongs.Items) + { + AddToSelected(lvi); + } + if (lvSelectedSongs.Items.Count > 0) { btSearch.Enabled = true; btRemove.Enabled = true; lvSelectedSongs.Sort(); - } } + private void listViewArtists_SelectedIndexChanged(object sender, EventArgs e) { MusicDatabase mdb = MusicDatabase.Instance; List<Song> songs = new List<Song>(); - selectedArtist = ((System.Windows.Forms.ListView)(sender)).SelectedItems.Count > 0 ? ((System.Windows.Forms.ListView)(sender)).SelectedItems[0].Text : ""; - mdb.GetSongsByArtist(selectedArtist, ref songs); + m_SelectedArtist = ((System.Windows.Forms.ListView)(sender)).SelectedItems.Count > 0 ? ((System.Windows.Forms.ListView)(sender)).SelectedItems[0].Text : ""; + mdb.GetSongsByArtist(m_SelectedArtist, ref songs); - lbSelectedArtist.Text = String.Format("Artist: {0}", selectedArtist); + lbSelectedArtist.Text = String.Format("Artist: {0}", m_SelectedArtist); lvSongs.Items.Clear(); foreach (Song song in songs) @@ -210,35 +247,61 @@ } } - private void btSearch_Click(object sender, EventArgs e) + private void SearchMusicTags() { - m_lockButtons = false; - - if (bw.IsBusy) + if (bwMusicTagSearch.IsBusy) { Thread.Sleep(2000); } + bwMusicTagSearch.RunWorkerAsync(); + } + + private void Search_Init() + { + m_lockButtons = false; + MyLyricsSetup.UpdateLibraryUI = true; ChangeButtonsEnableState(); - songs = new Queue<string[]>(); + m_Songs = new Queue<string[]>(); List<ListViewItem> items = new List<ListViewItem>(); + int count = 0; + foreach (ListViewItem lvi in lvSelectedSongs.Items) { ListViewItem lviClone = (ListViewItem)lvi.Clone(); if (lvi.ImageIndex == -1) { - songs.Enqueue(new string[2] { lviClone.SubItems[0].Text, lviClone.SubItems[1].Text }); + m_Songs.Enqueue(new string[3] { lviClone.SubItems[0].Text, lviClone.SubItems[1].Text, count.ToString() }); lviClone.SubItems[3].Text = ""; items.Add(lviClone); + ++count; } } + lvSelectedSongs.Items.Clear(); lvSelectedSongs.Items.AddRange(items.ToArray()); + m_noOfSearchesToComplete = m_Songs.Count; + m_noOfCurrentlySearches = 0; + m_noOfSearchesCompleted = 0; + } + + private void SearchOnline() + { + // After the tag search is completed, we now recalculate the number of lyrics to search for during online search + m_noOfSearchesToComplete -= m_noOfSearchesCompleted; + m_noOfSearchesCompleted = 0; + m_noOfCurrentlySearches = 0; + + if (bwOnlineSearch.IsBusy) + { + Thread.Sleep(2000); + } + List<string> sitesToSearch = new List<string>(); using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MediaPortal.xml")) @@ -265,26 +328,21 @@ 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, m_find, m_replace); - m_noOfSearchesToComplete = songs.Count; + m_lc = new LyricsController(this, m_EventStopThread, (string[])sitesToSearch.ToArray(), false, false, m_find, m_replace); - lc.NoOfLyricsToSearch = m_noOfSearchesToComplete; + m_lc.NoOfLyricsToSearch = m_noOfSearchesToComplete; ThreadStart job = delegate { - lc.Run(); + m_lc.Run(); }; m_LyricControllerThread = new Thread(job); m_LyricControllerThread.Start(); - lc.StopSearches = false; + m_lc.StopSearches = false; - m_noOfCurrentlySearches = 0; - m_noOfSearchesCompleted = 0; - counter = 0; - - bw.RunWorkerAsync(); + bwOnlineSearch.RunWorkerAsync(); } private void btSelectAll2_Click(object sender, EventArgs e) @@ -322,7 +380,7 @@ foreach (ListViewItem lvi in lvSongs.Items) { - if (lvi.SubItems[1].Text.Equals("LyricsDB")) + if (lvi.SubItems[1].Text.Equals("LyricsDB")) { ++lyricsInLyricDB; } @@ -469,11 +527,14 @@ DatabaseUtil.WriteToLyricsDatabase(MyLyricsSettings.LyricsDB, MyLyricsSettings.LyricsMarkedDB, capArtist, capTitle, lyricStrings, site); DatabaseUtil.SerializeLyricDB(); - using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MediaPortal.xml")) + if (!site.Equals("music tag")) { - if (xmlreader.GetValueAsBool("myLyrics", "automaticWriteToMusicTag", true)) + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MediaPortal.xml")) { - TagReaderUtil.WriteLyrics(capArtist, capTitle, lyricStrings); + if (xmlreader.GetValueAsBool("myLyrics", "automaticWriteToMusicTag", true)) + { + TagReaderUtil.WriteLyrics(capArtist, capTitle, lyricStrings); + } } } @@ -540,7 +601,7 @@ { if (m_lockButtons == false) { - ((MyLyricsSetup)parent).btClose.Enabled = !((MyLyricsSetup)parent).btClose.Enabled; + ((MyLyricsSetup)m_Parent).btClose.Enabled = !((MyLyricsSetup)m_Parent).btClose.Enabled; btSearch.Enabled = !btSearch.Enabled; btCancel.Enabled = !btCancel.Enabled; btAdd.Enabled = !btAdd.Enabled; @@ -556,22 +617,27 @@ private void bw_DoWork(object sender, DoWorkEventArgs e) { - while (songs.Count != 0) + while (m_Songs.Count != 0) { - if (lc == null) + if (m_lc == null) return; - if (bw.CancellationPending) + if (bwOnlineSearch.CancellationPending) { return; } - if (m_noOfCurrentlySearches < NO_OF_SEARCHES_ALLOWED && lc.StopSearches == false) + if (m_noOfCurrentlySearches < m_NO_OF_SEARCHES_ALLOWED && m_lc.StopSearches == false) { m_noOfCurrentlySearches += 1; - string[] lyricID = (string[])songs.Dequeue(); - bw.ReportProgress(counter++); - lc.AddNewLyricSearch(lyricID[0], lyricID[1], MediaPortalUtil.GetStrippedPrefixArtist(lyricID[0], m_strippedPrefixStrings)); + string[] lyricID = (string[])m_Songs.Dequeue(); + string artist = lyricID[0]; + string title = lyricID[1]; + int rowNumberInListView = int.Parse(lyricID[2]); + + bwOnlineSearch.ReportProgress(rowNumberInListView); + + m_lc.AddNewLyricSearch(artist, title, MediaPortalUtil.GetStrippedPrefixArtist(artist, m_strippedPrefixStrings)); } Thread.Sleep(200); @@ -579,6 +645,24 @@ } + private bool LyricFoundInMusicTag(string artist, string title) + { + Song song = new Song(); + + m_mDB.GetSongByMusicTagInfo(artist, string.Empty, title, true, ref song); + + MusicTag tag = TagReader.ReadTag(song.FileName); + if (tag != null && tag.Lyrics != string.Empty) + { + LyricFound = new Object[] { tag.Lyrics, artist, title, "music tag" }; + return true; + } + else + { + return false; + } + } + private void bw_ProgressChanged(object sender, ProgressChangedEventArgs e) { lvSelectedSongs.Items[e.ProgressPercentage].SubItems[2].Text = "-"; @@ -591,40 +675,15 @@ } - private void btAddAll_Click(object sender, EventArgs e) + + private void btRemoveAll_Click(object sender, EventArgs e) { - foreach (ListViewItem lvi in lvSongs.Items) - { - if (lvi.ImageIndex == -1) - { - ListViewItem newLvi = new ListViewItem(selectedArtist); - - foreach (ListViewItem.ListViewSubItem lvsi in lvi.SubItems) - { - newLvi.SubItems.Add(lvsi); - } - - newLvi.ImageIndex = lvi.ImageIndex; - - lvSelectedSongs.Items.Add(newLvi); - } - } - - if (lvSelectedSongs.Items.Count > 0) - { - btSearch.Enabled = true; - btRemove.Enabled = true; - lvSelectedSongs.Sort(); - - } + ClearSelectedSongs(); } - private void btRemoveAll_Click(object sender, EventArgs e) + public void ClearSelectedSongs() { - foreach (ListViewItem lvi in lvSelectedSongs.Items) - { - lvSelectedSongs.Items.Remove(lvi); - } + lvSelectedSongs.Items.Clear(); if (lvSelectedSongs.Items.Count == 0) { @@ -635,19 +694,20 @@ private void btCancel_Click(object sender, EventArgs e) { - if (lc != null) + if (m_lc != null) { - lc.FinishThread(selectedArtist, string.Empty, "The search has been cancelled by the user.", "none"); - lc.Dispose(); - lc = null; + m_lc.FinishThread(m_SelectedArtist, string.Empty, "The search has been cancelled by the user.", "none"); + m_lc.Dispose(); + m_lc = null; } - else + else if (m_EventStopThread != null) { m_EventStopThread.Set(); - ThreadFinishedMethod(selectedArtist, string.Empty, "The search has been cancelled by the user.", "none"); + ThreadFinishedMethod(m_SelectedArtist, string.Empty, "The search has been cancelled by the user.", "none"); } - bw.CancelAsync(); + bwMusicTagSearch.CancelAsync(); + bwOnlineSearch.CancelAsync(); ChangeButtonsEnableState(); m_lockButtons = true; Thread.Sleep(500); @@ -655,5 +715,68 @@ RefreshArtistStats(); ChangeSearchingSubItemsToCancelled(); } + + + private void bwMusicTagSearch_DoWork(object sender, DoWorkEventArgs e) + { + Queue<string[]> m_SongsToSearchOnline = new Queue<string[]>(); + int rowNumberInListView = 0; + + foreach (string[] song in m_Songs) + { + if (bwMusicTagSearch.CancellationPending) + { + return; + } + + if (!LyricFoundInMusicTag(song[0], song[1])) + { + m_SongsToSearchOnline.Enqueue(new string[3] { song[0], song[1], rowNumberInListView.ToString() }); + } + else + { + bwMusicTagSearch.ReportProgress(rowNumberInListView); + } + + ++rowNumberInListView; + } + + m_Songs = m_SongsToSearchOnline; + } + + private void bwMusicTagSearch_ProgressChanged(object sender, ProgressChangedEventArgs e) + { + lvSelectedSongs.Items[e.ProgressPercentage].SubItems[2].Text = "LyricsDB"; + lvSelectedSongs.Items[e.ProgressPercentage].SubItems[3].Text = "OK"; + lvSelectedSongs.Items[e.ProgressPercentage].EnsureVisible(); + } + + private void bwMusicTagSearch_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) + { + // If all found in music tags, then no need for online search + if (m_noOfSearchesCompleted == m_noOfSearchesToComplete) + { + return; + } + + SearchOnline(); + } + + private void btSearch_Click(object sender, EventArgs e) + { + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MediaPortal.xml")) + { + if (xmlreader.GetValueAsBool("myLyrics", "automaticReadFromToMusicTag", true)) + { + Search_Init(); + SearchMusicTags(); + } + else + { + Search_Init(); + SearchOnline(); + } + } + } } } \ No newline at end of file Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.resx =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.resx 2008-12-22 10:36:47 UTC (rev 2455) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.resx 2008-12-22 15:44:17 UTC (rev 2456) @@ -118,7 +118,7 @@ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <metadata name="imageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> - <value>83, 17</value> + <value>291, 17</value> </metadata> <data name="imageList.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64"> <value> @@ -160,7 +160,10 @@ BwABfwcAAX8GAAEYAX8GAAE4AT8GAAH8AT8GAAH8AR8GAAH+AR8GAAH+AT8GAAH/AX8GAAs= </value> </data> - <metadata name="bw.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> - <value>17, 17</value> + <metadata name="bwOnlineSearch.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>164, 17</value> </metadata> + <metadata name="bwMusicTagSearch.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>15, 16</value> + </metadata> </root> \ No newline at end of file Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs 2008-12-22 10:36:47 UTC (rev 2455) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs 2008-12-22 15:44:17 UTC (rev 2456) @@ -75,7 +75,8 @@ this.lbLyricsFound = new MediaPortal.UserInterface.Controls.MPLabel(); this.tabPageSetup = new MediaPortal.UserInterface.Controls.MPTabPage(); this.gbTag = new MediaPortal.UserInterface.Controls.MPGroupBox(); - this.cbMusicTag = new MediaPortal.UserInterface.Controls.MPCheckBox(); + this.cbMusicTagAlwaysCheck = new MediaPortal.UserInterface.Controls.MPCheckBox(); + this.cbMusicTagWrite = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.mpGroupBox3 = new MediaPortal.UserInterface.Controls.MPGroupBox(); this.cbAutomaticUpdate = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.cbMoveSongFrom = new MediaPortal.UserInterface.Controls.MPCheckBox(); @@ -609,36 +610,51 @@ // // gbTag // - this.gbTag.Controls.Add(this.cbMusicTag); + this.gbTag.Controls.Add(this.cbMusicTagAlwaysCheck); + this.gbTag.Controls.Add(this.cbMusicTagWrite); this.gbTag.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.gbTag.Location = new System.Drawing.Point(4, 265); this.gbTag.Name = "gbTag"; - this.gbTag.Size = new System.Drawing.Size(538, 49); + this.gbTag.Size = new System.Drawing.Size(538, 66); this.gbTag.TabIndex = 31; this.gbTag.TabStop = false; this.gbTag.Text = "Music tags"; // - // cbMusicTag + // cbMusicTagAlwaysCheck // - this.cbMusicTag.AutoSize = true; - this.cbMusicTag.Checked = true; - this.cbMusicTag.CheckState = System.Windows.Forms.CheckState.Checked; - this.cbMusicTag.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.cbMusicTag.Location = new System.Drawing.Point(16, 23); - this.cbMusicTag.Name = "cbMusicTag"; - this.cbMusicTag.Size = new System.Drawing.Size(203, 17); - this.cbMusicTag.TabIndex = 6; - this.cbMusicTag.Text = "Write newly found lyrics into music tag"; - this.cbMusicTag.UseVisualStyleBackColor = true; - this.cbMusicTag.Leave += new System.EventHandler(this.WriteMediaPortalXML); + 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"; + this.cbMusicTagAlwaysCheck.Size = new System.Drawing.Size(278, 17); + this.cbMusicTagAlwaysCheck.TabIndex = 7; + this.cbMusicTagAlwaysCheck.Text = "Always check music tag for lyrics before online search"; + this.cbMusicTagAlwaysCheck.UseVisualStyleBackColor = true; + this.cbMusicTagAlwaysCheck.Leave += new System.EventHandler(this.WriteMediaPortalXML); // + // 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"; + this.cbMusicTagWrite.Size = new System.Drawing.Size(203, 17); + this.cbMusicTagWrite.TabIndex = 6; + this.cbMusicTagWrite.Text = "Write newly found lyrics into music tag"; + this.cbMusicTagWrite.UseVisualStyleBackColor = true; + this.cbMusicTagWrite.Leave += new System.EventHandler(this.WriteMediaPortalXML); + // // mpGroupBox3 // this.mpGroupBox3.Controls.Add(this.cbAutomaticUpdate); this.mpGroupBox3.Controls.Add(this.cbMoveSongFrom); this.mpGroupBox3.Controls.Add(this.cbAutoFetch); this.mpGroupBox3.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.mpGroupBox3.Location = new System.Drawing.Point(5, 320); + this.mpGroupBox3.Location = new System.Drawing.Point(5, 337); this.mpGroupBox3.Name = "mpGroupBox3"; this.mpGroupBox3.Size = new System.Drawing.Size(538, 92); this.mpGroupBox3.TabIndex = 30; @@ -1088,7 +1104,6 @@ private MediaPortal.UserInterface.Controls.MPLabel lbSongsLimit; private MediaPortal.UserInterface.Controls.MPLabel lbSongsLimitNote; private MediaPortal.UserInterface.Controls.MPCheckBox cbSearchOnlyForMarkedSongs; - private MediaPortal.UserInterface.Controls.MPCheckBox cbDisregardSongWithLyricInTag; private MediaPortal.UserInterface.Controls.MPCheckBox cbDisregardVariousArtist; private MediaPortal.UserInterface.Controls.MPCheckBox cbDisregardSongsWithNoLyric; private MediaPortal.UserInterface.Controls.MPCheckBox cbMarkSongsWithNoLyrics; @@ -1101,7 +1116,7 @@ public MediaPortal.UserInterface.Controls.MPButton btClose; private System.Windows.Forms.TabPage tabPageAbout; private MediaPortal.UserInterface.Controls.MPGroupBox gbTag; - internal MediaPortal.UserInterface.Controls.MPCheckBox cbMusicTag; + internal MediaPortal.UserInterface.Controls.MPCheckBox cbMusicTagWrite; internal MediaPortal.UserInterface.Controls.MPCheckBox cbActionext; private System.Windows.Forms.TabPage tabPageReplace; private System.Windows.Forms.DataGridView dbGridView; @@ -1109,5 +1124,7 @@ private System.Windows.Forms.DataGridViewTextBoxColumn Replace; private MediaPortal.UserInterface.Controls.MPGroupBox mpGroupBox4; private MediaPortal.UserInterface.Controls.MPLabel lbArtist; + internal MediaPortal.UserInterface.Controls.MPCheckBox cbMusicTagAlwaysCheck; + private MediaPortal.UserInterface.Controls.MPCheckBox cbDisregardSongWithLyricInTag; } } \ 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-22 10:36:47 UTC (rev 2455) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.cs 2008-12-22 15:44:17 UTC (rev 2456) @@ -80,6 +80,7 @@ bool m_SearchOnlyMarkedSongs = false; bool m_automaticWriteToMusicTag = true; + bool m_automaticReadFromToMusicTag = true; string[] m_strippedPrefixStrings; @@ -103,10 +104,6 @@ System.Windows.Forms.Timer timer; StopWatch stopwatch = new StopWatch(); - // log information - private string log; - private string logFullFileName = ""; - private int lastShownLyricsTitles = 0; private int lastShownMarkedLyricsTitles = 0; @@ -114,11 +111,12 @@ public static bool UpdateLibraryUI = false; + MusicDatabase mDB = null; + public MyLyricsSetup() { - LyricDiagnostics.OpenLog(MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Log, MyLyricsSettings.LogName)); - //LyricDiagnostics.OpenLog(MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Log)); + //LyricDiagnostics.OpenLog(MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Log, MyLyricsSettings.LogName)); #region Initialize GUI and class InitializeComponent(); @@ -150,7 +148,7 @@ //} m_TotalTitles = mDB.GetTotalSongs(); - + #endregion #region Get settings from in MediaPortal.xml @@ -164,9 +162,13 @@ 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"); - cbMusicTag.Checked = m_automaticWriteToMusicTag; + 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)); @@ -191,7 +193,7 @@ DataGridViewRow row = dbGridView.Rows[valueIndex]; row.Cells[0].Value = findValue; row.Cells[1].Value = replaceArray[valueIndex]; - valueIndex++; + valueIndex++; } } } @@ -209,8 +211,9 @@ cbHotLyrics.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useHotLyrics", "True")).ToString().Equals("True") ? true : false; } } - catch (Exception ex) { - + catch (Exception ex) + { + MessageBox.Show("Something has gone wrong when reading Mediaportal.xml (" + ex.Message + ")"); } } @@ -329,7 +332,7 @@ // 100, // true)) //{ - //break; + //break; //} Application.DoEvents(); @@ -402,22 +405,6 @@ btStartBatchSearch.Enabled = false; - logFullFileName = Config.GetFile(Config.Dir.Log, MyLyricsSettings.LogBatchFileName); - - //if file is not found, create a new xml file - if (!System.IO.File.Exists(logFullFileName)) - { - FileStream file = new FileStream(logFullFileName, FileMode.OpenOrCreate, FileAccess.Write); - file.Close(); - StreamReader sr = File.OpenText(logFullFileName); - log = sr.ReadToEnd(); - sr.Close(); - log += DateTime.Now.ToString() + " The log has been created.\r\n"; - System.IO.StreamWriter writerLog = new System.IO.StreamWriter(logFullFileName); - writerLog.Write(log); - writerLog.Close(); - } - m_Limit = int.Parse(tbLimit.Text); m_DisregardKnownLyric = cbDisconsiderTitlesWithLyrics.Enabled && cbDisconsiderTitlesWithLyrics.Checked; @@ -488,7 +475,7 @@ m_LyricText = lyricStrings; m_artist = artist; m_track = track; - + --m_SongsToSearch; lbSongsToSearch2.Text = m_SongsToSearch.ToString(); @@ -503,20 +490,12 @@ DatabaseUtil.WriteToLyricsDatabase(MyLyricsSettings.LyricsDB, MyLyricsSettings.LyricsMarkedDB, capArtist, capTitle, lyricStrings, site); - if (m_automaticWriteToMusicTag) + if (!site.Equals("music tag") && m_automaticWriteToMusicTag) { TagReaderUtil.WriteLyrics(capArtist, capTitle, lyricStrings); } - StreamReader sr = File.OpenText(logFullFileName); - log = sr.ReadToEnd(); - sr.Close(); - string logText = capArtist + " - " + capTitle + " has a match at " + site + ".\r\n"; - log += DateTime.Now.ToString() + " " + logText; - lbLastActivity2.Text = logText; - System.IO.StreamWriter writerLog = new System.IO.StreamWriter(logFullFileName); - writerL... [truncated message content] |
From: <sa...@us...> - 2008-12-28 11:55:50
|
Revision: 2475 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2475&view=rev Author: saamand Date: 2008-12-28 11:34:26 +0000 (Sun, 28 Dec 2008) Log Message: ----------- Noteworthy changes since version 1.10: * Add: On the Lyrics database tab you can choose to see only LRCs in your Lyrics database. * Fix: Horinzontal black lines caused by use of "\r\n" in Label controls is eliminated by using "\n" instead. Modified Paths: -------------- trunk/plugins/MyLyrics/LyricsEngine/Properties/AssemblyInfo.cs trunk/plugins/MyLyrics/My Lyrics/MediaPortalUtil.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.Designer.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs trunk/plugins/MyLyrics/Skin/Blue3wide/myLyrics.xml Modified: trunk/plugins/MyLyrics/LyricsEngine/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/Properties/AssemblyInfo.cs 2008-12-27 17:02:43 UTC (rev 2474) +++ trunk/plugins/MyLyrics/LyricsEngine/Properties/AssemblyInfo.cs 2008-12-28 11:34:26 UTC (rev 2475) @@ -26,7 +26,7 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.1")] +[assembly: AssemblyVersion("1.20")] // // In order to sign your assembly you must specify a key to use. Refer to the Modified: trunk/plugins/MyLyrics/My Lyrics/MediaPortalUtil.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MediaPortalUtil.cs 2008-12-27 17:02:43 UTC (rev 2474) +++ trunk/plugins/MyLyrics/My Lyrics/MediaPortalUtil.cs 2008-12-28 11:34:26 UTC (rev 2475) @@ -38,5 +38,25 @@ } return artist; } + + public static string MakePlainLyricPerfectToShow(string text) + { + return text.Replace("\r\n", "\n"); + } + + public static string MakeLRCLinePerfectToShow(string text) + { + //string temp = lyric.Replace("\r\n", " "); + //if (temp.Equals(string.Empty)) + //{ + // return "-"; + //} + //else + //{ + // return temp; + //} + + return text.Replace("\r\n", string.Empty); + } } } Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs 2008-12-27 17:02:43 UTC (rev 2474) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs 2008-12-28 11:34:26 UTC (rev 2475) @@ -80,7 +80,7 @@ this.lbInfo1.Name = "lbInfo1"; this.lbInfo1.Size = new System.Drawing.Size(223, 18); this.lbInfo1.TabIndex = 3; - this.lbInfo1.Text = "MyLyrics plugin, version 1.10"; + this.lbInfo1.Text = "MyLyrics plugin, version 1.20"; // // label2 // Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.Designer.cs 2008-12-27 17:02:43 UTC (rev 2474) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.Designer.cs 2008-12-28 11:34:26 UTC (rev 2475) @@ -42,23 +42,23 @@ this.mpButton6 = new MediaPortal.UserInterface.Controls.MPButton(); this.mpButton7 = new MediaPortal.UserInterface.Controls.MPButton(); this.gbEditLyrics = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.btSave = new MediaPortal.UserInterface.Controls.MPButton(); this.btSearchSingle = new MediaPortal.UserInterface.Controls.MPButton(); - this.btSave = new MediaPortal.UserInterface.Controls.MPButton(); this.lbTitle = new MediaPortal.UserInterface.Controls.MPLabel(); this.lbArtists = new MediaPortal.UserInterface.Controls.MPLabel(); this.gbAddRemove = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.btDelete = new System.Windows.Forms.Button(); + this.btSwitch = new MediaPortal.UserInterface.Controls.MPButton(); this.btAdd = new System.Windows.Forms.Button(); - this.btSwitch = new MediaPortal.UserInterface.Controls.MPButton(); - this.btDelete = new System.Windows.Forms.Button(); this.gbImport = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.btImportFiles = new MediaPortal.UserInterface.Controls.MPButton(); this.btImportDirs = new MediaPortal.UserInterface.Controls.MPButton(); - this.btImportFiles = new MediaPortal.UserInterface.Controls.MPButton(); this.lbArtists2 = new MediaPortal.UserInterface.Controls.MPLabel(); this.treeView = new System.Windows.Forms.TreeView(); this.comboDatabase = new MediaPortal.UserInterface.Controls.MPComboBox(); this.gbExport = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.btExportTags = new MediaPortal.UserInterface.Controls.MPButton(); this.btImportTags = new MediaPortal.UserInterface.Controls.MPButton(); - this.btExportTags = new MediaPortal.UserInterface.Controls.MPButton(); this.lbSongs = new MediaPortal.UserInterface.Controls.MPLabel(); this.tbLyrics = new System.Windows.Forms.TextBox(); this.lbSongs2 = new MediaPortal.UserInterface.Controls.MPLabel(); @@ -89,7 +89,7 @@ this.gbResetDatabase.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.gbResetDatabase.Location = new System.Drawing.Point(5, 427); this.gbResetDatabase.Name = "gbResetDatabase"; - this.gbResetDatabase.Size = new System.Drawing.Size(538, 49); + this.gbResetDatabase.Size = new System.Drawing.Size(538, 48); this.gbResetDatabase.TabIndex = 11; this.gbResetDatabase.TabStop = false; this.gbResetDatabase.Text = "Reset database"; @@ -98,7 +98,7 @@ // this.btResetMarkedLyricsDatabase.Location = new System.Drawing.Point(457, 18); this.btResetMarkedLyricsDatabase.Name = "btResetMarkedLyricsDatabase"; - this.btResetMarkedLyricsDatabase.Size = new System.Drawing.Size(75, 23); + this.btResetMarkedLyricsDatabase.Size = new System.Drawing.Size(75, 21); this.btResetMarkedLyricsDatabase.TabIndex = 11; this.btResetMarkedLyricsDatabase.Text = "MarkedDB"; this.btResetMarkedLyricsDatabase.UseVisualStyleBackColor = true; @@ -108,7 +108,7 @@ // this.btResetLyricsDatabase.Location = new System.Drawing.Point(376, 18); this.btResetLyricsDatabase.Name = "btResetLyricsDatabase"; - this.btResetLyricsDatabase.Size = new System.Drawing.Size(75, 23); + this.btResetLyricsDatabase.Size = new System.Drawing.Size(75, 21); this.btResetLyricsDatabase.TabIndex = 10; this.btResetLyricsDatabase.Text = "LyricsDB"; this.btResetLyricsDatabase.UseVisualStyleBackColor = true; @@ -225,6 +225,7 @@ // // treeView1 // + this.treeView1.LineColor = System.Drawing.Color.Empty; this.treeView1.Location = new System.Drawing.Point(9, 84); this.treeView1.Name = "treeView1"; this.treeView1.Size = new System.Drawing.Size(235, 213); @@ -348,33 +349,33 @@ this.gbEditLyrics.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.gbEditLyrics.Location = new System.Drawing.Point(250, 290); this.gbEditLyrics.Name = "gbEditLyrics"; - this.gbEditLyrics.Size = new System.Drawing.Size(293, 52); + this.gbEditLyrics.Size = new System.Drawing.Size(293, 48); this.gbEditLyrics.TabIndex = 32; this.gbEditLyrics.TabStop = false; this.gbEditLyrics.Text = "Edit / find lyrics"; // + // btSave + // + this.btSave.Enabled = false; + this.btSave.Location = new System.Drawing.Point(4, 19); + this.btSave.Name = "btSave"; + this.btSave.Size = new System.Drawing.Size(68, 21); + this.btSave.TabIndex = 7; + this.btSave.Text = "&Save"; + this.btSave.UseVisualStyleBackColor = true; + this.btSave.Click += new System.EventHandler(this.btSave_Click); + // // btSearchSingle // this.btSearchSingle.Enabled = false; this.btSearchSingle.Location = new System.Drawing.Point(77, 19); this.btSearchSingle.Name = "btSearchSingle"; - this.btSearchSingle.Size = new System.Drawing.Size(68, 23); + this.btSearchSingle.Size = new System.Drawing.Size(68, 21); this.btSearchSingle.TabIndex = 31; this.btSearchSingle.Text = "&Find lyric"; this.btSearchSingle.UseVisualStyleBackColor = true; this.btSearchSingle.Click += new System.EventHandler(this.btSearchSingle_Click); // - // btSave - // - this.btSave.Enabled = false; - this.btSave.Location = new System.Drawing.Point(4, 19); - this.btSave.Name = "btSave"; - this.btSave.Size = new System.Drawing.Size(68, 23); - this.btSave.TabIndex = 7; - this.btSave.Text = "&Save"; - this.btSave.UseVisualStyleBackColor = true; - this.btSave.Click += new System.EventHandler(this.btSave_Click); - // // lbTitle // this.lbTitle.AutoSize = true; @@ -402,73 +403,73 @@ this.gbAddRemove.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.gbAddRemove.Location = new System.Drawing.Point(5, 290); this.gbAddRemove.Name = "gbAddRemove"; - this.gbAddRemove.Size = new System.Drawing.Size(238, 52); + this.gbAddRemove.Size = new System.Drawing.Size(238, 48); this.gbAddRemove.TabIndex = 30; this.gbAddRemove.TabStop = false; this.gbAddRemove.Text = "Add / remove / move lyrics"; // - // btAdd + // btDelete // - this.btAdd.Location = new System.Drawing.Point(6, 19); - this.btAdd.Name = "btAdd"; - this.btAdd.Size = new System.Drawing.Size(65, 23); - this.btAdd.TabIndex = 2; - this.btAdd.Text = "&Add"; - this.btAdd.UseVisualStyleBackColor = true; - this.btAdd.Click += new System.EventHandler(this.btAdd_Click); + this.btDelete.Location = new System.Drawing.Point(77, 19); + this.btDelete.Name = "btDelete"; + this.btDelete.Size = new System.Drawing.Size(65, 21); + this.btDelete.TabIndex = 3; + this.btDelete.Text = "&Delete"; + this.btDelete.UseVisualStyleBackColor = true; + this.btDelete.Click += new System.EventHandler(this.btDelete_Click); // // btSwitch // this.btSwitch.Location = new System.Drawing.Point(148, 19); this.btSwitch.Name = "btSwitch"; - this.btSwitch.Size = new System.Drawing.Size(65, 23); + this.btSwitch.Size = new System.Drawing.Size(65, 21); this.btSwitch.TabIndex = 29; this.btSwitch.Text = "&Move"; this.btSwitch.UseVisualStyleBackColor = true; this.btSwitch.Click += new System.EventHandler(this.btSwitch_Click); // - // btDelete + // btAdd // - this.btDelete.Location = new System.Drawing.Point(77, 19); - this.btDelete.Name = "btDelete"; - this.btDelete.Size = new System.Drawing.Size(65, 23); - this.btDelete.TabIndex = 3; - this.btDelete.Text = "&Delete"; - this.btDelete.UseVisualStyleBackColor = true; - this.btDelete.Click += new System.EventHandler(this.btDelete_Click); + this.btAdd.Location = new System.Drawing.Point(6, 19); + this.btAdd.Name = "btAdd"; + this.btAdd.Size = new System.Drawing.Size(65, 21); + this.btAdd.TabIndex = 2; + this.btAdd.Text = "&Add"; + this.btAdd.UseVisualStyleBackColor = true; + this.btAdd.Click += new System.EventHandler(this.btAdd_Click); // // gbImport // this.gbImport.Controls.Add(this.btImportFiles); this.gbImport.Controls.Add(this.btImportDirs); this.gbImport.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.gbImport.Location = new System.Drawing.Point(5, 348); + this.gbImport.Location = new System.Drawing.Point(5, 343); this.gbImport.Name = "gbImport"; - this.gbImport.Size = new System.Drawing.Size(238, 52); + this.gbImport.Size = new System.Drawing.Size(238, 48); this.gbImport.TabIndex = 33; this.gbImport.TabStop = false; this.gbImport.Text = "Import lyrics from files"; // + // btImportFiles + // + this.btImportFiles.Location = new System.Drawing.Point(6, 19); + this.btImportFiles.Name = "btImportFiles"; + this.btImportFiles.Size = new System.Drawing.Size(65, 21); + this.btImportFiles.TabIndex = 4; + this.btImportFiles.Text = "&Import files"; + this.btImportFiles.UseVisualStyleBackColor = true; + this.btImportFiles.Click += new System.EventHandler(this.btImportSingle_Click); + // // btImportDirs // this.btImportDirs.Location = new System.Drawing.Point(77, 19); this.btImportDirs.Name = "btImportDirs"; - this.btImportDirs.Size = new System.Drawing.Size(65, 23); + this.btImportDirs.Size = new System.Drawing.Size(65, 21); this.btImportDirs.TabIndex = 5; this.btImportDirs.Text = "Import &dirs"; this.btImportDirs.UseVisualStyleBackColor = true; this.btImportDirs.Click += new System.EventHandler(this.btImportDIRS_Click); // - // btImportFiles - // - this.btImportFiles.Location = new System.Drawing.Point(6, 19); - this.btImportFiles.Name = "btImportFiles"; - this.btImportFiles.Size = new System.Drawing.Size(65, 23); - this.btImportFiles.TabIndex = 4; - this.btImportFiles.Text = "&Import files"; - this.btImportFiles.UseVisualStyleBackColor = true; - this.btImportFiles.Click += new System.EventHandler(this.btImportSingle_Click); - // // lbArtists2 // this.lbArtists2.Location = new System.Drawing.Point(76, 40); @@ -492,10 +493,11 @@ this.comboDatabase.FormattingEnabled = true; this.comboDatabase.Items.AddRange(new object[] { "Lyrics database", + "Lyrics database (LRC only)", "Marked database"}); this.comboDatabase.Location = new System.Drawing.Point(79, 8); this.comboDatabase.Name = "comboDatabase"; - this.comboDatabase.Size = new System.Drawing.Size(144, 21); + this.comboDatabase.Size = new System.Drawing.Size(164, 21); this.comboDatabase.TabIndex = 1; this.comboDatabase.SelectedIndexChanged += new System.EventHandler(this.comboDatabase_SelectedIndexChanged); // @@ -504,33 +506,33 @@ this.gbExport.Controls.Add(this.btExportTags); this.gbExport.Controls.Add(this.btImportTags); this.gbExport.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.gbExport.Location = new System.Drawing.Point(250, 348); + this.gbExport.Location = new System.Drawing.Point(250, 343); this.gbExport.Name = "gbExport"; - this.gbExport.Size = new System.Drawing.Size(293, 52); + this.gbExport.Size = new System.Drawing.Size(293, 48); this.gbExport.TabIndex = 34; this.gbExport.TabStop = false; this.gbExport.Text = "Import / Export lyrics from music tags"; // + // btExportTags + // + this.btExportTags.Location = new System.Drawing.Point(77, 19); + this.btExportTags.Name = "btExportTags"; + this.btExportTags.Size = new System.Drawing.Size(68, 21); + this.btExportTags.TabIndex = 6; + this.btExportTags.Text = "Export"; + this.btExportTags.UseVisualStyleBackColor = true; + this.btExportTags.Click += new System.EventHandler(this.btExportTags_Click); + // // btImportTags // this.btImportTags.Location = new System.Drawing.Point(4, 19); this.btImportTags.Name = "btImportTags"; - this.btImportTags.Size = new System.Drawing.Size(68, 23); + this.btImportTags.Size = new System.Drawing.Size(68, 21); this.btImportTags.TabIndex = 6; this.btImportTags.Text = "Import"; this.btImportTags.UseVisualStyleBackColor = true; this.btImportTags.Click += new System.EventHandler(this.btImportTags_Click); // - // btExportTags - // - this.btExportTags.Location = new System.Drawing.Point(77, 19); - this.btExportTags.Name = "btExportTags"; - this.btExportTags.Size = new System.Drawing.Size(68, 23); - this.btExportTags.TabIndex = 6; - this.btExportTags.Text = "Export"; - this.btExportTags.UseVisualStyleBackColor = true; - this.btExportTags.Click += new System.EventHandler(this.btExportTags_Click); - // // lbSongs // this.lbSongs.Location = new System.Drawing.Point(5, 55); @@ -573,7 +575,7 @@ // // btRefresh // - this.btRefresh.Location = new System.Drawing.Point(235, 8); + this.btRefresh.Location = new System.Drawing.Point(250, 8); this.btRefresh.Name = "btRefresh"; this.btRefresh.Size = new System.Drawing.Size(55, 21); this.btRefresh.TabIndex = 36; Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.cs 2008-12-27 17:02:43 UTC (rev 2474) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.cs 2008-12-28 11:34:26 UTC (rev 2475) @@ -42,19 +42,23 @@ const int SHIFT_WHEN_HIT = 15; internal static LyricsDatabase CurrentDB; private int currentDBIndex = 0; - enum TYPEOFLYRICS : int {NONE, NORMAL, LRC}; + enum TYPEOFLYRICS : int { NONE, NORMAL, LRC }; + bool m_OnlyShowLRCs = false; + public LyricsLibrary(Form form) { this.parent = form as MyLyricsSetup; InitializeComponent(); comboDatabase.SelectedIndex = 0; - updateLyricsTree(); + updateLyricsTree(false); } - internal void updateLyricsTree() + internal void updateLyricsTree(bool onlyShowLRCs) { + m_OnlyShowLRCs = onlyShowLRCs; + if (CurrentDB == null) { return; @@ -66,10 +70,23 @@ m_NoOfArtists = 0; m_NoOfTitles = 0; - foreach (KeyValuePair<string, LyricsItem> kvp in CurrentDB) + if (onlyShowLRCs) { - AddSong(kvp.Value); + foreach (KeyValuePair<string, LyricsItem> kvp in CurrentDB) + { + if (isSelectedLyricLRC(kvp.Value.Artist, kvp.Value.Title)) + { + AddSong(kvp.Value); + } + } } + else + { + foreach (KeyValuePair<string, LyricsItem> kvp in CurrentDB) + { + AddSong(kvp.Value); + } + } } catch {;} finally @@ -124,7 +141,7 @@ treeView.Nodes.Add(artist, artist); ++m_NoOfArtists; } - + // add title, if it doesn't exists int artistIndex = treeView.Nodes.IndexOfKey(artist); if (!treeView.Nodes[artistIndex].Nodes.ContainsKey(title)) @@ -212,31 +229,23 @@ } } - private bool isSelectedLyricALRC() + private bool isSelectedLyricLRC(string artist, string title) { - if (treeView.SelectedNode != null && treeView.SelectedNode.Parent != null) + if (artist.Length != 0 && title.Length != 0) { - string artist = treeView.SelectedNode.Parent.Text; - string title = treeView.SelectedNode.Text; + string lyricsText = (string)CurrentDB[DatabaseUtil.CorrectKeyFormat(artist, title)].Lyrics; - if (artist.Length != 0 && title.Length != 0) + SimpleLRC lrc = new SimpleLRC(artist, title, lyricsText); + if (lrc.IsValid) { - m_CurrentArtist = artist; - m_CurrentTitle = LyricUtil.CapatalizeString(title); - - string lyricsText = (string)CurrentDB[DatabaseUtil.CorrectKeyFormat(artist, title)].Lyrics; - - SimpleLRC lrc = new SimpleLRC(artist, title, lyricsText); - if (lrc.IsValid) - { - return true; - } - else - { - return false; - } + return true; } + else + { + return false; + } } + return false; } @@ -249,7 +258,7 @@ lbLRCTest.Text = ""; tbLyrics.Enabled = false; - + // Selected a title if (treeView.SelectedNode != null && treeView.SelectedNode.Parent != null) { @@ -394,14 +403,22 @@ private void treeView_AfterSelect(object sender, TreeViewEventArgs e) { updateInfo(); - if (isSelectedLyricALRC()) + + if (treeView.SelectedNode != null && treeView.SelectedNode.Parent != null) { - lbLRCTest.Text = "(valid LRC)"; + string title = treeView.SelectedNode.Text; + m_CurrentArtist = treeView.SelectedNode.Parent.Text; + m_CurrentTitle = LyricUtil.CapatalizeString(title); + + if (isSelectedLyricLRC(m_CurrentArtist, title)) + { + lbLRCTest.Text = "(valid LRC)"; + } + else + { + lbLRCTest.Text = ""; + } } - else - { - lbLRCTest.Text = ""; - } } private void btAdd_Click(object sender, EventArgs e) @@ -528,7 +545,7 @@ otherDatabase[key] = item; } } - updateLyricsTree(); + updateLyricsTree(false); DatabaseUtil.SerializeDBs(); } else @@ -582,7 +599,7 @@ { MessageBox.Show("The title is already in the database"); } - + } else { @@ -672,7 +689,7 @@ { if (MessageBox.Show(this, "Are you sure the lyrics database should be upgraded?", "Upgrade lyrics database", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) { - updateLyricsTree(); + updateLyricsTree(false); } } @@ -748,23 +765,36 @@ private void comboDatabase_SelectedIndexChanged(object sender, EventArgs e) { - if (comboDatabase.SelectedIndex == 0 && currentDBIndex != 0) + if (comboDatabase.SelectedIndex == 0 && (currentDBIndex != 0 || m_OnlyShowLRCs)) { resetFields(); currentDBIndex = 0; CurrentDB = MyLyricsSettings.LyricsDB; btImportFiles.Enabled = true; btImportDirs.Enabled = true; - updateLyricsTree(); + updateLyricsTree(false); } - else if (comboDatabase.SelectedIndex == 1 && currentDBIndex != 1) + else if (comboDatabase.SelectedIndex == 1) { resetFields(); + currentDBIndex = 0; + CurrentDB = MyLyricsSettings.LyricsDB; + btImportFiles.Enabled = true; + btImportDirs.Enabled = true; + btImportTags.Enabled = false; + btExportTags.Enabled = false; + updateLyricsTree(true); + } + else if (comboDatabase.SelectedIndex == 2 && currentDBIndex != 1) + { + resetFields(); currentDBIndex = 1; CurrentDB = MyLyricsSettings.LyricsMarkedDB; btImportFiles.Enabled = false; btImportDirs.Enabled = false; - updateLyricsTree(); + btImportTags.Enabled = false; + btExportTags.Enabled = false; + updateLyricsTree(false); } } @@ -781,7 +811,7 @@ CurrentDB = MyLyricsSettings.LyricsDB; comboDatabase.SelectedIndex = 0; - updateLyricsTree(); + updateLyricsTree(false); updateInfo(); } } @@ -799,8 +829,8 @@ fs.Close(); CurrentDB = MyLyricsSettings.LyricsMarkedDB; - comboDatabase.SelectedIndex = 1; - updateLyricsTree(); + comboDatabase.SelectedIndex = 2; + updateLyricsTree(false); updateInfo(); } } @@ -849,7 +879,7 @@ { ImportTags importTags = new ImportTags(); importTags.ShowDialog(); - updateLyricsTree(); + updateLyricsTree(false); } private void btExportTags_Click(object sender, EventArgs e) @@ -860,7 +890,7 @@ private void btRefresh_Click(object sender, EventArgs e) { - updateLyricsTree(); + updateLyricsTree(m_OnlyShowLRCs); } } } Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.cs 2008-12-27 17:02:43 UTC (rev 2474) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.cs 2008-12-28 11:34:26 UTC (rev 2475) @@ -304,7 +304,7 @@ LyricsLibrary.CurrentDB = MyLyricsSettings.LyricsDB; #endregion - lyricsLibraryUC.updateLyricsTree(); + lyricsLibraryUC.updateLyricsTree(false); } @@ -543,7 +543,7 @@ { lc.StopSearches = true; DatabaseUtil.SerializeDBs(); - lyricsLibraryUC.updateLyricsTree(); + lyricsLibraryUC.updateLyricsTree(false); } bgWorkerSearch.CancelAsync(); StopThread(); @@ -952,7 +952,7 @@ { if (UpdateLibraryUI) { - lyricsLibraryUC.updateLyricsTree(); + lyricsLibraryUC.updateLyricsTree(false); UpdateLibraryUI = false; } lyricsLibraryUC.treeView.Select(); Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2008-12-27 17:02:43 UTC (rev 2474) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2008-12-28 11:34:26 UTC (rev 2475) @@ -306,14 +306,14 @@ if (lrc.IsValid) { alreadyValidLRC = true; - lines = new string[1] { "This track already has a valid LRC!" }; + lines = new string[1] { "This song already has a valid LRC lyric." }; GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_LINE + 0, lines[0]); GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_LINE_DONE + 0, lines[0]); } else { - lines = m_LyricText.Split(new string[1] { "\n" }, StringSplitOptions.None); + lines = m_LyricText.Split(new string[1] { "\r\n" }, StringSplitOptions.None); try { @@ -717,8 +717,8 @@ { for (int i = tagRoundFinished * TAG_IN_ROUND; i < (tagRoundFinished + 1) * TAG_IN_ROUND; i++) { - GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_VIEW_LINE + i, lines[i]); - GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_VIEW_LINE_DONE + i, lines[i]); + ShowLrcLine((int)GUI_LRC_Controls.CONTROL_VIEW_LINE + i, lines[i]); + ShowLrcLine((int)GUI_LRC_Controls.CONTROL_VIEW_LINE_DONE + i, lines[i]); } } catch { ;} @@ -892,9 +892,9 @@ { for (int i = 0; i < TAG_IN_ROUND; i++) { - GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_VIEW_LINE + i, lines[tagRoundFinished * TAG_IN_ROUND + i]); + ShowLrcLine((int)GUI_LRC_Controls.CONTROL_VIEW_LINE + i, lines[tagRoundFinished * TAG_IN_ROUND + i]); GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_VIEW_LINE_DONE + i); - GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_VIEW_LINE_DONE + i, lines[tagRoundFinished * TAG_IN_ROUND + i]); + ShowLrcLine((int)GUI_LRC_Controls.CONTROL_VIEW_LINE_DONE + i, lines[tagRoundFinished * TAG_IN_ROUND + i]); } } catch { ;}; @@ -908,7 +908,13 @@ } } + private void ShowLrcLine(int controlID, string text) + { + text = MediaPortalUtil.MakeLRCLinePerfectToShow(text); + GUIControl.SetControlLabel(GetID, controlID, text); + } + private void ShowLyricOnScreen(string lyricText, string source) { LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Information, 0, LyricDiagnostics.ElapsedTimeString() + "Lyric found: " + m_artist + " - " + m_title + ". Place: " + source); @@ -925,6 +931,8 @@ } else { + m_LyricText = MediaPortalUtil.MakePlainLyricPerfectToShow(m_LyricText); + if (basicScreenSelected.HasValue == false || basicScreenSelected.Value) { resetGUI((int)MyLyricsSettings.Screen.LYRICS_BASIC); Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj 2008-12-27 17:02:43 UTC (rev 2474) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj 2008-12-28 11:34:26 UTC (rev 2475) @@ -5,7 +5,7 @@ <ProductVersion>9.0.21022</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{BBB2DAE2-0D83-4B4B-85B6-D1B5A7E10039}</ProjectGuid> - <OutputType>Library</OutputType> + <OutputType>WinExe</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>MyLyrics</RootNamespace> <AssemblyName>MyLyrics</AssemblyName> Modified: trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs 2008-12-27 17:02:43 UTC (rev 2474) +++ trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs 2008-12-28 11:34:26 UTC (rev 2475) @@ -31,5 +31,5 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.1")] -[assembly: AssemblyFileVersion("1.1")] +[assembly: AssemblyVersion("1.20")] +[assembly: AssemblyFileVersion("1.20")] Modified: trunk/plugins/MyLyrics/Skin/Blue3wide/myLyrics.xml =================================================================== --- trunk/plugins/MyLyrics/Skin/Blue3wide/myLyrics.xml 2008-12-27 17:02:43 UTC (rev 2474) +++ trunk/plugins/MyLyrics/Skin/Blue3wide/myLyrics.xml 2008-12-28 11:34:26 UTC (rev 2475) @@ -3,32 +3,61 @@ <id>90478</id> <defaultcontrol>20</defaultcontrol> <allowoverlay>no</allowoverlay> + <define>#header.label:5</define> + <define>#header.image:music_logo.png</define> + <define>#header.hover:hover_music.png</define> + <!-- cheat a little, we don't use two of the items in the imported file to blank their labels --> + <define>#itemcount:-</define> + <define>#selecteditem:-</define> <controls> + <import>common.window.xml</import> <control> - <type>image</type> - <description>background image</description> - <id>0</id> - <texture>background.png</texture> + <type>label</type> + <description>Screen Title</description> + <id>2</id> + <posX>225</posX> + <posY>75</posY> + <label>Titel</label> + <font>font12</font> + <textcolor>ffffffff</textcolor> </control> <control> <type>textbox</type> <description>The Lyric area</description> + <id>20</id> + <posX>110</posX> + <posY>125</posY> + <width>760</width> + <height>490</height> + <onleft>2</onleft> + <onright>2</onright> + <onup>2</onup> + <ondown>2</ondown> + <image>icon-folder.png</image> + <seperator>----------------------------------------------------------------------------------------------</seperator> + <text>6</text> + <font>font13</font> + <spinPosX>775</spinPosX> + <spinPosY>545</spinPosY> + </control> + <control> + <type>textbox</type> + <description>The Lyric area wide</description> <id>21</id> <posX>110</posX> - <posY>120</posY> + <posY>125</posY> <width>1160</width> - <height>480</height> + <height>490</height> <onleft>2</onleft> <onright>2</onright> <onup>2</onup> <ondown>2</ondown> <image>icon-folder.png</image> - <label>-</label> <seperator>----------------------------------------------------------------------------------------------</seperator> <text>6</text> - <font>font14</font> - <SpinPosX>48</SpinPosX> - <SpinPosY>442</SpinPosY> + <font>font13</font> + <spinPosX>1150</spinPosX> + <spinPosY>545</spinPosY> </control> <control> <type>label</type> @@ -44,19 +73,19 @@ <type>image</type> <description>menu background image</description> <id>34</id> - <posX>58</posX> - <posY>566</posY> - <width>1250</width> - <height>189</height> - <!--<texture>osd_bg.png</texture> - <animation effect="fade" time="150">WindowOpen</animation>--> + <posX>30</posX> + <posY>570</posY> + <width>1225</width> + <height>160</height> + <texture>osd_bg.png</texture> + <animation effect="fade" time="150">WindowOpen</animation> </control> <control> <type>fadelabel</type> <description>track label</description> <id>33</id> - <posX>262</posX> - <posY>682</posY> + <posX>170</posX> + <posY>670</posY> <width>600</width> <height>28</height> <label>#Play.Current.Track</label> @@ -67,8 +96,8 @@ <type>fadelabel</type> <description>track label</description> <id>32</id> - <posX>262</posX> - <posY>646</posY> + <posX>170</posX> + <posY>634</posY> <width>600</width> <height>26</height> <label>#Play.Current.Artist</label> @@ -79,35 +108,16 @@ <type>fadelabel</type> <description>track label</description> <id>30</id> - <posX>262</posX> - <posY>602</posY> + <posX>170</posX> + <posY>590</posY> <width>600</width> <height>26</height> <label>#Play.Current.Title</label> <font>font18</font> <animation effect="fade" time="150">WindowOpen</animation> </control> - <control> - <type>textbox</type> - <description>The Lyric area</description> - <id>20</id> - <posX>110</posX> - <posY>120</posY> - <width>760</width> - <height>480</height> - <onleft>2</onleft> - <onright>2</onright> - <onup>2</onup> - <ondown>2</ondown> - <image>icon-folder.png</image> - <label>-</label> - <seperator>----------------------------------------------------------------------------------------------</seperator> - <text>6</text> - <font>font14</font> - <SpinPosX>48</SpinPosX> - <SpinPosY>442</SpinPosY> - </control> - <control> + + <!--<control> <type>image</type> <description>title image</description> <id>35</id> @@ -115,7 +125,7 @@ <posY>26</posY> <texture flipY="true" diffuse="Thumb_Mask.png">music_logo.png</texture> <animation effect="fade" time="150">WindowOpen</animation> - </control> + </control>--> <control> <type>image</type> <description>nowplaying background</description> @@ -149,7 +159,6 @@ <label>#Play.Current.Year</label> <font>font13</font> <align>right</align> - <!-- <textcolor>white</textcolor> --> </control> <control> <type>label</type> @@ -161,7 +170,6 @@ <label>#Play.Current.Album</label> <font>font13</font> <align>left</align> - <!-- <textcolor>white</textcolor> --> <animation effect="fade" time="150">WindowOpen</animation> </control> <control> @@ -208,8 +216,8 @@ <type>label</type> <description>up next label</description> <id>20</id> - <posX>1239</posX> - <posY>609</posY> + <posX>1189</posX> + <posY>597</posY> <label>4541</label> <font>font14</font> <align>right</align> @@ -219,8 +227,8 @@ <type>fadelabel</type> <description>next track label</description> <id>121</id> - <posX>1237</posX> - <posY>684</posY> + <posX>1187</posX> + <posY>674</posY> <width>300</width> <label>#Play.Next.Title</label> <align>right</align> @@ -230,8 +238,8 @@ <type>fadelabel</type> <description>next artist label</description> <id>123</id> - <posX>1235</posX> - <posY>652</posY> + <posX>1185</posX> + <posY>640</posY> <width>300</width> <label>#Play.Next.Artist</label> <align>right</align> @@ -246,7 +254,7 @@ <posY>120</posY> <colordiffuse>80ffffff</colordiffuse> <label>line 0</label> - <font>font14</font> + <textcolor>80ffffff</textcolor> <disabledcolor>ffffffff</disabledcolor> </control> @@ -258,7 +266,7 @@ <posX>112</posX> <posY>120</posY> <label>line 0</label> - <font>font14</font> + <textcolor>ffffffff</textcolor> <disabledcolor>ffffffff</disabledcolor> </control> @@ -270,7 +278,7 @@ <posX>112</posX> <posY>152</posY> <label>line 1</label> - <font>font14</font> + <textcolor>80ffffff</textcolor> </control> <control> @@ -281,7 +289,7 @@ <posX>112</posX> <posY>152</posY> <label>line 1</label> - <font>font14</font> + <textcolor>ffffffff</textcolor> </control> <control> @@ -292,7 +300,7 @@ <posX>112</posX> <posY>184</posY> <label>line 2</label> - <font>font14</font> + <textcolor>80ffffff</textcolor> </control> <control> @@ -303,7 +311,7 @@ <posX>112</posX> <posY>184</posY> <label>line 2</label> - <font>font14</font> + <textcolor>ffffffff</textcolor> </control> <control> @@ -314,7 +322,7 @@ <posX>112</posX> <posY>216</posY> <label>line 3</label> - <font>font14</font> + <textcolor>80ffffff</textcolor> </control> <control> @@ -325,7 +333,7 @@ <posX>112</posX> <posY>216</posY> <label>line 3</label> - <font>font14</font> + <textcolor>ffffffff</textcolor> </control> <control> @@ -336,7 +344,7 @@ <posX>112</posX> <posY>248</posY> <label>line 4</label> - <font>font14</font> + <textcolor>80ffffff</textcolor> </control> <control> @@ -347,7 +355,7 @@ <posX>112</posX> <posY>248</posY> <label>line 4</label> - <font>font14</font> + <textcolor>ffffffff</textcolor> </control> <control> @@ -358,7 +366,7 @@ <posX>112</posX> <posY>280</posY> <label>line 5</label> - <font>font14</font> + <textcolor>80ffffff</textcolor> </control> <control> @@ -369,7 +377,7 @@ <posX>112</posX> <posY>280</posY> <label>line 5</label> - <font>font14</font> + <textcolor>ffffffff</textcolor> </control> <control> @@ -380,7 +388,7 @@ <posX>112</posX> <posY>312</posY> <label>line 6</label> - <font>font14</font> + <textcolor>80ffffff</textcolor> </control> <control> @@ -391,7 +399,7 @@ <posX>112</posX> <posY>312</posY> <label>line 6</label> - <font>font14</font> + <textcolor>ffffffff</textcolor> </control> <control> @@ -402,7 +410,7 @@ <posX>112</posX> <posY>344</posY> <label>line 7</label> - <font>font14</font> + <textcolor>80ffffff</textcolor> </control> <control> @@ -413,7 +421,7 @@ <posX>112</posX> <posY>344</posY> <label>line 7</label> - <font>font14</font> + <textcolor>ffffffff</textcolor> </control> <control> @@ -424,7 +432,7 @@ <posX>112</posX> <posY>376</posY> <label>line 8</label> - <font>font14</font> + <textcolor>80ffffff</textcolor> </control> <control> @@ -435,7 +443,7 @@ <posX>112</posX> <posY>376</posY> <label>line 8</label> - <font>font14</font> + <textcolor>ffffffff</textcolor> </control> <control> @@ -446,7 +454,7 @@ <posX>112</posX> <posY>408</posY> <label>line 9</label> - <font>font14</font> + <textcolor>80ffffff</textcolor> </control> <control> @@ -457,7 +465,7 @@ <posX>112</posX> <posY>408</posY> <label>line 9</label> - <font>font14</font> + <textcolor>ffffffff</textcolor> </control> <control> @@ -468,7 +476,7 @@ <posX>112</posX> <posY>440</posY> <label>line 10</label> - <font>font14</font> + <textcolor>80ffffff</textcolor> </control> <control> @@ -479,7 +487,7 @@ <posX>112</posX> <posY>440</posY> <label>line 10</label> - <font>font14</font> + <textcolor>ffffffff</textcolor> </control> <control> @@ -490,7 +498,7 @@ <posX>112</posX> <posY>472</posY> <label>line 11</label> - <font>font14</font> + <textcolor>80ffffff</textcolor> </control> <control> @@ -501,7 +509,7 @@ <posX>112</posX> <posY>472</posY> <label>line 11</label> - <font>font14</font> + <textcolor>ffffffff</textcolor> </control> <control> @@ -512,7 +520,7 @@ <posX>112</posX> <posY>504</posY> <label>line 12</label> - <font>font14</font> + <textcolor>80ffffff</textcolor> </control> <control> @@ -523,7 +531,7 @@ <posX>112</posX> <posY>504</posY> <label>line 12</label> - <font>font14</font> + <textcolor>ffffffff</textcolor> </control> @@ -537,7 +545,7 @@ <posY>120</posY> <colordiffuse>80ffffff</colordiffuse> <label>line 0</label> - <font>font14</font> + <textcolor>80ffffff</textcolor> <disabledcolor>ffffffff</disabledcolor> </control> @@ -549,7 +557,7 @@ <posX>112</posX> <posY>120</posY> <label>line 0</label> - <font>font14</font> + <textcolor>ffffffff</textcolor> <disabledcolor>ffffffff</disabledcolor> </control> @@ -561,7 +569,7 @@ <posX>112</posX> <posY>152</posY> <label>line 1</label> - <font>font14</font> + <textcolor>80ffffff</textcolor> </control> <control> @@ -572,7 +580,7 @@ <posX>112</posX> <posY>152</posY> <label>line 1</label> - <font>font14</font> + <textcolor>ffffffff</textcolor> </control> <control> @@ -583,7 +591,7 @@ <posX>112</posX> <posY>184</posY> <label>line 2</label> - <font>font14</font> + <textcolor>80ffffff</textcolor> </control> <control> @@ -594,7 +602,7 @@ <posX>112</posX> <posY>184</posY> <label>line 2</label> - <font>font14</font> + <textcolor>ffffffff</textcolor> </control> <control> @@ -605,7 +613,7 @@ <posX>112</posX> <posY>216</posY> <label>line 3</label> - <font>font14</font> + <textcolor>80ffffff</textcolor> </control> <control> @@ -616,7 +624,7 @@ <posX>112</posX> <posY>216</posY> <label>line 3</label> - <font>font14</font> + <textcolor>ffffffff</textcolor> </control> <control> @@ -627,7 +635,7 @@ <posX>112</posX> <posY>248</posY> <label>line 4</label> - <font>font14</font> + <textcolor>80ffffff</textcolor> </control> <control> @@ -638,7 +646,7 @@ <posX>112</posX> <posY>248</posY> <label>line 4</label> - <font>font14</font> + <textcolor>ffffffff</textcolor> </control> <control> @@ -649,7 +657,7 @@ <posX>112</posX> <posY>280</posY> <label>line 5</label> - <font>font14</font> + <textcolor>80ffffff</textcolor> </control> <control> @@ -660,7 +668,7 @@ <posX>112</posX> <posY>280</posY> <label>line 5</label> - <font>font14</font> + <textcolor>ffffffff</textcolor> </control> <control> @@ -671,7 +679,7 @@ <posX>112</posX> <posY>312</posY> <label>line 6</label> - <font>font14</font> + <textcolor>80ffffff</textcolor> </control> <control> @@ -682,7 +690,7 @@ <posX>112</posX> <posY>312</posY> <label>line 6</label> - <font>font14</font> + <textcolor>ffffffff</textcolor> </control> <control> @@ -693,7 +701,7 @@ <posX>112</posX> <posY>344</posY> <label>line 7</label> - <font>font14</font> + <textcolor>80ffffff</textcolor> </control> <control> @@ -704,7 +712,7 @@ <posX>112</posX> <posY>344</posY> <label>line 7</label> - <font>font14</font> + <textcolor>ffffffff</textcolor> </control> <control> @@ -715,7 +723,7 @@ <posX>112</posX> <posY>376</posY> <label>line 8</label> - <font>font14</font> + <textcolor>80ffffff</textcolor> </control> <control> @@ -726,7 +734,7 @@ <posX>112</posX> <posY>376</posY> <label>line 8</label> - <font>font14</font> + <textcolor>ffffffff</textcolor> </control> <control> @@ -737,7 +745,7 @@ <posX>112</posX> <posY>408</posY> <label>line 9</label> - <font>font14</font> + <textcolor>80ffffff</textcolor> </control> <control> @@ -748,7 +756,7 @@ <posX>112</posX> <posY>408</posY> <label>line 9</label> - <font>font14</font> + <textcolor>ffffffff</textcolor> </control> <control> @@ -759,7 +767,7 @@ <posX>112</posX> <posY>440</posY> <label>line 10</label> - <font>font14</font> + <textcolor>80ffffff</textcolor> </control> <control> @@ -770,7 +778,7 @@ <posX>112</posX> <posY>440</posY> <label>line 10</label> - <font>font14</font> + <textcolor>ffffffff</textcolor> </control> <control> @@ -781,7 +789,7 @@ <posX>112</posX> <posY>472</posY> <label>line 11</label> - <font>font14</font> + <textcolor>80ffffff</textcolor> </control> <control> @@ -792,7 +800,7 @@ <posX>112</posX> <posY>472</posY> <label>line 11</label> - <font>font14</font> + <textcolor>ffffffff</textcolor> </control> <control> @@ -803,7 +811,7 @@ <posX>112</posX> <posY>504</posY> <label>line 12</label> - <font>font14</font> + <textcolor>80ffffff</textcolor> </control> <control> @@ -814,7 +822,7 @@ <posX>112</posX> <posY>504</posY> <label>line 12</label> - <font>font14</font> + <textcolor>ffffffff</textcolor> </control> @@ -962,5 +970,683 @@ <font>font10</font> <textcolor>80ffffff</textcolor> </control> + + </controls> -</window> \ No newline at end of file +</window> + + + + <!--<control> + <type>image</type> + <description>Playing_back</description> + <id>0</id> + <texture>Playing_back1.png</texture> + </control> + <control> + <description>music logo</description> + <type>image</type> + <id>600</id> + <posX>948</posX> + <posY>110</posY> + <width>350</width> + <height>350</height> + <keepaspectratio>yes</keepaspectratio> + <centered>yes</centered> + <texture>#Play.Current.Thumb</texture> + <animation effect="fade" time="250">WindowOpen</animation> + </control> + <control> + <type>image</type> + <description>Playing_back</description> + <id>0</id> + <texture>Playing_front1.png</texture> + </control> + <control> + <type>image</type> + <description>menu background image</description> + <id>0</id> + <posX>55</posX> + <posY>531</posY> + <width>1191</width> + <height>177</height> + <texture>-</texture> + <animation effect="fade" time="150">WindowOpen</animation> + </control> + <control> + <type>image</type> + <description>background hover image</description> + <id>0</id> + <posX>71</posX> + <posY>553</posY> + <width>160</width> + <height>157</height> + <texture>-</texture> + <animation effect="fade" time="150">WindowOpen</animation> + </control> + <control> + <type>image</type> + <description>title image</description> + <id>0</id> + <posX>106</posX> + <posY>25</posY> + <texture>music_logo.png</texture> + <animation effect="fade" time="150">WindowOpen</animation> + </control> + + <control> + <type>image</type> + <description>nowplaying background</description> + <id>0</id> + <posX>564</posX> + <posY>73</posY> + <width>468</width> + <height>407</height> + <texture>CDcover.png</texture> + <animation effect="fade" time="150">WindowOpen</animation> + </control> + <control> + <type>image</type> + <description>album art image</description> + <id>112</id> + <posX>633</posX> + <posY>89</posY> + <width>365</width> + <height>367</height> + <texture>-</texture> + <keepaspectratio>yes</keepaspectratio> + <centered>yes</centered> + <zoom>yes</zoom> + <animation effect="fade" time="250">WindowOpen</animation> + </control> + <control> + <type>image</type> + <description>nowplaying shine</description> + <id>0</id> + <posX>566</posX> + <posY>73</posY> + <width>468</width> + <height>407</height> + <texture>CDcover_shine.png</texture> + <animation effect="fade" time="150">WindowOpen</animation> + </control> + <control> + <type>fadelabel</type> + <description>Title label</description> + <id>0</id> + <posX>79</posX> + <posY>430</posY> + <width>468</width> + <height>25</height> + <label>#Play.Current.Title</label> + <font>font18</font> + <textcolor>80000000</textcolor> + <animation effect="fade" time="150">WindowOpen</animation> + </control> + <control> + <type>fadelabel</type> + <description>Title label</description> + <id>0</id> + <posX>76</posX> + <posY>427</posY> + <width>468</width> + <height>25</height> + <label>#Play.Current.Title</label> + <font>font18</font> + <animation effect="fade" time="150">WindowOpen</animation> + </control> + <control> + <type>fadelabel</type> + <description>Artist label</description> + <id>0</id> + <posX>79</posX> + <posY>358</posY> + <width>468</width> + <height>25</height> + <label>#Play.Current.Artist</label> + <font>font16</font> + <textcolor>80000000</textcolor> + <animation effect="fade" time="150">WindowOpen</animation> + </control> + <control> + <type>fadelabel</type> + <description>Artist label</description> + <id>0</id> + <posX>76</posX> + <posY>355</posY> + <width>468</width> + <height>25</height> + <label>#Play.Current.Artist</label> + <font>font16</font> + <animation effect="fade" time="150">WindowOpen</animation> + </control> + <control> + <type>fadelabel</type> + <description>track label</description> + <id>0</id> + <posX>79</posX> + <posY>394</posY> + <width>468</width> + <height>25</height> + <label>#Play.Current.Track</label> + <font>font16</font> + <textcolor>80000000</textcolor> + <animation effect="fade" time="250">WindowOpen</animation> + </control> + <control> + <type>fadelabel</type> + <description>track label</description> + <id>0</id> + <posX>76</posX> + <posY>391</posY> + <width>468</width> + <height>25</height> + <label>#Play.Current.Track</label> + <font>font16</font> + <animation effect="fade" time="250">WindowOpen</animation> + </control> + <control> + <type>fadelabel</type> + <description>year label</description> + <id>0</id> + <posX>1004</posX> + <posY>57</posY> + <width>160</width> + <label>#Play.Current.Year</label> + <font>font10</font> + <align>right</align> + <textcolor>80000000</textcolor> + <animation effect="fade" time="150">WindowOpen</animation> + </control> + <control> + <type>fadelabel</type> + <description>year label</description> + <id>0</id> + <posX>1002</posX> + <posY>55</posY> + <width>160</width> + <label>#Play.Current.Year</label> + <font>font10</font> + <align>right</align> + <textcolor>white</textcolor> + <animation effect="fade" time="250">WindowOpen</animation> + </control> + <control> + <type>fadelabel</type> + <description>album label</description> + <id>0</id> + <posX>584</posX> + <posY>52</posY> + <width>320</width> + <label>#Play.Current.Album</label> + <font>font13</font> + <align>left</align> + <textcolor>80000000</textcolor> + <animation effect="fade" time="250">WindowOpen</animation> + </control> + <control> + <type>fadelabel</type> + <description>album label</description> + <id>0</id> + <posX>581</posX> + <posY>50</posY> + <width>320</width> + <label>#Play.Current.Album</label> + <font>font13</font> + <align>left</align> + <textcolor>white</textcolor> + <animation effect="fade" time="250">WindowOpen</animation> + </control> + <control> + <description>Progress background</description> + <type>image</type> + <id>117</id> + <posX>636</posX> + <posY>486</posY> + <width>336</width> + <height>30</height> + <visible>player.hasmedia</visible> + <texture>osd_progress_background.png</texture> + <animation effect="fade" time="150">WindowOpen</animation> + </control> + <control> + <type>progress</type> + <description>track progress</description> + <id>118</id> + <posX>631</posX> + <posY>490</posY> + <width>350</width> + <visible>player.hasmedia</visible> + </control> + <control> + <type>label</type> + <description>track progress label</description> + <id>0</id> + <posX>563</posX> + <posY>486</posY> + <label>#currentplaytime</label> + <font>font14</font> + <align>left</align> + <textcolor>80ffffff</textcolor> + <visible>player.hasmedia</visible> + <animation effect="fade" time="250">WindowOpen</animation> + </control> + <control> + <type>label</type> + <description>track duration label</description> + <id>0</id> + <posX>1045</posX> + <posY>486</posY> + <label>#duration</label> + <font>font14</font> + ... [truncated message content] |
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. |
From: <sa...@us...> - 2009-01-03 17:02:45
|
Revision: 2487 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2487&view=rev Author: saamand Date: 2009-01-03 17:02:41 +0000 (Sat, 03 Jan 2009) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MyLyrics/LyricsEngine/LyricUtil.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 Configuration/MyLyricsSetup.resx trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricUtil.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricUtil.cs 2009-01-02 21:10:16 UTC (rev 2486) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricUtil.cs 2009-01-03 17:02:41 UTC (rev 2487) @@ -90,7 +90,6 @@ { lyrics = FixLyrics(lyrics); - if (find != null) { int valueIndex = 0; Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.cs 2009-01-02 21:10:16 UTC (rev 2486) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.cs 2009-01-03 17:02:41 UTC (rev 2487) @@ -768,7 +768,7 @@ { using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MediaPortal.xml")) { - if (xmlreader.GetValueAsBool("myLyrics", "automaticReadFromToMusicTag", true)) + if (xmlreader.GetValueAsBool("myLyrics", "automaticReadFromMusicTag", true)) { Search_Init(); SearchMusicTags(); Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs 2009-01-02 21:10:16 UTC (rev 2486) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs 2009-01-03 17:02:41 UTC (rev 2487) @@ -86,6 +86,7 @@ this.lbPluginName = new MediaPortal.UserInterface.Controls.MPLabel(); this.gbLyricSites = new MediaPortal.UserInterface.Controls.MPGroupBox(); this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.cbLyrDB = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.cbActionext = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.cbLyrics007 = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.cbLyricWiki = new MediaPortal.UserInterface.Controls.MPCheckBox(); @@ -107,7 +108,6 @@ 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(); @@ -760,6 +760,20 @@ this.groupBox2.TabStop = false; this.groupBox2.Text = "User select mode"; // + // 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); + // // cbActionext // this.cbActionext.AutoSize = true; @@ -995,20 +1009,6 @@ 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); Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.cs 2009-01-02 21:10:16 UTC (rev 2486) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.cs 2009-01-03 17:02:41 UTC (rev 2487) @@ -255,7 +255,7 @@ m_automaticWriteToMusicTag = xmlreader.GetValue("myLyrics", "automaticWriteToMusicTag").Equals("yes"); cbMusicTagWrite.Checked = m_automaticWriteToMusicTag; - m_automaticReadFromToMusicTag = xmlreader.GetValue("myLyrics", "automaticReadFromToMusicTag").Equals("yes"); + m_automaticReadFromToMusicTag = xmlreader.GetValue("myLyrics", "automaticReadFromMusicTag").Equals("yes"); cbMusicTagAlwaysCheck.Checked = m_automaticReadFromToMusicTag; lbSongsLimitNote.Text = ("(You have currently " + m_TotalTitles.ToString() + " titles in your music database)"); @@ -273,6 +273,8 @@ string[] replaceArray = m_replace.Split(','); int valueIndex = 0; + dbGridView.Rows.Clear(); + foreach (string findValue in findArray) { @@ -1112,7 +1114,7 @@ xmlwriter.SetValueAsBool("myLyrics", "automaticUpdateWhenFirstFound", cbAutomaticUpdate.Checked); xmlwriter.SetValueAsBool("myLyrics", "moveLyricFromMarkedDatabase", cbMoveSongFrom.Checked); xmlwriter.SetValueAsBool("myLyrics", "automaticWriteToMusicTag", cbMusicTagWrite.Checked); - xmlwriter.SetValueAsBool("myLyrics", "automaticReadFromToMusicTag", cbMusicTagAlwaysCheck.Checked); + xmlwriter.SetValueAsBool("myLyrics", "automaticReadFromMusicTag", cbMusicTagAlwaysCheck.Checked); m_automaticWriteToMusicTag = cbMusicTagWrite.Checked; m_automaticReadFromToMusicTag = cbMusicTagAlwaysCheck.Checked; Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.resx =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.resx 2009-01-02 21:10:16 UTC (rev 2486) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.resx 2009-01-03 17:02:41 UTC (rev 2487) @@ -123,12 +123,6 @@ <metadata name="Replace.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> - <metadata name="Find.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="Replace.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> <metadata name="bgWorkerSearch.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>6, 4</value> </metadata> Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2009-01-02 21:10:16 UTC (rev 2486) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2009-01-03 17:02:41 UTC (rev 2487) @@ -90,7 +90,8 @@ bool lyricsFound = false; - bool m_automaticWriteToMusicTag = true; + bool m_AutomaticWriteToMusicTag = true; + bool m_AutomaticReadFromMusicTag = true; String[] m_sitesToSearch; @@ -184,8 +185,6 @@ PlaylistPlayer = PlayListPlayer.SingletonPlayer; GetID = (int)GUIMyLyrics.WINDOW_MYLYRICS; - - GUIGraphicsContext.ResetLastActivity(); } public override bool Init() @@ -273,6 +272,8 @@ CalculateNextInterval(); } + //GUIGraphicsContext.ResetLastActivity(); + base.Process(); } @@ -347,7 +348,8 @@ 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"); + m_AutomaticWriteToMusicTag = xmlreader.GetValue("myLyrics", "automaticWriteToMusicTag").Equals("yes"); + m_AutomaticReadFromMusicTag = xmlreader.GetValue("myLyrics", "automaticReadFromMusicTag").Equals("yes"); skin = ((string)xmlreader.GetValueAsString("skin", "name", "Blue3")); @@ -560,7 +562,7 @@ m_LastLyricText = m_LyricText; m_LastFileName = CurrentTrackTag.FileName; - if (m_automaticWriteToMusicTag) + if (m_AutomaticWriteToMusicTag) { TagReaderUtil.WriteLyrics(m_LastFileName, m_LastLyricText); ; } @@ -653,7 +655,7 @@ } // 2) LRC in music tag or lyrics Database - if ((CurrentTrackTag.Lyrics.Length != 0 && (lrc = new SimpleLRC(m_artist, m_title, CurrentTrackTag.Lyrics)).IsValid) + if (m_AutomaticReadFromMusicTag && ((CurrentTrackTag.Lyrics.Length != 0 && (lrc = new SimpleLRC(m_artist, m_title, CurrentTrackTag.Lyrics)).IsValid)) || (lyricText.Length != 0 && (lrc = new SimpleLRC(m_artist, m_title, lyricText)).IsValid)) { lyricsFound = true; @@ -731,10 +733,11 @@ } // 3) Lyric in music tag - else if (CurrentTrackTag.Lyrics.Length != 0) + else if (m_AutomaticReadFromMusicTag && CurrentTrackTag.Lyrics.Length != 0) { CurrentTrackTag.Lyrics = LyricUtil.FixLyrics(CurrentTrackTag.Lyrics); ShowLyricOnScreen(CurrentTrackTag.Lyrics, CurrentTrackTag.FileName); + SaveLyricToDatabase(CurrentTrackTag.Artist, CurrentTrackTag.Title, "music tag"); } // 4) if lyric in music database @@ -956,10 +959,10 @@ } } - private void SaveLyricToDatabase(string site) + private void SaveLyricToDatabase(string artist, string title, string site) { - string capArtist = LyricUtil.CapatalizeString(m_artist); - string capTitle = LyricUtil.CapatalizeString(m_title); + string capArtist = LyricUtil.CapatalizeString(artist); + string capTitle = LyricUtil.CapatalizeString(title); if (DatabaseUtil.IsTrackInLyricsDatabase(LyricsDB, capArtist, capTitle).Equals(DatabaseUtil.LYRIC_NOT_FOUND)) { @@ -1320,7 +1323,7 @@ if (m_artist.Equals(artist) && m_title.Equals(title)) { ShowLyricOnScreen(lyricText, site); - SaveLyricToDatabase(site); + SaveLyricToDatabase(artist, title, site); } } } Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj 2009-01-02 21:10:16 UTC (rev 2486) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj 2009-01-03 17:02:41 UTC (rev 2487) @@ -5,7 +5,7 @@ <ProductVersion>9.0.21022</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{BBB2DAE2-0D83-4B4B-85B6-D1B5A7E10039}</ProjectGuid> - <OutputType>WinExe</OutputType> + <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>MyLyrics</RootNamespace> <AssemblyName>MyLyrics</AssemblyName> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2009-01-14 15:39:13
|
Revision: 2508 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2508&view=rev Author: saamand Date: 2009-01-14 15:39:02 +0000 (Wed, 14 Jan 2009) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs trunk/plugins/MyLyrics/change log.txt Added Paths: ----------- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Actionext.cs trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyrDB.cs trunk/plugins/MyLyrics/LyricsEngine/LyricsWebClient.cs trunk/plugins/MyLyrics/My Lyrics/change log.txt trunk/plugins/MyLyrics/Skin/Blue3wide/Media/ trunk/plugins/MyLyrics/Skin/Blue3wide/Media/hover_my lyrics.png trunk/plugins/MyLyrics/Skin/Xface/ trunk/plugins/MyLyrics/Skin/Xface/Media/ trunk/plugins/MyLyrics/Skin/Xface/Media/buttonNF_my lyrics.png trunk/plugins/MyLyrics/Skin/Xface/Media/button_my lyrics.png trunk/plugins/MyLyrics/Skin/Xface/Media/hover_my lyrics.png trunk/plugins/MyLyrics/Skin/Xface/myLyrics.xml Added: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Actionext.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Actionext.cs (rev 0) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Actionext.cs 2009-01-14 15:39:02 UTC (rev 2508) @@ -0,0 +1,155 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using System.Diagnostics; +using System.Net; +using System.Threading; +using System.Timers; + +namespace LyricsEngine.LyricSites +{ + class Actionext + { + string lyric = ""; + bool complete; + System.Timers.Timer timer; + int timeLimit; + + public string Lyric + { + get { return lyric; } + } + + public Actionext(string artist, string title, ManualResetEvent m_EventStop_SiteSearches, int timeLimit) + { + this.timeLimit = timeLimit; + timer = new System.Timers.Timer(); + + if (LyricDiagnostics.TraceSource != null) LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Information, 0, LyricDiagnostics.ElapsedTimeString() + "Actionext(" + artist + ", " + title + ")"); + + artist = LyricUtil.RemoveFeatComment(artist); + artist = LyricUtil.TrimForParenthesis(artist); + artist = artist.Replace(" ", "_"); + title = LyricUtil.RemoveFeatComment(title); + title = LyricUtil.TrimForParenthesis(title); + title = title.Replace(" ", "_"); + string urlString = "http://www.actionext.com/names_" + artist[0] + "/" + artist + "_lyrics/" + title + ".html"; + urlString = urlString.ToLower(); + + LyricsWebClient client = new LyricsWebClient(); + + timer.Enabled = true; + timer.Interval = timeLimit; + timer.Elapsed += new ElapsedEventHandler(timer_Elapsed); + timer.Start(); + + Uri uri = new Uri(urlString); + client.OpenReadCompleted += new System.Net.OpenReadCompletedEventHandler(callbackMethod); + client.OpenReadAsync(uri); + + while (complete == false) + { + if (m_EventStop_SiteSearches.WaitOne(1, true)) + { + complete = true; + } + else + { + System.Threading.Thread.Sleep(300); + } + } + } + + private void callbackMethod(object sender, OpenReadCompletedEventArgs e) + { + bool thisMayBeTheCorrectLyric = true; + StringBuilder lyricTemp = new StringBuilder(); + + LyricsWebClient client = (LyricsWebClient)sender; + Stream reply = null; + StreamReader sr = null; + + try + { + reply = (Stream)e.Result; + sr = new StreamReader(reply); + + string line = ""; + int noOfLinesCount = 0; + + while (line.IndexOf(@"<div class=""lyrics-text"">") == -1) + { + if (sr.EndOfStream || ++noOfLinesCount > 300) + { + thisMayBeTheCorrectLyric = false; + break; + } + else + { + line = sr.ReadLine(); + } + } + + if (thisMayBeTheCorrectLyric) + { + lyricTemp = new StringBuilder(); + line = sr.ReadLine(); + + while (line.IndexOf("</div>") == -1) + { + lyricTemp.Append(line); + if (sr.EndOfStream) + { + thisMayBeTheCorrectLyric = false; + break; + } + else + { + line = sr.ReadLine(); + } + } + + lyricTemp.Replace("<br>", Environment.NewLine); + lyricTemp.Replace(",<br />", Environment.NewLine); + lyricTemp.Replace("<br />", Environment.NewLine); + + lyric = lyricTemp.ToString().Trim(); + + if (lyric.Contains("but we do not have the lyrics")) + { + lyric = "Not found"; + } + } + } + catch + { + lyric = "Not found"; + } + finally + { + if (sr != null) + { + sr.Close(); + } + + if (reply != null) + { + reply.Close(); + } + complete = true; + } + } + + 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/LyricsEngine/LyricsSites/LyrDB.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyrDB.cs (rev 0) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyrDB.cs 2009-01-14 15:39:02 UTC (rev 2508) @@ -0,0 +1,187 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using System.Diagnostics; +using System.Net; +using System.Threading; +using System.Timers; + +namespace LyricsEngine.LyricSites +{ + class LyrDB + { + string lyric = ""; + bool complete; + System.Timers.Timer timer; + int timeLimit; + private ManualResetEvent m_EventStop_SiteSearches; + + public string Lyric + { + get { return lyric; } + } + + public LyrDB(string artist, string title, ManualResetEvent eventStop_SiteSearches, int timeLimit) + { + this.timeLimit = timeLimit; + timer = new System.Timers.Timer(); + + m_EventStop_SiteSearches = eventStop_SiteSearches; + + if (LyricDiagnostics.TraceSource != null) LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Information, 0, LyricDiagnostics.ElapsedTimeString() + "LyrDB(" + artist + ", " + title + ")"); + + artist = LyricUtil.RemoveFeatComment(artist); + artist = LyricUtil.TrimForParenthesis(artist); + title = LyricUtil.RemoveFeatComment(title); + title = LyricUtil.TrimForParenthesis(title); + //string urlString = string.Format("http://www.lyrdb.com/lookup.php?q={0}|{1}&for=match", artist, title); + string urlString = string.Format("http://webservices.lyrdb.com/lookup.php?q={0}%7c{1}&for=match", artist, title); + + + LyricsWebClient client = new LyricsWebClient(); + + timer.Enabled = true; + timer.Interval = timeLimit; + timer.Elapsed += new ElapsedEventHandler(timer_Elapsed); + timer.Start(); + + Uri uri = new Uri(urlString); + client.OpenReadCompleted += new System.Net.OpenReadCompletedEventHandler(CallbackMethodSearch); + client.OpenReadAsync(uri); + + while (complete == false) + { + if (m_EventStop_SiteSearches.WaitOne(1, true)) + { + complete = true; + } + else + { + System.Threading.Thread.Sleep(300); + } + } + } + + private void CallbackMethodSearch(object sender, OpenReadCompletedEventArgs e) + { + StringBuilder lyricTemp = new StringBuilder(); + + LyricsWebClient client = (LyricsWebClient)sender; + Stream reply = null; + StreamReader sr = null; + + string id = string.Empty; + + try + { + reply = (Stream)e.Result; + sr = new StreamReader(reply); + + string result = sr.ReadToEnd(); + + if (result.Equals("")) + { + lyric = "Not found"; + return; + } + + id = result.Substring(0, result.IndexOf(@"\")); + + string urlString = string.Format("http://www.lyrdb.com/getlyr.php?q={0}", id); + + LyricsWebClient client2 = new LyricsWebClient(); + + Uri uri = new Uri(urlString); + client2.OpenReadCompleted += new System.Net.OpenReadCompletedEventHandler(CallbackMethodGetLyric); + client2.OpenReadAsync(uri); + + while (complete == false) + { + if (m_EventStop_SiteSearches.WaitOne(1, true)) + { + complete = true; + } + else + { + System.Threading.Thread.Sleep(300); + } + } + } + catch + { + lyric = "Not found"; + } + finally + { + if (sr != null) + { + sr.Close(); + } + + if (reply != null) + { + reply.Close(); + } + } + } + + + private void CallbackMethodGetLyric(object sender, OpenReadCompletedEventArgs e) + { + StringBuilder lyricTemp = new StringBuilder(); + + LyricsWebClient client = (LyricsWebClient)sender; + Stream reply = null; + StreamReader sr = null; + + try + { + reply = (Stream)e.Result; + sr = new StreamReader(reply); + + lyric = sr.ReadToEnd().Trim(); + + //lyricTemp.Replace("<br>", Environment.NewLine); + //lyricTemp.Replace(",<br />", Environment.NewLine); + //lyricTemp.Replace("<br />", Environment.NewLine); + + //lyric = lyricTemp.ToString().Trim(); + + //if (lyric.Contains("but we do not have the lyrics")) + //{ + // lyric = "Not found"; + //} + } + catch + { + lyric = "Not found"; + } + finally + { + if (sr != null) + { + sr.Close(); + } + + if (reply != null) + { + reply.Close(); + } + complete = true; + } + } + + + 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/LyricsEngine/LyricsWebClient.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsWebClient.cs (rev 0) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsWebClient.cs 2009-01-14 15:39:02 UTC (rev 2508) @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Net; + +namespace LyricsEngine +{ + /// <summary> + /// Some sites need to send cookies and a valid User AGent, so we use this class to enable a cookie container. + /// </summary> + class LyricsWebClient : WebClient + { + private CookieContainer cookieContainer; + private string userAgent; + private int timeout; + + public CookieContainer CookieContainer + { + get { return cookieContainer; } + set { cookieContainer = value; } + } + + public string UserAgent + { + get { return userAgent; } + set { userAgent = value; } + } + + public int Timeout + { + get { return timeout; } + set { timeout = value; } + } + + public LyricsWebClient() + { + timeout = -1; + userAgent = @"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)"; + cookieContainer = new CookieContainer(); + } + + protected override WebRequest GetWebRequest(Uri address) + { + WebRequest request = base.GetWebRequest(address); + + if (request.GetType() == typeof(HttpWebRequest)) + { + ((HttpWebRequest)request).CookieContainer = cookieContainer; + ((HttpWebRequest)request).UserAgent = userAgent; + ((HttpWebRequest)request).Timeout = timeout; + } + + return request; + } + + } +} \ No newline at end of file Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2009-01-14 05:06:20 UTC (rev 2507) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2009-01-14 15:39:02 UTC (rev 2508) @@ -48,7 +48,7 @@ bool alreadyValidLRC = false; bool m_ValidLrcLyric = false; // A valid LRC-lyric always overwrites a normal lyric in both Lyrics db and music tag (if allowed) - bool m_OkToCallPreviousMenu = false; + //bool m_OkToCallPreviousMenu = false; private string CurrentThumbFileName = string.Empty; private MusicTag PreviousTrackTag = null; @@ -425,7 +425,7 @@ LoadSettings(); - m_OkToCallPreviousMenu = false; + //m_OkToCallPreviousMenu = false; LyricDiagnostics.OpenLog(MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Log, logName)); LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Start, 0, LyricDiagnostics.ElapsedTimeString() + "MyLyrics opens."); @@ -443,7 +443,6 @@ protected override void OnPageDestroy(int new_windowId) { - StopThread(); resetAll(); @@ -461,10 +460,10 @@ LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Stop, 0, LyricDiagnostics.ElapsedTimeString() + "MyLyrics closes."); // Is MP closing? If not call ShowPreviousWindow() - if (m_OkToCallPreviousMenu == true) - { - GUIWindowManager.ShowPreviousWindow(); - } + //if (m_OkToCallPreviousMenu == true) + //{ + // GUIWindowManager.ShowPreviousWindow(); + //} } @@ -474,9 +473,10 @@ { case Action.ActionType.ACTION_PREVIOUS_MENU: { - m_OkToCallPreviousMenu = true; - GUIWindowManager.ShowPreviousWindow(); - return; + //m_OkToCallPreviousMenu = true; + //GUIWindowManager.ShowPreviousWindow(); + //return; + break; } case Action.ActionType.ACTION_KEY_PRESSED: { Added: trunk/plugins/MyLyrics/My Lyrics/change log.txt =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/change log.txt (rev 0) +++ trunk/plugins/MyLyrics/My Lyrics/change log.txt 2009-01-14 15:39:02 UTC (rev 2508) @@ -0,0 +1,55 @@ +Release notes to MyLyrics 1.21 + +MyLyrics is a windows plugin for MediaPortal which enables the display of lyrics for the currently played music file inside MediaPortal. +The plugin is able show LRC and plain lyrics, and uses both musictags and online searches to find lyrics. + +Basic features: +* Dynamic search for the lyrics to currently playing music file. +* Browse your music database and select the songs for which you want to find lyrics. +* Batch search for lyrics matching songs in music database. +* Search single title and select amoung lyrics from various lyrics sites. +* Add/delete/edit lyrics and save changes in lyrics databases. +* Import/export lyrics to/from music tags. +* Include lyrics from the Internet, musictags, text- and lrc-files. +* Create a LRC from a basic lyric on the fly. + +Keys: +- W (or '#' button on remote): Toggle between basic and wide screen. +- E (or '*' button on remote): Toggle between lyric and editor screen. +- Enter (or 'OK' on remote): Tag line on LRC editor screen. + +Screens: +- Lyrics basic: shows lyric with coverart on the right (default lyrics screen). +- Lyrics wide: shows wider lyric area and no coverart. +- LRC basic: shows lrc file and coverart on the right (default lrc screen). +- LRC wide: shows wider lrc area and no coverart (the plugin autoselects this if the lrc contains one or more long lines). +- LRC editor: enables the creation of lrc lyric from a plain lyric. + +Compatible with MediaPortal 1.0.0.0 final. + +Installation: +Simple copy the content of the zip-file into your MP library (typical C:\Program Files\Team MediaPortal\MediaPortal). + +Noteworthy changes since version 1.10: +* Add: Support for the lyric site LyrDB. +* Add: On the Lyrics database tab you can choose to see only the LRCs of your lyrics database. +* Fix: Vertical black lines caused by use of "\r\n" in Label controls is eliminated by using "\n" instead. +* Fix: Show previous screen issue and back trace issues with MP fixed. +* Fix: Blue3 and Blue3wide skins optimized. + +Skin Support: +All supported skins (or at least the ones I'm aware of) are listed here: MyLyrics skin library + +For skinners: +Due to a change in the MP Gui engine in March 2008 all label controls need a <width> tag to be shown. +That means all controls of the type "label" must have the tag <width>x</width> where x is the width in pixels. +920 pixels is good value for most 16:9 skins. + +In short, the following controls must be updated with the tag <width>920</width>: +id: 200-212 +id: 300-312 +id: 400-412 +id: 500-512 +id: 600-612 + +The change is needed for the LRC and LRC editor modes to work. Added: trunk/plugins/MyLyrics/Skin/Blue3wide/Media/hover_my lyrics.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/MyLyrics/Skin/Blue3wide/Media/hover_my lyrics.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MyLyrics/Skin/Xface/Media/buttonNF_my lyrics.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/MyLyrics/Skin/Xface/Media/buttonNF_my lyrics.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MyLyrics/Skin/Xface/Media/button_my lyrics.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/MyLyrics/Skin/Xface/Media/button_my lyrics.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MyLyrics/Skin/Xface/Media/hover_my lyrics.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/MyLyrics/Skin/Xface/Media/hover_my lyrics.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MyLyrics/Skin/Xface/myLyrics.xml =================================================================== --- trunk/plugins/MyLyrics/Skin/Xface/myLyrics.xml (rev 0) +++ trunk/plugins/MyLyrics/Skin/Xface/myLyrics.xml 2009-01-14 15:39:02 UTC (rev 2508) @@ -0,0 +1,965 @@ +<window> + <id>90478</id> + <defaultcontrol>20</defaultcontrol> + <allowoverlay>no</allowoverlay> + <controls> + <control> + <type>image</type> + <description>background image</description> + <id>0</id> + <width>1366</width> + <height>768</height> + <texture>background.png</texture> + </control> + <control> + <type>label</type> + <description>Status</description> + <id>11</id> + <posX>110</posX> + <posY>100</posY> + <label>No media playing</label> + <font>font12</font> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>textbox</type> + <description>The Lyric area</description> + <id>20</id> + <posX>110</posX> + <posY>100</posY> + <width>760</width> + <height>520</height> + <onleft>2</onleft> + <onright>2</onright> + <onup>2</onup> + <ondown>2</ondown> + <image>icon-folder.png</image> + <label>-</label> + <seperator>----------------------------------------------------------------------------------------------</seperator> + <text>6</text> + <spinPosX>715</spinPosX> + <spinPosY>525</spinPosY> + </control> + <control> + <type>textbox</type> + <description>The Lyric area</description> + <id>21</id> + <posX>110</posX> + <posY>100</posY> + <width>1160</width> + <height>520</height> + <onleft>2</onleft> + <onright>2</onright> + <onup>2</onup> + <ondown>2</ondown> + <image>icon-folder.png</image> + <label>-</label> + <seperator>----------------------------------------------------------------------------------------------</seperator> + <text>6</text> + <spinPosX>715</spinPosX> + <spinPosY>525</spinPosY> + </control> + <control> + <id>0</id> + <type>image</type> + <posY>700</posY> + <height>89</height> + <width>1366</width> + <texture>Barback.png</texture> + <colorDiffuse>effffffff</colorDiffuse> + </control> + <control> + <id>0</id> + <type>image</type> + <posY>-20</posY> + <height>89</height> + <width>1366</width> + <texture>Barback.png</texture> + <colorDiffuse>effffffff</colorDiffuse> + </control> + <control> + <type>image</type> + <description>menu background image</description> + <id>0</id> + <posX>58</posX> + <posY>566</posY> + <width>1250</width> + <height>189</height> + <texture>-</texture> + <animation effect="fade" time="150">WindowOpen</animation> + </control> + <control> + <type>image</type> + <description>background hover image</description> + <id>0</id> + <posX>120</posX> + <posY>590</posY> + <width>155</width> + <height>145</height> + <texture>hover_my music1.png</texture> + <animation effect="fade" time="150">WindowOpen</animation> + </control> + <control> + <type>image</type> + <description>title image</description> + <id>0</id> + <posX>89</posX> + <posY>4</posY> + <width>220</width> + <height>55</height> + <texture>music_logo.png</texture> + <animation effect="fade" time="150">WindowOpen</animation> + </control> + <control> + <description>Grid</description> + <type>image</type> + <id>0</id> + <posX>0</posX> + <posY>0</posY> + <width>1366</width> + <height>768</height> + <texture>grid.png</texture> + <visible>no</visible> + <animation effect="fade" time="250">WindowOpen</animation> + <animation effect="fade" time="500">WindowClose</animation> + </control> + <control> + <type>image</type> + <description>nowplaying background</description> + <id>0</id> + <posX>886</posX> + <posY>56</posY> + <width>400</width> + <height>484</height> + <texture>-</texture> + <animation effect="fade" time="150">WindowOpen</animation> + </control> + <control> + <type>image</type> + <description>album art image</description> + <id>112</id> + <posX>908</posX> + <posY>100</posY> + <width>350</width> + <height>350</height> + <texture flipY="true" diffuse="Thumb_Mask.png">-</texture> + <centered>yes</centered> + <zoom>yes</zoom> + </control> + <control> + <type>fadelabel</type> + <description>track label</description> + <id>0</id> + <posX>382</posX> + <posY>592</posY> + <width>600</width> + <height>26</height> + <label>#Play.Current.Title</label> + <font>font16</font> + <textcolor>black</textcolor> + <animation effect="fade" time="150">WindowOpen</animation> + </control> + <control> + <type>fadelabel</type> + <description>track label</description> + <id>0</id> + <posX>382</posX> + <posY>626</posY> + <width>600</width> + <height>26</height> + <label>#Play.Current.Artist</label> + <textcolor>ff969696</textcolor> + <font>font16</font> + <animation effect="fade" time="150">WindowOpen</animation> + </control> + <control> + <type>fadelabel</type> + <description>track label</description> + <id>0</id> + <posX>382</posX> + <posY>662</posY> + <width>600</width> + <height>28</height> + <label>#Play.Current.Track</label> + <textcolor>ff969696</textcolor> + <font>font16</font> + <animation effect="fade" time="150">WindowOpen</animation> + </control> + <control> + <type>fadelabel</type> + <description>album label</description> + <id>0</id> + <posX>911</posX> + <posY>450</posY> + <width>300</width> + <label>#Play.Current.Album</label> + <font>font13</font> + <align>left</align> + <!-- <textcolor>white</textcolor> --> + <animation effect="fade" time="150">WindowOpen</animation> + </control> + <control> + <type>fadelabel</type> + <description>year label</description> + <id>0</id> + <posX>911</posX> + <posY>480</posY> + <width>150</width> + <label>#Play.Current.Year</label> + <font>font13</font> + <align>left</align> + <!-- <textcolor>white</textcolor> --> + <animation effect="fade" time="150">WindowOpen</animation> + </control> + <control> + <type>image</type> + <id>117</id> + <posX>907</posX> + <posY>520</posY> + <width>350</width> + <texture flipY="true" diffuse="Thumb_Mask.png">osd_progress_background2.png</texture> + <animation effect="fade" time="150">WindowOpen</animation> + </control> + <control> + <type>progress</type> + <description>track progress</description> + <id>118</id> + <posX>904</posX> + <posY>520</posY> + <width>360</width> + </control> + <control> + <type>label</type> + <description>track duration label</description> + <id>0</id> + <posX>1265</posX> + <posY>524</posY> + <label>#duration</label> + <font>font14</font> + <align>left</align> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>track progress label</description> + <id>0</id> + <posX>898</posX> + <posY>524</posY> + <label>#currentplaytime</label> + <font>font14</font> + <align>right</align> + <textcolor>80ffffff</textcolor> + <animation effect="fade" time="150">WindowOpen</animation> + </control> + <control> + <type>label</type> + <description>up next label</description> + <id>20</id> + <posX>1026</posX> + <posY>589</posY> + <label>4541</label> + <font>font14</font> + <align>right</align> + <textcolor>90010101</textcolor> + <animation effect="fade" time="150">WindowOpen</animation> + </control> + <control> + <type>fadelabel</type> + <description>next track label</description> + <id>121</id> + <posX>1050</posX> + <posY>589</posY> + <width>300</width> + <font>font14</font> + <label>#Play.Next.Title</label> + <textcolor>90010101</textcolor> + <animation effect="fade" time="150">WindowOpen</animation> + </control> + <control> + <type>fadelabel</type> + <description>next artist label</description> + <id>123</id> + <posX>1050</posX> + <posY>616</posY> + <width>300</width> + <label>#Play.Next.Artist</label> + <textcolor>ff969696</textcolor> + <animation effect="fade" time="150">WindowOpen</animation> + </control> + + + <control> + <type>label</type> + <description>line 0</description> + <id>400</id> + <posX>112</posX> + <posY>120</posY> + <colordiffuse>80ffffff</colordiffuse> + <label>line 0</label> + <width>1160</width> + <textcolor>80ffffff</textcolor> + <disabledcolor>ffffffff</disabledcolor> + </control> + <control> + <type>label</type> + <description>line 0</description> + <id>500</id> + <posX>112</posX> + <posY>120</posY> + <label>line 0</label> + <width>1160</width> + <textcolor>ffffffff</textcolor> + <disabledcolor>ffffffff</disabledcolor> + </control> + <control> + <type>label</type> + <description>line 1</description> + <id>401</id> + <posX>112</posX> + <posY>152</posY> + <label>line 1</label> + <width>1160</width> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 1</description> + <id>501</id> + <posX>112</posX> + <posY>152</posY> + <label>line 1</label> + <width>1160</width> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 2</description> + <id>402</id> + <posX>112</posX> + <posY>184</posY> + <label>line 2</label> + <width>1160</width> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 2</description> + <id>502</id> + <posX>112</posX> + <posY>184</posY> + <label>line 2</label> + <width>1160</width> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 3</description> + <id>403</id> + <posX>112</posX> + <posY>216</posY> + <label>line 3</label> + <width>1160</width> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 3</description> + <id>503</id> + <posX>112</posX> + <posY>216</posY> + <label>line 3</label> + <width>1160</width> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 4</description> + <id>404</id> + <posX>112</posX> + <posY>248</posY> + <label>line 4</label> + <width>1160</width> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 4</description> + <id>504</id> + <posX>112</posX> + <posY>248</posY> + <label>line 4</label> + <width>1160</width> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 5</description> + <id>405</id> + <posX>112</posX> + <posY>280</posY> + <label>line 5</label> + <width>1160</width> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 5</description> + <id>505</id> + <posX>112</posX> + <posY>280</posY> + <label>line 5</label> + <width>1160</width> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 6</description> + <id>406</id> + <posX>112</posX> + <posY>312</posY> + <label>line 6</label> + <width>1160</width> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 6</description> + <id>506</id> + <posX>112</posX> + <posY>312</posY> + <label>line 6</label> + <width>1160</width> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 7</description> + <id>407</id> + <posX>112</posX> + <posY>344</posY> + <label>line 7</label> + <width>1160</width> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 7</description> + <id>507</id> + <posX>112</posX> + <posY>344</posY> + <label>line 7</label> + <width>1160</width> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 8</description> + <id>408</id> + <posX>112</posX> + <posY>376</posY> + <label>line 8</label> + <width>1160</width> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 8</description> + <id>508</id> + <posX>112</posX> + <posY>376</posY> + <label>line 8</label> + <width>1160</width> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 9</description> + <id>409</id> + <posX>112</posX> + <posY>408</posY> + <label>line 9</label> + <width>1160</width> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 9</description> + <id>509</id> + <posX>112</posX> + <posY>408</posY> + <label>line 9</label> + <width>1160</width> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 10</description> + <id>410</id> + <posX>112</posX> + <posY>440</posY> + <label>line 10</label> + <width>1160</width> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 10</description> + <id>510</id> + <posX>112</posX> + <posY>440</posY> + <label>line 10</label> + <width>1160</width> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 11</description> + <id>411</id> + <posX>112</posX> + <posY>472</posY> + <label>line 11</label> + <width>1160</width> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 11</description> + <id>511</id> + <posX>112</posX> + <posY>472</posY> + <label>line 11</label> + <width>1160</width> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 12</description> + <id>412</id> + <posX>112</posX> + <posY>504</posY> + <label>line 12</label> + <width>1160</width> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 12</description> + <id>512</id> + <posX>112</posX> + <posY>504</posY> + <label>line 12</label> + <width>1160</width> + <textcolor>ffffffff</textcolor> + </control> + + + <control> + <type>label</type> + <description>line 0</description> + <id>200</id> + <posX>112</posX> + <posY>120</posY> + <colordiffuse>80ffffff</colordiffuse> + <label>line 0</label> + <width>1160</width> + <textcolor>80ffffff</textcolor> + <disabledcolor>ffffffff</disabledcolor> + </control> + <control> + <type>label</type> + <description>line 0</description> + <id>300</id> + <posX>112</posX> + <posY>120</posY> + <label>line 0</label> + <width>1160</width> + <textcolor>ffffffff</textcolor> + <disabledcolor>ffffffff</disabledcolor> + </control> + <control> + <type>label</type> + <description>line 1</description> + <id>201</id> + <posX>112</posX> + <posY>152</posY> + <label>line 1</label> + <width>1160</width> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 1</description> + <id>301</id> + <posX>112</posX> + <posY>152</posY> + <label>line 1</label> + <width>1160</width> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 2</description> + <id>202</id> + <posX>112</posX> + <posY>184</posY> + <label>line 2</label> + <width>1160</width> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 2</description> + <id>302</id> + <posX>112</posX> + <posY>184</posY> + <label>line 2</label> + <width>1160</width> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 3</description> + <id>203</id> + <posX>112</posX> + <posY>216</posY> + <label>line 3</label> + <width>1160</width> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 3</description> + <id>303</id> + <posX>112</posX> + <posY>216</posY> + <label>line 3</label> + <width>1160</width> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 4</description> + <id>204</id> + <posX>112</posX> + <posY>248</posY> + <label>line 4</label> + <width>1160</width> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 4</description> + <id>304</id> + <posX>112</posX> + <posY>248</posY> + <label>line 4</label> + <width>1160</width> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 5</description> + <id>205</id> + <posX>112</posX> + <posY>280</posY> + <label>line 5</label> + <width>1160</width> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 5</description> + <id>305</id> + <posX>112</posX> + <posY>280</posY> + <label>line 5</label> + <width>1160</width> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 6</description> + <id>206</id> + <posX>112</posX> + <posY>312</posY> + <label>line 6</label> + <width>1160</width> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 6</description> + <id>306</id> + <posX>112</posX> + <posY>312</posY> + <label>line 6</label> + <width>1160</width> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 7</description> + <id>207</id> + <posX>112</posX> + <posY>344</posY> + <label>line 7</label> + <width>1160</width> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 7</description> + <id>307</id> + <posX>112</posX> + <posY>344</posY> + <label>line 7</label> + <width>1160</width> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 8</description> + <id>208</id> + <posX>112</posX> + <posY>376</posY> + <label>line 8</label> + <width>1160</width> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 8</description> + <id>308</id> + <posX>112</posX> + <posY>376</posY> + <label>line 8</label> + <width>1160</width> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 9</description> + <id>209</id> + <posX>112</posX> + <posY>408</posY> + <label>line 9</label> + <width>1160</width> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 9</description> + <id>309</id> + <posX>112</posX> + <posY>408</posY> + <label>line 9</label> + <width>1160</width> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 10</description> + <id>210</id> + <posX>112</posX> + <posY>440</posY> + <label>line 10</label> + <width>1160</width> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 10</description> + <id>310</id> + <posX>112</posX> + <posY>440</posY> + <label>line 10</label> + <width>1160</width> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 11</description> + <id>211</id> + <posX>112</posX> + <posY>472</posY> + <label>line 11</label> + <width>1160</width> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 11</description> + <id>311</id> + <posX>112</posX> + <posY>472</posY> + <label>line 11</label> + <width>1160</width> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 12</description> + <id>212</id> + <posX>112</posX> + <posY>504</posY> + <label>line 12</label> + <width>1160</width> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>line 12</description> + <id>312</id> + <posX>112</posX> + <posY>504</posY> + <label>line 12</label> + <width>1160</width> + <textcolor>ffffffff</textcolor> + </control> + + + <control> + <type>label</type> + <description>time 0</description> + <id>600</id> + <posX>16</posX> + <posY>124</posY> + <label>(xx:xx:xx)</label> + <font>font10</font> + <width>1160</width> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>time 1</description> + <id>601</id> + <posX>16</posX> + <posY>156</posY> + <label>(xx:xx:xx)</label> + <font>font10</font> + <width>1160</width> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>time 2</description> + <id>602</id> + <posX>16</posX> + <posY>188</posY> + <label>(xx:xx:xx)</label> + <font>font10</font> + <width>1160</width> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>time 3</description> + <id>603</id> + <posX>16</posX> + <posY>220</posY> + <label>(xx:xx:xx)</label> + <font>font10</font> + <width>1160</width> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>time 4</description> + <id>604</id> + <posX>16</posX> + <posY>252</posY> + <label>(xx:xx:xx)</label> + <font>font10</font> + <width>1160</width> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>time 5</description> + <id>605</id> + <posX>16</posX> + <posY>284</posY> + <label>(xx:xx:xx)</label> + <font>font10</font> + <width>1160</width> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>time 6</description> + <id>606</id> + <posX>16</posX> + <posY>316</posY> + <label>(xx:xx:xx)</label> + <font>font10</font> + <width>1160</width> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>time 7</description> + <id>607</id> + <posX>16</posX> + <posY>348</posY> + <label>(xx:xx:xx)</label> + <font>font10</font> + <width>1160</width> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>time 8</description> + <id>608</id> + <posX>16</posX> + <posY>380</posY> + <label>(xx:xx:xx)</label> + <font>font10</font> + <width>1160</width> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>time 9</description> + <id>609</id> + <posX>16</posX> + <posY>412</posY> + <label>(xx:xx:xx)</label> + <font>font10</font> + <width>1160</width> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>time 10</description> + <id>610</id> + <posX>16</posX> + <posY>444</posY> + <label>(xx:xx:xx)</label> + <font>font10</font> + <width>1160</width> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>time 11</description> + <id>611</id> + <posX>16</posX> + <posY>476</posY> + <label>(xx:xx:xx)</label> + <font>font10</font> + <width>1160</width> + <textcolor>80ffffff</textcolor> + </control> + <control> + <type>label</type> + <description>time 12</description> + <id>612</id> + <posX>16</posX> + <posY>508</posY> + <label>(xx:xx:xx)</label> + <font>font10</font> + <width>1160</width> + <textcolor>80ffffff</textcolor> + </control> + </controls> +</window> Modified: trunk/plugins/MyLyrics/change log.txt =================================================================== --- trunk/plugins/MyLyrics/change log.txt 2009-01-14 05:06:20 UTC (rev 2507) +++ trunk/plugins/MyLyrics/change log.txt 2009-01-14 15:39:02 UTC (rev 2508) @@ -1,7 +1,55 @@ -Changes since MyLyrics 1.1 RC -- Add: A find & replace feature has been added (thanks to Jupek) -(- Fix: Browse-search and batch-search now also checks the music tag for a lyric before an online search takes place) -(- Fix: LRC's are never overwritten with a plain lyric in neither music tags nor the lyrics database) -- Fix: LRC and normal lyrics are always properly saved to music tag (if option set in configuration) -- Fix: Show previous window functionality works -- Fix: All options (also the one for the hit ratio slidebar) is properly saved +Release notes to MyLyrics 1.21 + +MyLyrics is a windows plugin for MediaPortal which enables the display of lyrics for the currently played music file inside MediaPortal. +The plugin is able show LRC and plain lyrics, and uses both musictags and online searches to find lyrics. + +Basic features: +* Dynamic search for the lyrics to currently playing music file. +* Browse your music database and select the songs for which you want to find lyrics. +* Batch search for lyrics matching songs in music database. +* Search single title and select amoung lyrics from various lyrics sites. +* Add/delete/edit lyrics and save changes in lyrics databases. +* Import/export lyrics to/from music tags. +* Include lyrics from the Internet, musictags, text- and lrc-files. +* Create a LRC from a basic lyric on the fly. + +Keys: +- W (or '#' button on remote): Toggle between basic and wide screen. +- E (or '*' button on remote): Toggle between lyric and editor screen. +- Enter (or 'OK' on remote): Tag line on LRC editor screen. + +Screens: +- Lyrics basic: shows lyric with coverart on the right (default lyrics screen). +- Lyrics wide: shows wider lyric area and no coverart. +- LRC basic: shows lrc file and coverart on the right (default lrc screen). +- LRC wide: shows wider lrc area and no coverart (the plugin autoselects this if the lrc contains one or more long lines). +- LRC editor: enables the creation of lrc lyric from a plain lyric. + +Compatible with MediaPortal 1.0.0.0 final. + +Installation: +Simple copy the content of the zip-file into your MP library (typical C:\Program Files\Team MediaPortal\MediaPortal). + +Noteworthy changes since version 1.10: +* Add: Support for the lyric site LyrDB. +* Add: On the Lyrics database tab you can choose to see only the LRCs of your lyrics database. +* Fix: Vertical black lines caused by use of "\r\n" in Label controls is eliminated by using "\n" instead. +* Fix: Show previous screen issue and back trace issues with MP fixed. +* Fix: Blue3 and Blue3wide skins optimized. + +Skin Support: +All supported skins (or at least the ones I'm aware of) are listed here: MyLyrics skin library + +For skinners: +Due to a change in the MP Gui engine in March 2008 all label controls need a <width> tag to be shown. +That means all controls of the type "label" must have the tag <width>x</width> where x is the width in pixels. +920 pixels is good value for most 16:9 skins. + +In short, the following controls must be updated with the tag <width>920</width>: +id: 200-212 +id: 300-312 +id: 400-412 +id: 500-512 +id: 600-612 + +The change is needed for the LRC and LRC editor modes to work. \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2009-03-19 19:06:59
|
Revision: 2730 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2730&view=rev Author: saamand Date: 2009-03-19 19:06:55 +0000 (Thu, 19 Mar 2009) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MyLyrics/LyricsEngine/Properties/AssemblyInfo.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.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 Configuration/MyLyricsSetup.resx trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs trunk/plugins/MyLyrics/My Lyrics/MyLyricsSettings.cs trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs Added Paths: ----------- trunk/plugins/MyLyrics/UpgradeLog.XML trunk/plugins/MyLyrics/_UpgradeReport_Files/ trunk/plugins/MyLyrics/temp/ Modified: trunk/plugins/MyLyrics/LyricsEngine/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/Properties/AssemblyInfo.cs 2009-03-18 21:09:21 UTC (rev 2729) +++ trunk/plugins/MyLyrics/LyricsEngine/Properties/AssemblyInfo.cs 2009-03-19 19:06:55 UTC (rev 2730) @@ -26,7 +26,7 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.20")] +[assembly: AssemblyVersion("1.22")] // // In order to sign your assembly you must specify a key to use. Refer to the Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs 2009-03-18 21:09:21 UTC (rev 2729) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs 2009-03-19 19:06:55 UTC (rev 2730) @@ -80,7 +80,7 @@ this.lbInfo1.Name = "lbInfo1"; this.lbInfo1.Size = new System.Drawing.Size(197, 18); this.lbInfo1.TabIndex = 3; - this.lbInfo1.Text = "MyLyrics plugin, version 1.20"; + this.lbInfo1.Text = "MyLyrics plugin, version 1.22"; // // label2 // Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs 2009-03-18 21:09:21 UTC (rev 2729) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs 2009-03-19 19:06:55 UTC (rev 2730) @@ -74,6 +74,11 @@ this.lbLyricsFound2 = new MediaPortal.UserInterface.Controls.MPLabel(); this.lbLyricsFound = new MediaPortal.UserInterface.Controls.MPLabel(); this.tabPageSetup = new MediaPortal.UserInterface.Controls.MPTabPage(); + this.gbGUI = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.tbLyricsLimit = new MediaPortal.UserInterface.Controls.MPTextBox(); + this.cbAutoChangeToLineLimit = new MediaPortal.UserInterface.Controls.MPCheckBox(); + this.lblyricLengthLimit = new MediaPortal.UserInterface.Controls.MPLabel(); + this.cbUseAutoScrollAsDefault = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.gbTag = new MediaPortal.UserInterface.Controls.MPGroupBox(); this.cbMusicTagAlwaysCheck = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.cbMusicTagWrite = new MediaPortal.UserInterface.Controls.MPCheckBox(); @@ -116,6 +121,7 @@ this.gbProgress.SuspendLayout(); this.gbMusicDBSearchStats.SuspendLayout(); this.tabPageSetup.SuspendLayout(); + this.gbGUI.SuspendLayout(); this.gbTag.SuspendLayout(); this.mpGroupBox3.SuspendLayout(); this.mpGroupBox2.SuspendLayout(); @@ -597,6 +603,7 @@ // // tabPageSetup // + this.tabPageSetup.Controls.Add(this.gbGUI); this.tabPageSetup.Controls.Add(this.gbTag); this.tabPageSetup.Controls.Add(this.mpGroupBox3); this.tabPageSetup.Controls.Add(this.mpGroupBox2); @@ -609,14 +616,79 @@ this.tabPageSetup.Text = "Settings"; this.tabPageSetup.UseVisualStyleBackColor = true; // + // gbGUI + // + this.gbGUI.Controls.Add(this.tbLyricsLimit); + this.gbGUI.Controls.Add(this.cbAutoChangeToLineLimit); + this.gbGUI.Controls.Add(this.lblyricLengthLimit); + this.gbGUI.Controls.Add(this.cbUseAutoScrollAsDefault); + this.gbGUI.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.gbGUI.Location = new System.Drawing.Point(5, 235); + this.gbGUI.Name = "gbGUI"; + this.gbGUI.Size = new System.Drawing.Size(538, 83); + this.gbGUI.TabIndex = 33; + this.gbGUI.TabStop = false; + this.gbGUI.Text = "Gui settings"; + // + // tbLyricsLimit + // + this.tbLyricsLimit.BorderColor = System.Drawing.Color.Empty; + this.tbLyricsLimit.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.tbLyricsLimit.Location = new System.Drawing.Point(141, 61); + this.tbLyricsLimit.MaximumSize = new System.Drawing.Size(24, 14); + this.tbLyricsLimit.MaxLength = 30; + this.tbLyricsLimit.MinimumSize = new System.Drawing.Size(24, 14); + this.tbLyricsLimit.Name = "tbLyricsLimit"; + this.tbLyricsLimit.RightToLeft = System.Windows.Forms.RightToLeft.Yes; + this.tbLyricsLimit.Size = new System.Drawing.Size(24, 14); + this.tbLyricsLimit.TabIndex = 15; + this.tbLyricsLimit.Text = "45"; + this.tbLyricsLimit.Leave += new System.EventHandler(this.WriteMediaPortalXML); + // + // cbAutoChangeToLineLimit + // + this.cbAutoChangeToLineLimit.AutoSize = true; + this.cbAutoChangeToLineLimit.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.cbAutoChangeToLineLimit.Location = new System.Drawing.Point(16, 42); + this.cbAutoChangeToLineLimit.Name = "cbAutoChangeToLineLimit"; + this.cbAutoChangeToLineLimit.Size = new System.Drawing.Size(443, 17); + this.cbAutoChangeToLineLimit.TabIndex = 7; + this.cbAutoChangeToLineLimit.Text = "Automatic change from LRC basic to LRC wide mode when lyric line length limit is " + + "passed"; + this.cbAutoChangeToLineLimit.UseVisualStyleBackColor = true; + this.cbAutoChangeToLineLimit.Leave += new System.EventHandler(this.WriteMediaPortalXML); + this.cbAutoChangeToLineLimit.CheckedChanged += new System.EventHandler(this.cbGuiLayout_CheckedChanged); + // + // lblyricLengthLimit + // + this.lblyricLengthLimit.AutoSize = true; + this.lblyricLengthLimit.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblyricLengthLimit.Location = new System.Drawing.Point(38, 62); + this.lblyricLengthLimit.Name = "lblyricLengthLimit"; + this.lblyricLengthLimit.Size = new System.Drawing.Size(103, 13); + this.lblyricLengthLimit.TabIndex = 16; + this.lblyricLengthLimit.Text = "Lyric line length limit:"; + // + // cbUseAutoScrollAsDefault + // + this.cbUseAutoScrollAsDefault.AutoSize = true; + this.cbUseAutoScrollAsDefault.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.cbUseAutoScrollAsDefault.Location = new System.Drawing.Point(16, 19); + this.cbUseAutoScrollAsDefault.Name = "cbUseAutoScrollAsDefault"; + this.cbUseAutoScrollAsDefault.Size = new System.Drawing.Size(169, 17); + this.cbUseAutoScrollAsDefault.TabIndex = 6; + this.cbUseAutoScrollAsDefault.Text = "Use autoscroll mode as default"; + this.cbUseAutoScrollAsDefault.UseVisualStyleBackColor = true; + this.cbUseAutoScrollAsDefault.Leave += new System.EventHandler(this.WriteMediaPortalXML); + // // gbTag // this.gbTag.Controls.Add(this.cbMusicTagAlwaysCheck); this.gbTag.Controls.Add(this.cbMusicTagWrite); this.gbTag.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.gbTag.Location = new System.Drawing.Point(4, 265); + this.gbTag.Location = new System.Drawing.Point(5, 324); this.gbTag.Name = "gbTag"; - this.gbTag.Size = new System.Drawing.Size(538, 66); + this.gbTag.Size = new System.Drawing.Size(538, 52); this.gbTag.TabIndex = 31; this.gbTag.TabStop = false; this.gbTag.Text = "Music tags"; @@ -627,9 +699,9 @@ this.cbMusicTagAlwaysCheck.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.cbMusicTagAlwaysCheck.Location = new System.Drawing.Point(17, 20); this.cbMusicTagAlwaysCheck.Name = "cbMusicTagAlwaysCheck"; - this.cbMusicTagAlwaysCheck.Size = new System.Drawing.Size(278, 17); + this.cbMusicTagAlwaysCheck.Size = new System.Drawing.Size(216, 17); this.cbMusicTagAlwaysCheck.TabIndex = 7; - this.cbMusicTagAlwaysCheck.Text = "Always check music tag for lyrics before online search"; + this.cbMusicTagAlwaysCheck.Text = "Always use lyric in music tag (if available)"; this.cbMusicTagAlwaysCheck.UseVisualStyleBackColor = true; this.cbMusicTagAlwaysCheck.Leave += new System.EventHandler(this.WriteMediaPortalXML); // @@ -637,7 +709,7 @@ // this.cbMusicTagWrite.AutoSize = true; this.cbMusicTagWrite.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.cbMusicTagWrite.Location = new System.Drawing.Point(17, 43); + this.cbMusicTagWrite.Location = new System.Drawing.Point(274, 20); this.cbMusicTagWrite.Name = "cbMusicTagWrite"; this.cbMusicTagWrite.Size = new System.Drawing.Size(203, 17); this.cbMusicTagWrite.TabIndex = 6; @@ -651,7 +723,7 @@ this.mpGroupBox3.Controls.Add(this.cbMoveSongFrom); this.mpGroupBox3.Controls.Add(this.cbAutoFetch); this.mpGroupBox3.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.mpGroupBox3.Location = new System.Drawing.Point(5, 337); + this.mpGroupBox3.Location = new System.Drawing.Point(5, 382); this.mpGroupBox3.Name = "mpGroupBox3"; this.mpGroupBox3.Size = new System.Drawing.Size(538, 92); this.mpGroupBox3.TabIndex = 30; @@ -739,7 +811,7 @@ this.gbLyricSites.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.gbLyricSites.Location = new System.Drawing.Point(5, 70); this.gbLyricSites.Name = "gbLyricSites"; - this.gbLyricSites.Size = new System.Drawing.Size(538, 189); + this.gbLyricSites.Size = new System.Drawing.Size(538, 159); this.gbLyricSites.TabIndex = 28; this.gbLyricSites.TabStop = false; this.gbLyricSites.Text = "Lyrics sites settings"; @@ -753,7 +825,7 @@ this.groupBox2.Controls.Add(this.cbLyricsOnDemand); this.groupBox2.Controls.Add(this.cbHotLyrics); this.groupBox2.Controls.Add(this.cbSeekLyrics); - this.groupBox2.Location = new System.Drawing.Point(229, 72); + this.groupBox2.Location = new System.Drawing.Point(229, 48); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(301, 100); this.groupBox2.TabIndex = 28; @@ -863,7 +935,7 @@ this.groupBox1.Controls.Add(this.mpLabel2); this.groupBox1.Controls.Add(this.trackBar); this.groupBox1.Controls.Add(this.lbSpeed); - this.groupBox1.Location = new System.Drawing.Point(6, 72); + this.groupBox1.Location = new System.Drawing.Point(6, 48); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(217, 100); this.groupBox1.TabIndex = 27; @@ -919,7 +991,7 @@ // rbUserDefined // this.rbUserDefined.AutoSize = true; - this.rbUserDefined.Location = new System.Drawing.Point(16, 46); + this.rbUserDefined.Location = new System.Drawing.Point(150, 23); this.rbUserDefined.Name = "rbUserDefined"; this.rbUserDefined.Size = new System.Drawing.Size(107, 17); this.rbUserDefined.TabIndex = 22; @@ -1036,6 +1108,8 @@ this.gbProgress.ResumeLayout(false); this.gbMusicDBSearchStats.ResumeLayout(false); this.tabPageSetup.ResumeLayout(false); + this.gbGUI.ResumeLayout(false); + this.gbGUI.PerformLayout(); this.gbTag.ResumeLayout(false); this.gbTag.PerformLayout(); this.mpGroupBox3.ResumeLayout(false); @@ -1139,5 +1213,10 @@ internal MediaPortal.UserInterface.Controls.MPCheckBox cbMusicTagAlwaysCheck; private MediaPortal.UserInterface.Controls.MPCheckBox cbDisregardSongWithLyricInTag; internal MediaPortal.UserInterface.Controls.MPCheckBox cbLyrDB; + private MediaPortal.UserInterface.Controls.MPGroupBox gbGUI; + private MediaPortal.UserInterface.Controls.MPTextBox tbLyricsLimit; + internal MediaPortal.UserInterface.Controls.MPCheckBox cbAutoChangeToLineLimit; + private MediaPortal.UserInterface.Controls.MPLabel lblyricLengthLimit; + internal MediaPortal.UserInterface.Controls.MPCheckBox cbUseAutoScrollAsDefault; } } \ 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 2009-03-18 21:09:21 UTC (rev 2729) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.cs 2009-03-19 19:06:55 UTC (rev 2730) @@ -258,6 +258,10 @@ m_automaticReadFromToMusicTag = xmlreader.GetValue("myLyrics", "automaticReadFromMusicTag").Equals("yes"); cbMusicTagAlwaysCheck.Checked = m_automaticReadFromToMusicTag; + cbUseAutoScrollAsDefault.Checked = xmlreader.GetValue("myLyrics", "useAutoscroll").Equals("yes"); + cbAutoChangeToLineLimit.Checked = xmlreader.GetValue("myLyrics", "useAutoOnLyricLength").Equals("yes"); + tbLyricsLimit.Text = xmlreader.GetValueAsString("myLyrics", "AutoLyricLength", "45"); + lbSongsLimitNote.Text = ("(You have currently " + m_TotalTitles.ToString() + " titles in your music database)"); trackBar.Value = ((int)xmlreader.GetValueAsInt("myLyrics", "defaultSitesModeValue", 2)); @@ -266,6 +270,8 @@ m_find = xmlreader.GetValueAsString("myLyrics", "find", ""); m_replace = xmlreader.GetValueAsString("myLyrics", "replace", ""); + tbLyricsLimit.Enabled = cbAutoChangeToLineLimit.Checked; + if (m_find != "") { @@ -1110,6 +1116,9 @@ xmlwriter.SetValue("myLyrics", "useLyricsOnDemand", cbLyricsOnDemand.Checked.ToString()); xmlwriter.SetValue("myLyrics", "useSeekLyrics", cbSeekLyrics.Checked.ToString()); xmlwriter.SetValue("myLyrics", "useHotLyrics", cbHotLyrics.Checked.ToString()); + xmlwriter.SetValueAsBool("myLyrics", "useAutoscroll", cbUseAutoScrollAsDefault.Checked); + xmlwriter.SetValueAsBool("myLyrics", "useAutoOnLyricLength", cbAutoChangeToLineLimit.Checked); + xmlwriter.SetValue("myLyrics", "AutoLyricLength", tbLyricsLimit.Text); xmlwriter.SetValueAsBool("myLyrics", "automaticFetch", cbAutoFetch.Checked); xmlwriter.SetValueAsBool("myLyrics", "automaticUpdateWhenFirstFound", cbAutomaticUpdate.Checked); xmlwriter.SetValueAsBool("myLyrics", "moveLyricFromMarkedDatabase", cbMoveSongFrom.Checked); @@ -1152,5 +1161,18 @@ } } + + + private void cbGuiLayout_CheckedChanged(object sender, EventArgs e) + { + if (cbAutoChangeToLineLimit.Checked) + { + tbLyricsLimit.Enabled = true; + } + else + { + tbLyricsLimit.Enabled = false; + } + } } } \ No newline at end of file Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.resx =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.resx 2009-03-18 21:09:21 UTC (rev 2729) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.resx 2009-03-19 19:06:55 UTC (rev 2730) @@ -123,6 +123,12 @@ <metadata name="Replace.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> + <metadata name="Find.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </metadata> + <metadata name="Replace.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </metadata> <metadata name="bgWorkerSearch.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>6, 4</value> </metadata> Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2009-03-18 21:09:21 UTC (rev 2729) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2009-03-19 19:06:55 UTC (rev 2730) @@ -41,6 +41,8 @@ private Nullable<bool> basicScreenSelected = null; string lyricsScreenXML = "MyLyrics.xml"; + int startingScrollSpeedVertical; + string skin = ""; bool exitingMyLyrics = false; @@ -101,6 +103,10 @@ internal const string LyricsDBName = "LyricsDatabaseV2.db"; internal const string LyricsMarkedDBName = "LyricsMarkedDatabaseV2.db"; internal string logName = "MyLyrics.log"; + + internal int CONTROL_LYRIC_SELECTED = 20; + internal int CONTROL_LYRICWIDE_SELECTED = 21; + #endregion #region GUI enums @@ -122,7 +128,9 @@ enum GUI_Lyrics_Controls { CONTROL_Lyric = 20, - CONTROL_LyricWide = 21 + CONTROL_LyricWide = 21, + CONTROL_Lyric_Scroll = 1020, + CONTROL_LyricWide_Scroll = 1021 } enum GUI_LRC_Controls : int @@ -155,7 +163,10 @@ #region Fields related to LRC mode - internal const int BASIC_WIDE_LIMIT = 45; + internal bool m_useAutoScrollAsDefault = false; + internal bool m_useAutoOnLyricLength = false; + internal int m_basicWideLimit = 45; + SimpleLRC lrc; SimpleLRCTimeAndLineCollection lrcTimeCollection; Stopwatch stopwatch; @@ -190,6 +201,10 @@ public override bool Init() { selectedScreen = (int)MyLyricsSettings.Screen.LYRICS_BASIC; + + startingScrollSpeedVertical = GUIGraphicsContext.ScrollSpeedVertical; + GUIGraphicsContext.ScrollSpeedVertical = 0; + return Load(GUIGraphicsContext.Skin + @"\" + lyricsScreenXML); } @@ -315,7 +330,7 @@ } else { - lines = m_LyricText.Split(new string[1] { "\r\n" }, StringSplitOptions.None); + lines = m_LyricText.Split(new string[2] { "\r\n", "\n" }, StringSplitOptions.None); try { @@ -351,6 +366,10 @@ m_AutomaticWriteToMusicTag = xmlreader.GetValue("myLyrics", "automaticWriteToMusicTag").Equals("yes"); m_AutomaticReadFromMusicTag = xmlreader.GetValue("myLyrics", "automaticReadFromMusicTag").Equals("yes"); + m_useAutoScrollAsDefault = ((string)xmlreader.GetValueAsString("myLyrics", "useAutoscroll", "True")).ToString().Equals("yes") ? true : false; + m_useAutoOnLyricLength = ((string)xmlreader.GetValueAsString("myLyrics", "useAutoOnLyricLength", "False")).ToString().Equals("yes") ? true : false; + m_basicWideLimit = xmlreader.GetValueAsInt("myLyrics", "AutoLyricLength", 45); + skin = ((string)xmlreader.GetValueAsString("skin", "name", "Blue3")); m_crossfade = xmlreader.GetValueAsInt("audioplayer", "crossfade", 2000); @@ -359,6 +378,24 @@ m_Replace = xmlreader.GetValueAsString("myLyrics", "replace", ""); } + if (m_useAutoScrollAsDefault) + { + CONTROL_LYRIC_SELECTED = (int)GUI_Lyrics_Controls.CONTROL_Lyric_Scroll; + CONTROL_LYRICWIDE_SELECTED = (int)GUI_Lyrics_Controls.CONTROL_LyricWide_Scroll; + + GUIControl.HideControl(GetID, (int)GUI_Lyrics_Controls.CONTROL_Lyric); + GUIControl.HideControl(GetID, (int)GUI_Lyrics_Controls.CONTROL_LyricWide); + } + else + { + CONTROL_LYRIC_SELECTED = (int)GUI_Lyrics_Controls.CONTROL_Lyric; + CONTROL_LYRICWIDE_SELECTED = (int)GUI_Lyrics_Controls.CONTROL_LyricWide; + + GUIControl.HideControl(GetID, (int)GUI_Lyrics_Controls.CONTROL_Lyric_Scroll); + GUIControl.HideControl(GetID, (int)GUI_Lyrics_Controls.CONTROL_LyricWide_Scroll); + } + + m_strippedPrefixStrings = MediaPortalUtil.GetStrippedPrefixStringArray(); ArrayList sitesToSearch = new ArrayList(); @@ -446,6 +483,8 @@ StopThread(); resetAll(); + GUIGraphicsContext.ScrollSpeedVertical = startingScrollSpeedVertical; + if (m_WriteTagTimer != null) { m_WriteTagTimer.Stop(); @@ -507,15 +546,15 @@ { basicScreenSelected = false; resetGUI((int)MyLyricsSettings.Screen.LYRICS_WIDE); - GUIControl.SetControlLabel(GetID, (int)GUI_Lyrics_Controls.CONTROL_LyricWide, m_LyricText); - GUIControl.FocusControl(GetID, (int)GUI_Lyrics_Controls.CONTROL_LyricWide); + GUIControl.SetControlLabel(GetID, CONTROL_LYRICWIDE_SELECTED, m_LyricText); + GUIControl.FocusControl(GetID, CONTROL_LYRICWIDE_SELECTED); } else if (selectedScreen == (int)MyLyricsSettings.Screen.LYRICS_WIDE) { basicScreenSelected = true; resetGUI((int)MyLyricsSettings.Screen.LYRICS_BASIC); - GUIControl.SetControlLabel(GetID, (int)GUI_Lyrics_Controls.CONTROL_Lyric, m_LyricText); - GUIControl.FocusControl(GetID, (int)GUI_Lyrics_Controls.CONTROL_Lyric); + GUIControl.SetControlLabel(GetID, CONTROL_LYRIC_SELECTED, m_LyricText); + GUIControl.FocusControl(GetID, CONTROL_LYRIC_SELECTED); } else if (selectedScreen == (int)MyLyricsSettings.Screen.LRC_BASIC) { @@ -528,6 +567,21 @@ findLyric(); } } + else if (action.m_key.KeyChar.Equals(115)) + { + if (GUIGraphicsContext.ScrollSpeedVertical >= 10 + || GUIGraphicsContext.ScrollSpeedVertical == 1 + || GUIGraphicsContext.ScrollSpeedVertical == 3 + || GUIGraphicsContext.ScrollSpeedVertical == 5) + { + GUIGraphicsContext.ScrollSpeedVertical = 0; + } + else + { + ++GUIGraphicsContext.ScrollSpeedVertical; + ++GUIGraphicsContext.ScrollSpeedVertical; + } + } break; } case Action.ActionType.ACTION_REWIND: @@ -624,10 +678,10 @@ { m_EventStopThread.Reset(); - GUIControl.ClearControl(GetID, (int)GUI_Lyrics_Controls.CONTROL_Lyric); - GUIControl.SetControlLabel(GetID, (int)GUI_Lyrics_Controls.CONTROL_Lyric, ""); - GUIControl.ClearControl(GetID, (int)GUI_Lyrics_Controls.CONTROL_LyricWide); - GUIControl.SetControlLabel(GetID, (int)GUI_Lyrics_Controls.CONTROL_LyricWide, ""); + GUIControl.ClearControl(GetID, CONTROL_LYRIC_SELECTED); + GUIControl.SetControlLabel(GetID, CONTROL_LYRIC_SELECTED, ""); + GUIControl.ClearControl(GetID, CONTROL_LYRICWIDE_SELECTED); + GUIControl.SetControlLabel(GetID, CONTROL_LYRICWIDE_SELECTED, ""); if (CurrentTrackTag != null && CurrentTrackTag.Artist != "") { @@ -666,12 +720,15 @@ //Let's see if the basic or wide version of the LRC-screen should be shown bool aLongLinePresent = false; - for (int i = 0; i < lines.Length; i++) + if (m_useAutoOnLyricLength) { - if (lines[i].Length > BASIC_WIDE_LIMIT) + for (int i = 0; i < lines.Length; i++) { - aLongLinePresent = true; - break; + if (lines[i].Length > m_basicWideLimit) + { + aLongLinePresent = true; + break; + } } } @@ -945,14 +1002,14 @@ if (basicScreenSelected.HasValue == false || basicScreenSelected.Value) { resetGUI((int)MyLyricsSettings.Screen.LYRICS_BASIC); - GUIControl.SetControlLabel(GetID, (int)GUI_Lyrics_Controls.CONTROL_Lyric, m_LyricText); - GUIControl.FocusControl(GetID, (int)GUI_Lyrics_Controls.CONTROL_Lyric); + GUIControl.SetControlLabel(GetID, CONTROL_LYRIC_SELECTED, m_LyricText); + GUIControl.FocusControl(GetID, CONTROL_LYRIC_SELECTED); } else { resetGUI((int)MyLyricsSettings.Screen.LYRICS_WIDE); - GUIControl.SetControlLabel(GetID, (int)GUI_Lyrics_Controls.CONTROL_LyricWide, m_LyricText); - GUIControl.FocusControl(GetID, (int)GUI_Lyrics_Controls.CONTROL_LyricWide); + GUIControl.SetControlLabel(GetID, CONTROL_LYRICWIDE_SELECTED, m_LyricText); + GUIControl.FocusControl(GetID, CONTROL_LYRICWIDE_SELECTED); } @@ -1039,29 +1096,28 @@ private void resetGUI(int screenID) { - if ((skin.Equals("ReVision") || skin.Equals("Replicant")) && - (screenID == (int)MyLyricsSettings.Screen.LYRICS_WIDE || screenID == (int)MyLyricsSettings.Screen.LRC_WIDE || screenID == (int)MyLyricsSettings.Screen.LRC_EDITOR)) - { - GUIControl.HideControl(GetID, (int)GUI_General_Controls.CONTROL_UPNEXT); - GUIControl.HideControl(GetID, (int)GUI_General_Controls.CONTROL_ALBUM); - GUIControl.HideControl(GetID, (int)GUI_General_Controls.CONTROL_YEAR); - GUIControl.HideControl(GetID, (int)GUI_General_Controls.CONTROL_TRACKTITLE); - GUIControl.HideControl(GetID, (int)GUI_General_Controls.CONTROL_TRACKARTIST); - GUIControl.HideControl(GetID, (int)GUI_General_Controls.CONTROL_NUMBERDURATION); - GUIControl.HideControl(GetID, (int)GUI_General_Controls.CONTROL_NEXTTRACK); - GUIControl.HideControl(GetID, (int)GUI_General_Controls.CONTROL_NEXTARTIST); - } - else - { - GUIControl.ShowControl(GetID, (int)GUI_General_Controls.CONTROL_UPNEXT); - GUIControl.ShowControl(GetID, (int)GUI_General_Controls.CONTROL_ALBUM); - GUIControl.ShowControl(GetID, (int)GUI_General_Controls.CONTROL_YEAR); - GUIControl.ShowControl(GetID, (int)GUI_General_Controls.CONTROL_TRACKTITLE); - GUIControl.ShowControl(GetID, (int)GUI_General_Controls.CONTROL_TRACKARTIST); - GUIControl.ShowControl(GetID, (int)GUI_General_Controls.CONTROL_NUMBERDURATION); - GUIControl.ShowControl(GetID, (int)GUI_General_Controls.CONTROL_NEXTTRACK); - GUIControl.ShowControl(GetID, (int)GUI_General_Controls.CONTROL_NEXTARTIST); - } + //if ((screenID == (int)MyLyricsSettings.Screen.LYRICS_WIDE || screenID == (int)MyLyricsSettings.Screen.LRC_WIDE || screenID == (int)MyLyricsSettings.Screen.LRC_EDITOR)) + //{ + // GUIControl.HideControl(GetID, (int)GUI_General_Controls.CONTROL_UPNEXT); + // GUIControl.HideControl(GetID, (int)GUI_General_Controls.CONTROL_ALBUM); + // GUIControl.HideControl(GetID, (int)GUI_General_Controls.CONTROL_YEAR); + // GUIControl.HideControl(GetID, (int)GUI_General_Controls.CONTROL_TRACKTITLE); + // GUIControl.HideControl(GetID, (int)GUI_General_Controls.CONTROL_TRACKARTIST); + // GUIControl.HideControl(GetID, (int)GUI_General_Controls.CONTROL_NUMBERDURATION); + // GUIControl.HideControl(GetID, (int)GUI_General_Controls.CONTROL_NEXTTRACK); + // GUIControl.HideControl(GetID, (int)GUI_General_Controls.CONTROL_NEXTARTIST); + //} + //else + //{ + // GUIControl.ShowControl(GetID, (int)GUI_General_Controls.CONTROL_UPNEXT); + // GUIControl.ShowControl(GetID, (int)GUI_General_Controls.CONTROL_ALBUM); + // GUIControl.ShowControl(GetID, (int)GUI_General_Controls.CONTROL_YEAR); + // GUIControl.ShowControl(GetID, (int)GUI_General_Controls.CONTROL_TRACKTITLE); + // GUIControl.ShowControl(GetID, (int)GUI_General_Controls.CONTROL_TRACKARTIST); + // GUIControl.ShowControl(GetID, (int)GUI_General_Controls.CONTROL_NUMBERDURATION); + // GUIControl.ShowControl(GetID, (int)GUI_General_Controls.CONTROL_NEXTTRACK); + // GUIControl.ShowControl(GetID, (int)GUI_General_Controls.CONTROL_NEXTARTIST); + //} int prevSelectedScreen = selectedScreen; selectedScreen = screenID; @@ -1076,15 +1132,15 @@ GUIControl.SetControlLabel(GetID, (int)GUI_General_Controls.CONTROL_TITLE, "Lyrics basic"); - GUIControl.ClearControl(GetID, (int)GUI_Lyrics_Controls.CONTROL_Lyric); - GUIControl.FocusControl(GetID, (int)GUI_Lyrics_Controls.CONTROL_Lyric); + GUIControl.ClearControl(GetID, CONTROL_LYRIC_SELECTED); + GUIControl.FocusControl(GetID, CONTROL_LYRIC_SELECTED); // Reset general and lyrics controls GUIControl.ShowControl(GetID, (int)GUI_General_Controls.CONTROL_LBStatus); - GUIControl.ShowControl(GetID, (int)GUI_Lyrics_Controls.CONTROL_Lyric); - GUIControl.SetControlLabel(GetID, (int)GUI_Lyrics_Controls.CONTROL_Lyric, ""); - GUIControl.HideControl(GetID, (int)GUI_Lyrics_Controls.CONTROL_LyricWide); - GUIControl.SetControlLabel(GetID, (int)GUI_Lyrics_Controls.CONTROL_LyricWide, ""); + GUIControl.ShowControl(GetID, CONTROL_LYRIC_SELECTED); + GUIControl.SetControlLabel(GetID, CONTROL_LYRIC_SELECTED, ""); + GUIControl.HideControl(GetID, CONTROL_LYRICWIDE_SELECTED); + GUIControl.SetControlLabel(GetID, CONTROL_LYRICWIDE_SELECTED, ""); // album art only visible for basic screen GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_CURRENTLY); @@ -1116,30 +1172,28 @@ GUIControl.SetControlLabel(GetID, (int)GUI_General_Controls.CONTROL_TITLE, "Lyrics wide"); - GUIControl.ClearControl(GetID, (int)GUI_Lyrics_Controls.CONTROL_LyricWide); - GUIControl.FocusControl(GetID, (int)GUI_Lyrics_Controls.CONTROL_LyricWide); + GUIControl.ClearControl(GetID, CONTROL_LYRICWIDE_SELECTED); + GUIControl.FocusControl(GetID, CONTROL_LYRICWIDE_SELECTED); // Reset general and lyrics controls GUIControl.ShowControl(GetID, (int)GUI_General_Controls.CONTROL_LBStatus); //GUIControl.SetControlLabel(GetID, (int)GUI_General_Controls.CONTROL_LBStatus, ""); - GUIControl.HideControl(GetID, (int)GUI_Lyrics_Controls.CONTROL_Lyric); - GUIControl.SetControlLabel(GetID, (int)GUI_Lyrics_Controls.CONTROL_Lyric, ""); - GUIControl.ShowControl(GetID, (int)GUI_Lyrics_Controls.CONTROL_LyricWide); - GUIControl.SetControlLabel(GetID, (int)GUI_Lyrics_Controls.CONTROL_LyricWide, ""); + GUIControl.HideControl(GetID, CONTROL_LYRIC_SELECTED); + GUIControl.SetControlLabel(GetID, CONTROL_LYRIC_SELECTED, ""); + GUIControl.ShowControl(GetID, CONTROL_LYRICWIDE_SELECTED); + GUIControl.SetControlLabel(GetID, CONTROL_LYRICWIDE_SELECTED, ""); - // album art only visible for lyrics_basic screen AND also for Xface skin - if (!skin.Equals("Xface")) - { - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_CURRENTLY); - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_DURATION); - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_ALBUM); - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_YEAR); - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_NOWPLAYINGBACK); - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_ALBUMART); - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_PROGRESS); - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_PROGRESSIMAGE); - } + // album art only visible for lyrics_basic screen + GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_CURRENTLY); + GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_DURATION); + GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_ALBUM); + GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_YEAR); + GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_NOWPLAYINGBACK); + GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_ALBUMART); + GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_PROGRESS); + GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_PROGRESSIMAGE); + // Hide LRC controls GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_TAGBUTTON); @@ -1163,8 +1217,8 @@ // Lyrics controls GUIControl.ShowControl(GetID, (int)GUI_General_Controls.CONTROL_LBStatus); GUIControl.SetControlLabel(GetID, (int)GUI_General_Controls.CONTROL_LBStatus, ""); - GUIControl.HideControl(GetID, (int)GUI_Lyrics_Controls.CONTROL_Lyric); - GUIControl.HideControl(GetID, (int)GUI_Lyrics_Controls.CONTROL_LyricWide); + GUIControl.HideControl(GetID, CONTROL_LYRIC_SELECTED); + GUIControl.HideControl(GetID, CONTROL_LYRICWIDE_SELECTED); // album art only visible for basic screen GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_CURRENTLY); @@ -1204,21 +1258,18 @@ // Lyrics controls GUIControl.ShowControl(GetID, (int)GUI_General_Controls.CONTROL_LBStatus); GUIControl.SetControlLabel(GetID, (int)GUI_General_Controls.CONTROL_LBStatus, ""); - GUIControl.HideControl(GetID, (int)GUI_Lyrics_Controls.CONTROL_Lyric); - GUIControl.HideControl(GetID, (int)GUI_Lyrics_Controls.CONTROL_LyricWide); + GUIControl.HideControl(GetID, CONTROL_LYRIC_SELECTED); + GUIControl.HideControl(GetID, CONTROL_LYRICWIDE_SELECTED); - // album art only visible for lyrics_basic screen AND also for Xface skin - if (!skin.Equals("Xface")) - { - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_CURRENTLY); - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_DURATION); - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_ALBUM); - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_YEAR); - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_NOWPLAYINGBACK); - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_ALBUMART); - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_PROGRESS); - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_PROGRESSIMAGE); - } + // album art only visible for lyrics_basic screen AND + GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_CURRENTLY); + GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_DURATION); + GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_ALBUM); + GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_YEAR); + GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_NOWPLAYINGBACK); + GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_ALBUMART); + GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_PROGRESS); + GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_PROGRESSIMAGE); // LRC controls GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_TAGBUTTON); @@ -1253,21 +1304,18 @@ // Lyrics controls GUIControl.ShowControl(GetID, (int)GUI_General_Controls.CONTROL_LBStatus); GUIControl.SetControlLabel(GetID, (int)GUI_General_Controls.CONTROL_LBStatus, ""); - GUIControl.HideControl(GetID, (int)GUI_Lyrics_Controls.CONTROL_Lyric); - GUIControl.HideControl(GetID, (int)GUI_Lyrics_Controls.CONTROL_LyricWide); + GUIControl.HideControl(GetID, CONTROL_LYRIC_SELECTED); + GUIControl.HideControl(GetID, CONTROL_LYRICWIDE_SELECTED); - // album art only visible for lyrics_basic screen AND also for Xface skin - if (!skin.Equals("Xface")) - { - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_CURRENTLY); - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_DURATION); - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_ALBUM); - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_YEAR); - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_NOWPLAYINGBACK); - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_ALBUMART); - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_PROGRESS); - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_PROGRESSIMAGE); - } + // album art only visible for lyrics_basic screen + GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_CURRENTLY); + GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_DURATION); + GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_ALBUM); + GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_YEAR); + GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_NOWPLAYINGBACK); + GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_ALBUMART); + GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_PROGRESS); + GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_PROGRESSIMAGE); // LRC controls GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_TAGBUTTON); Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyricsSettings.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyricsSettings.cs 2009-03-18 21:09:21 UTC (rev 2729) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyricsSettings.cs 2009-03-19 19:06:55 UTC (rev 2730) @@ -9,11 +9,12 @@ internal enum Screen : int { - LYRICS_BASIC = 0, - LYRICS_WIDE = 1, - LRC_BASIC = 2, - LRC_WIDE = 3, - LRC_EDITOR = 4 + LYRICS_AUTO = 0, + LYRICS_BASIC = 1, + LYRICS_WIDE = 2, + LRC_BASIC = 3, + LRC_WIDE = 4, + LRC_EDITOR = 5 } // Database settings Modified: trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs 2009-03-18 21:09:21 UTC (rev 2729) +++ trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs 2009-03-19 19:06:55 UTC (rev 2730) @@ -31,5 +31,5 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.20")] -[assembly: AssemblyFileVersion("1.20")] +[assembly: AssemblyVersion("1.22")] +[assembly: AssemblyFileVersion("1.22")] Added: trunk/plugins/MyLyrics/UpgradeLog.XML =================================================================== --- trunk/plugins/MyLyrics/UpgradeLog.XML (rev 0) +++ trunk/plugins/MyLyrics/UpgradeLog.XML 2009-03-19 19:06:55 UTC (rev 2730) @@ -0,0 +1,88 @@ +<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type='text/xsl' href='_UpgradeReport_Files/UpgradeReport.xslt'?><UpgradeLog> +<Properties><Property Name="Solution" Value="MyLyrics"> +</Property><Property Name="Solution File" Value="C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\MyLyrics.sln"> +</Property><Property Name="User Options File" Value="C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\MyLyrics.suo"> +</Property><Property Name="Date" Value="21. oktober 2008"> +</Property><Property Name="Time" Value="18:15"> +</Property></Properties><Event ErrorLevel="0" Project="" Source="MyLyrics.sln" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\MyLyrics.sln"> +</Event><Event ErrorLevel="0" Project="" Source="MyLyrics.suo" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\MyLyrics.suo"> +</Event><Event ErrorLevel="0" Project="LyricsEngine" Source="LyricsEngine\LyricsEngine.csproj" Description="Project file successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\LyricsEngine\LyricsEngine.csproj"> +</Event><Event ErrorLevel="0" Project="LyricsEngine" Source="LyricsEngine\LyricsEngine.csproj.user" Description="Project user file successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\LyricsEngine\LyricsEngine.csproj.user"> +</Event><Event ErrorLevel="0" Project="LyricsEngine" Source="LyricsEngine\LRC\SimpleLRC.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\LyricsEngine\LRC\SimpleLRC.cs"> +</Event><Event ErrorLevel="0" Project="LyricsEngine" Source="LyricsEngine\LRC\SimpleLRCFormat.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\LyricsEngine\LRC\SimpleLRCFormat.cs"> +</Event><Event ErrorLevel="0" Project="LyricsEngine" Source="LyricsEngine\LRC\SimpleLRCTimeAndLine.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\LyricsEngine\LRC\SimpleLRCTimeAndLine.cs"> +</Event><Event ErrorLevel="0" Project="LyricsEngine" Source="LyricsEngine\LRC\SimpleLRCTimeAndLineCollection.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\LyricsEngine\LRC\SimpleLRCTimeAndLineCollection.cs"> +</Event><Event ErrorLevel="0" Project="LyricsEngine" Source="LyricsEngine\LyricsDatabase\LyricsDatabase.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\LyricsEngine\LyricsDatabase\LyricsDatabase.cs"> +</Event><Event ErrorLevel="0" Project="LyricsEngine" Source="LyricsEngine\LyricsDatabase\LyricsItem.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\LyricsEngine\LyricsDatabase\LyricsItem.cs"> +</Event><Event ErrorLevel="0" Project="LyricsEngine" Source="LyricsEngine\LyricSearch.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\LyricsEngine\LyricSearch.cs"> +</Event><Event ErrorLevel="0" Project="LyricsEngine" Source="LyricsEngine\LyricDiagnostics.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\LyricsEngine\LyricDiagnostics.cs"> +</Event><Event ErrorLevel="0" Project="LyricsEngine" Source="LyricsEngine\LyricsSites\Actionext.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\LyricsEngine\LyricsSites\Actionext.cs"> +</Event><Event ErrorLevel="0" Project="LyricsEngine" Source="LyricsEngine\LyricsSites\HotLyrics.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\LyricsEngine\LyricsSites\HotLyrics.cs"> +</Event><Event ErrorLevel="0" Project="LyricsEngine" Source="LyricsEngine\LyricsSites\EvilLabs.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\LyricsEngine\LyricsSites\EvilLabs.cs"> +</Event><Event ErrorLevel="0" Project="LyricsEngine" Source="LyricsEngine\LyricsSites\Lyrics007.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\LyricsEngine\LyricsSites\Lyrics007.cs"> +</Event><Event ErrorLevel="0" Project="LyricsEngine" Source="LyricsEngine\LyricsSites\LyricsOnDemand.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\LyricsEngine\LyricsSites\LyricsOnDemand.cs"> +</Event><Event ErrorLevel="0" Project="LyricsEngine" Source="LyricsEngine\LyricsSites\SeekLyrics.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\LyricsEngine\LyricsSites\SeekLyrics.cs"> +</Event><Event ErrorLevel="0" Project="LyricsEngine" Source="LyricsEngine\Properties\AssemblyInfo.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\LyricsEngine\Properties\AssemblyInfo.cs"> +</Event><Event ErrorLevel="0" Project="LyricsEngine" Source="LyricsEngine\ICommand.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\LyricsEngine\ICommand.cs"> +</Event><Event ErrorLevel="0" Project="LyricsEngine" Source="LyricsEngine\ILyricForm.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\LyricsEngine\ILyricForm.cs"> +</Event><Event ErrorLevel="0" Project="LyricsEngine" Source="LyricsEngine\LyricsController.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\LyricsEngine\LyricsController.cs"> +</Event><Event ErrorLevel="0" Project="LyricsEngine" Source="LyricsEngine\LyricUtil.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\LyricsEngine\LyricUtil.cs"> +</Event><Event ErrorLevel="0" Project="LyricsEngine" Source="LyricsEngine\Properties\Resources.Designer.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\LyricsEngine\Properties\Resources.Designer.cs"> +</Event><Event ErrorLevel="0" Project="LyricsEngine" Source="LyricsEngine\Properties\Settings.Designer.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\LyricsEngine\Properties\Settings.Designer.cs"> +</Event><Event ErrorLevel="0" Project="LyricsEngine" Source="LyricsEngine\Setup.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\LyricsEngine\Setup.cs"> +</Event><Event ErrorLevel="0" Project="LyricsEngine" Source="LyricsEngine\Web References\org.lyricwiki\Reference.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\LyricsEngine\Web References\org.lyricwiki\Reference.cs"> +</Event><Event ErrorLevel="0" Project="LyricsEngine" Source="LyricsEngine\LyricsSites\Wiki.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\LyricsEngine\LyricsSites\Wiki.cs"> +</Event><Event ErrorLevel="0" Project="LyricsEngine" Source="LyricsEngine\app.config" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\LyricsEngine\app.config"> +</Event><Event ErrorLevel="0" Project="LyricsEngine" Source="LyricsEngine\Properties\Settings.settings" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\LyricsEngine\Properties\Settings.settings"> +</Event><Event ErrorLevel="0" Project="LyricsEngine" Source="LyricsEngine\Web References\org.lyricwiki\LyricsResult.datasource" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\LyricsEngine\Web References\org.lyricwiki\LyricsResult.datasource"> +</Event><Event ErrorLevel="0" Project="LyricsEngine" Source="LyricsEngine\Web References\org.lyricwiki\Reference.map" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\LyricsEngine\Web References\org.lyricwiki\Reference.map"> +</Event><Event ErrorLevel="0" Project="LyricsEngine" Source="LyricsEngine\Web References\org.lyricwiki\server.wsdl" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\LyricsEngine\Web References\org.lyricwiki\server.wsdl"> +</Event><Event ErrorLevel="0" Project="LyricsEngine" Source="LyricsEngine\Web References\org.lyricwiki\SongResult.datasource" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\LyricsEngine\Web References\org.lyricwiki\SongResult.datasource"> +</Event><Event ErrorLevel="0" Project="LyricsEngine" Source="LyricsEngine\Web References\org.lyricwiki\SOTDResult.datasource" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\LyricsEngine\Web References\org.lyricwiki\SOTDResult.datasource"> +</Event><Event ErrorLevel="0" Project="LyricsEngine" Source="LyricsEngine\Properties\Resources.resx" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\LyricsEngine\Properties\Resources.resx"> +</Event><Event ErrorLevel="0" Project="LyricsEngine" Source="LyricsEngine\LyricsEngine.csproj" Description="Project converted successfully"> +</Event><Event ErrorLevel="3" Project="LyricsEngine" Source="LyricsEngine\LyricsEngine.csproj" Description="Converted"> +</Event><Event ErrorLevel="0" Project="MyLyrics" Source="My Lyrics\MyLyrics.csproj" Description="Project file successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\My Lyrics\MyLyrics.csproj"> +</Event><Event ErrorLevel="0" Project="MyLyrics" Source="My Lyrics\MyLyrics.csproj.user" Description="Project user file successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\My Lyrics\MyLyrics.csproj.user"> +</Event><Event ErrorLevel="0" Project="MyLyrics" Source="My Lyrics\Convert\ConvertFromXMLtoLyricsDatabase.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\My Lyrics\Convert\ConvertFromXMLtoLyricsDatabase.cs"> +</Event><Event ErrorLevel="0" Project="MyLyrics" Source="My Lyrics\MediaPortalUtil.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\My Lyrics\MediaPortalUtil.cs"> +</Event><Event ErrorLevel="0" Project="MyLyrics" Source="My Lyrics\MyLyrics Configuration\ExportTags.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\My Lyrics\MyLyrics Configuration\ExportTags.cs"> +</Event><Event ErrorLevel="0" Project="MyLyrics" Source="My Lyrics\MyLyrics Configuration\ExportTags.Designer.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\My Lyrics\MyLyrics Configuration\ExportTags.Designer.cs"> +</Event><Event ErrorLevel="0" Project="MyLyrics" Source="My Lyrics\MyLyrics Configuration\ImportTags.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\My Lyrics\MyLyrics Configuration\ImportTags.cs"> +</Event><Event ErrorLevel="0" Project="MyLyrics" Source="My Lyrics\MyLyrics Configuration\ImportTags.Designer.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\My Lyrics\MyLyrics Configuration\ImportTags.Designer.cs"> +</Event><Event ErrorLevel="0" Project="MyLyrics" Source="My Lyrics\MyLyrics Configuration\About.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\My Lyrics\MyLyrics Configuration\About.cs"> +</Event><Event ErrorLevel="0" Project="MyLyrics" Source="My Lyrics\MyLyrics Configuration\About.Designer.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\My Lyrics\MyLyrics Configuration\About.Designer.cs"> +</Event><Event ErrorLevel="0" Project="MyLyrics" Source="My Lyrics\MyLyrics Configuration\MusicDatabaseBrowse.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\My Lyrics\MyLyrics Configuration\MusicDatabaseBrowse.cs"> +</Event><Event ErrorLevel="0" Project="MyLyrics" Source="My Lyrics\MyLyrics Configuration\MusicDatabaseBrowse.Designer.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\My Lyrics\MyLyrics Configuration\MusicDatabaseBrowse.Designer.cs"> +</Event><Event ErrorLevel="0" Project="MyLyrics" Source="My Lyrics\MyLyricsExternCode.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\My Lyrics\MyLyricsExternCode.cs"> +</Event><Event ErrorLevel="0" Project="MyLyrics" Source="My Lyrics\MyLyricsSettings.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\My Lyrics\MyLyricsSettings.cs"> +</Event><Event ErrorLevel="0" Project="MyLyrics" Source="My Lyrics\MyLyrics Configuration\MyLyricsSetup_test.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\My Lyrics\MyLyrics Configuration\MyLyricsSetup_test.cs"> +</Event><Event ErrorLevel="0" Project="MyLyrics" Source="My Lyrics\DatabaseUtil.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\My Lyrics\DatabaseUtil.cs"> +</Event><Event ErrorLevel="0" Project="MyLyrics" Source="My Lyrics\MyLyrics.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\My Lyrics\MyLyrics.cs"> +</Event><Event ErrorLevel="0" Project="MyLyrics" Source="My Lyrics\MyLyrics Configuration\MyLyricsSetup.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\My Lyrics\MyLyrics Configuration\MyLyricsSetup.cs"> +</Event><Event ErrorLevel="0" Project="MyLyrics" Source="My Lyrics\MyLyrics Configuration\MyLyricsSetup.Designer.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\My Lyrics\MyLyrics Configuration\MyLyricsSetup.Designer.cs"> +</Event><Event ErrorLevel="0" Project="MyLyrics" Source="My Lyrics\MyLyrics Configuration\AddNewSong.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\My Lyrics\MyLyrics Configuration\AddNewSong.cs"> +</Event><Event ErrorLevel="0" Project="MyLyrics" Source="My Lyrics\MyLyrics Configuration\AddNewSong.Designer.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\My Lyrics\MyLyrics Configuration\AddNewSong.Designer.cs"> +</Event><Event ErrorLevel="0" Project="MyLyrics" Source="My Lyrics\Properties\AssemblyInfo.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\My Lyrics\Properties\AssemblyInfo.cs"> +</Event><Event ErrorLevel="0" Project="MyLyrics" Source="My Lyrics\MyLyrics Configuration\LyricsLibrary.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\My Lyrics\MyLyrics Configuration\LyricsLibrary.cs"> +</Event><Event ErrorLevel="0" Project="MyLyrics" Source="My Lyrics\MyLyrics Configuration\LyricsLibrary.Designer.cs" Description="File successfully backed up as C:\Users\saamand\Documents\Visual Studio 2008\Projects\MyLyrics\Backup\My Lyrics\MyLyrics Configuration\LyricsLibrary.Designer.cs"> +</Ev... [truncated message content] |
From: <sa...@us...> - 2009-03-29 12:10:38
|
Revision: 2749 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2749&view=rev Author: saamand Date: 2009-03-29 12:10:32 +0000 (Sun, 29 Mar 2009) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Actionext.cs trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/HotLyrics.cs trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyrDB.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/LyricsEngine/LyricsSites/Wiki.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/FindLyric.Designer.cs Removed Paths: ------------- trunk/plugins/MyLyrics/Skin/BlueTwo/ trunk/plugins/MyLyrics/Skin/BlueTwo wide/ trunk/plugins/MyLyrics/Skin/Xface/ Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Actionext.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Actionext.cs 2009-03-29 11:25:14 UTC (rev 2748) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Actionext.cs 2009-03-29 12:10:32 UTC (rev 2749) @@ -73,7 +73,7 @@ try { reply = (Stream)e.Result; - sr = new StreamReader(reply); + sr = new StreamReader(reply, Encoding.Default); string line = ""; int noOfLinesCount = 0; Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/HotLyrics.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/HotLyrics.cs 2009-03-29 11:25:14 UTC (rev 2748) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/HotLyrics.cs 2009-03-29 12:10:32 UTC (rev 2749) @@ -127,7 +127,7 @@ try { reply = (Stream)e.Result; - sr = new StreamReader(reply); + sr = new StreamReader(reply, Encoding.Default); string line = ""; Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyrDB.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyrDB.cs 2009-03-29 11:25:14 UTC (rev 2748) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyrDB.cs 2009-03-29 12:10:32 UTC (rev 2749) @@ -76,7 +76,7 @@ try { reply = (Stream)e.Result; - sr = new StreamReader(reply); + sr = new StreamReader(reply, Encoding.Default); string result = sr.ReadToEnd(); @@ -138,10 +138,12 @@ try { reply = (Stream)e.Result; - sr = new StreamReader(reply); + sr = new StreamReader(reply, Encoding.Default); lyric = sr.ReadToEnd().Trim(); + lyric = lyric.Replace("*", ""); + //lyricTemp.Replace("<br>", Environment.NewLine); //lyricTemp.Replace(",<br />", Environment.NewLine); //lyricTemp.Replace("<br />", Environment.NewLine); Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Lyrics007.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Lyrics007.cs 2009-03-29 11:25:14 UTC (rev 2748) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Lyrics007.cs 2009-03-29 12:10:32 UTC (rev 2749) @@ -69,7 +69,7 @@ try { reply = (Stream)e.Result; - sr = new StreamReader(reply); + sr = new StreamReader(reply, Encoding.Default); string line = sr.ReadToEnd(); Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyricsOnDemand.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyricsOnDemand.cs 2009-03-29 11:25:14 UTC (rev 2748) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyricsOnDemand.cs 2009-03-29 12:10:32 UTC (rev 2749) @@ -54,6 +54,8 @@ title = title.Replace("\xC6", ""); title = title.Replace("\xD8", ""); title = title.Replace("\xC5", ""); + title = title.Replace("\xF6", ""); + title = title.Replace("\xD6", ""); title = title.ToLower(); @@ -105,7 +107,7 @@ try { reply = (Stream)e.Result; - sr = new StreamReader(reply); + sr = new StreamReader(reply, Encoding.Default); string line = ""; int noOfLinesCount = 0; @@ -147,6 +149,7 @@ lyricTemp.Replace("<p><font size=\"2\" face=\"Verdana\">", " \r\n"); lyricTemp.Replace("<i>", ""); lyricTemp.Replace("</i>", ""); + lyricTemp.Replace("*", ""); lyricTemp.Replace("?s", "'s"); lyricTemp.Replace("?t", "'t"); lyricTemp.Replace("?m", "'m"); Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/SeekLyrics.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/SeekLyrics.cs 2009-03-29 11:25:14 UTC (rev 2748) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/SeekLyrics.cs 2009-03-29 12:10:32 UTC (rev 2749) @@ -107,7 +107,7 @@ try { reply = (Stream)e.Result; - sr = new StreamReader(reply); + sr = new StreamReader(reply, Encoding.Default); string line = sr.ReadToEnd(); Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Wiki.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Wiki.cs 2009-03-29 11:25:14 UTC (rev 2748) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Wiki.cs 2009-03-29 12:10:32 UTC (rev 2749) @@ -15,7 +15,7 @@ private string title = ""; private int noOfTries; public static bool Abort; - LyricSearch lyricSearch ; + LyricSearch lyricSearch; private string[] commonReplacementsLyricWiki = new string[18] { "<br>", "", "<br/>", "", "<BR>", "", "?d", "'d", "?s", "'s", "?t", "'t", "?v", "'v", "?e", "'e", "?r", "'r" }; private string[] commonRemoveFromLyricWiki = new string[2] { "[[category", "[[Category" }; @@ -42,6 +42,10 @@ else if (ar.AsyncWaitHandle.WaitOne(0, true)) { lyricsResult = del.EndInvoke(ar); + + string lyric = lyricsResult.lyrics; + Encoding iso8859 = Encoding.GetEncoding("ISO-8859-1"); + lyricsResult.lyrics = Encoding.UTF8.GetString(iso8859.GetBytes(lyricsResult.lyrics)); break; } else Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/FindLyric.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/FindLyric.Designer.cs 2009-03-29 11:25:14 UTC (rev 2748) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/FindLyric.Designer.cs 2009-03-29 12:10:32 UTC (rev 2749) @@ -42,6 +42,7 @@ this.groupBox2 = new System.Windows.Forms.GroupBox(); this.tbLyrics = new System.Windows.Forms.TextBox(); this.gbLyricSites = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.cbLyrDB = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.cbActionext = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.btCancel = new System.Windows.Forms.Button(); this.cbHotLyrics = new MediaPortal.UserInterface.Controls.MPCheckBox(); @@ -51,7 +52,6 @@ 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(); @@ -148,7 +148,7 @@ // cbResult // this.cbResult.Text = "Result"; - this.cbResult.Width = 58; + this.cbResult.Width = 52; // // chLyric // @@ -193,6 +193,19 @@ this.gbLyricSites.TabStop = false; this.gbLyricSites.Text = "Lyric sites to search"; // + // 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; + // // cbActionext // this.cbActionext.AutoSize = true; @@ -302,19 +315,6 @@ 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); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2009-03-30 19:04:17
|
Revision: 2752 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2752&view=rev Author: saamand Date: 2009-03-30 19:04:09 +0000 (Mon, 30 Mar 2009) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MyLyrics/LyricsEngine/LyricsWebClient.cs trunk/plugins/MyLyrics/LyricsEngine/Properties/AssemblyInfo.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs trunk/plugins/MyLyrics/My Lyrics/change log.txt Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsWebClient.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsWebClient.cs 2009-03-30 06:11:59 UTC (rev 2751) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsWebClient.cs 2009-03-30 19:04:09 UTC (rev 2752) @@ -48,6 +48,7 @@ ((HttpWebRequest)request).CookieContainer = cookieContainer; ((HttpWebRequest)request).UserAgent = userAgent; ((HttpWebRequest)request).Timeout = timeout; + ((HttpWebRequest)request).Proxy.Credentials = CredentialCache.DefaultCredentials; } return request; Modified: trunk/plugins/MyLyrics/LyricsEngine/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/Properties/AssemblyInfo.cs 2009-03-30 06:11:59 UTC (rev 2751) +++ trunk/plugins/MyLyrics/LyricsEngine/Properties/AssemblyInfo.cs 2009-03-30 19:04:09 UTC (rev 2752) @@ -26,7 +26,7 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.22")] +[assembly: AssemblyVersion("1.23")] // // In order to sign your assembly you must specify a key to use. Refer to the Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs 2009-03-30 06:11:59 UTC (rev 2751) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs 2009-03-30 19:04:09 UTC (rev 2752) @@ -80,7 +80,7 @@ this.lbInfo1.Name = "lbInfo1"; this.lbInfo1.Size = new System.Drawing.Size(197, 18); this.lbInfo1.TabIndex = 3; - this.lbInfo1.Text = "MyLyrics plugin, version 1.22"; + this.lbInfo1.Text = "MyLyrics plugin, version 1.23"; // // label2 // Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj 2009-03-30 06:11:59 UTC (rev 2751) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj 2009-03-30 19:04:09 UTC (rev 2752) @@ -5,7 +5,7 @@ <ProductVersion>9.0.21022</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{BBB2DAE2-0D83-4B4B-85B6-D1B5A7E10039}</ProjectGuid> - <OutputType>WinExe</OutputType> + <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>MyLyrics</RootNamespace> <AssemblyName>MyLyrics</AssemblyName> Modified: trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs 2009-03-30 06:11:59 UTC (rev 2751) +++ trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs 2009-03-30 19:04:09 UTC (rev 2752) @@ -31,5 +31,5 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.22")] -[assembly: AssemblyFileVersion("1.22")] +[assembly: AssemblyVersion("1.23")] +[assembly: AssemblyFileVersion("1.23")] Modified: trunk/plugins/MyLyrics/My Lyrics/change log.txt =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/change log.txt 2009-03-30 06:11:59 UTC (rev 2751) +++ trunk/plugins/MyLyrics/My Lyrics/change log.txt 2009-03-30 19:04:09 UTC (rev 2752) @@ -1,4 +1,4 @@ -Release notes to MyLyrics 1.21 +Release notes to MyLyrics 1.23 MyLyrics is a windows plugin for MediaPortal which enables the display of lyrics for the currently played music file inside MediaPortal. The plugin is able show LRC and plain lyrics, and uses both musictags and online searches to find lyrics. @@ -14,9 +14,10 @@ * Create a LRC from a basic lyric on the fly. Keys: -- W (or '#' button on remote): Toggle between basic and wide screen. -- E (or '*' button on remote): Toggle between lyric and editor screen. -- Enter (or 'OK' on remote): Tag line on LRC editor screen. +- W key (or '#' button on remote): Toggle between basic and wide screen. +- E key (or '*' button on remote): Toggle between lyric and editor screen. +- S key: Increase the vertical scroll speed. A total of six speed values. +- Enter key (or 'OK' on remote): Tag line on LRC editor screen. Screens: - Lyrics basic: shows lyric with coverart on the right (default lyrics screen). @@ -30,26 +31,101 @@ Installation: Simple copy the content of the zip-file into your MP library (typical C:\Program Files\Team MediaPortal\MediaPortal). -Noteworthy changes since version 1.10: -* Add: Support for the lyric site LyrDB. +Noteworthy changes since version 1.21: +* Fix: Better support for non-English characters. +* Fix: Support for credentials for proxy calls helping users behind a proxy. +* Add: Support automatic scroll using the textboxscrollup controls (requires MyLyrics 1.22+ compatible skin!). +* Add: The lyrics line limit length in LRC can manually be set in configuration. +* Add: Support for the lyric site LyrDB - Song Lyrics - The biggest lyrics portal on the net!. * Add: On the Lyrics database tab you can choose to see only the LRCs of your lyrics database. +* Add: StreamedMP skin supported (MyLyrics 1.22+ compatible). * Fix: Vertical black lines caused by use of "\r\n" in Label controls is eliminated by using "\n" instead. * Fix: Show previous screen issue and back trace issues with MP fixed. -* Fix: Blue3 and Blue3wide skins optimized. -Skin Support: -All supported skins (or at least the ones I'm aware of) are listed here: MyLyrics skin library +For skin-makers: +I've added the scroll feature once again which basically means that all skin-makers must add a couple of new controls to the MyLyrics.xml file. The two new controls have the id's 1020 and 1021 and are basically twins of the two textbox controls with id's 20 and 21. The main difference is that the new controls are of the type textboxscrollup and also have a little smaller value for the height (due to nature of the textboxscrollup control). -For skinners: -Due to a change in the MP Gui engine in March 2008 all label controls need a <width> tag to be shown. -That means all controls of the type "label" must have the tag <width>x</width> where x is the width in pixels. -920 pixels is good value for most 16:9 skins. +Here are an example from MyLyrics.xml of the Blue3 skin: -In short, the following controls must be updated with the tag <width>920</width>: -id: 200-212 -id: 300-312 -id: 400-412 -id: 500-512 -id: 600-612 - -The change is needed for the LRC and LRC editor modes to work. +<control> +<type>textbox</type> +<description>The Lyric area basic</description> +<id>20</id> +<posX>48</posX> +<posY>104</posY> +<width>336</width> +<height>336</height> +<image>icon-folder.png</image> +<label>-</label> +<text>6</text> +<spinPosX>320</spinPosX> +<spinPosY>400</spinPosY> +<font>font12</font> +<onleft>2</onleft> +<onright>2</onright> +<onup>2</onup> +<ondown>2</ondown> +<textcolor>ffdddddd</textcolor> +</control> +<control> +<type>textbox</type> +<description>The Lyric area wide</description> +<id>21</id> +<posX>48</posX> +<posY>104</posY> +<width>640</width> +<height>336</height> +<image>icon-folder.png</image> +<label>-</label> +<text>6</text> +<spinPosX>620</spinPosX> +<spinPosY>400</spinPosY> +<font>font12</font> +<onleft>2</onleft> +<onright>2</onright> +<onup>2</onup> +<ondown>2</ondown> +<textcolor>ffdddddd</textcolor> +</control> +<control> +<type>textboxscrollup</type> +<description>The Lyric area basic</description> +<id>1020</id> +<posX>48</posX> +<posY>104</posY> +<width>336</width> +<height>318</height> +<image>icon-folder.png</image> +<label>-</label> +<text>6</text> +<spinPosX>320</spinPosX> +<spinPosY>400</spinPosY> +<seperator>----------------------------------------------------------------------------------------------</seperator> +<font>font12</font> +<onleft>2</onleft> +<onright>2</onright> +<onup>2</onup> +<ondown>2</ondown> +<textcolor>ffdddddd</textcolor> +</control> +<control> +<type>textboxscrollup</type> +<description>The Lyric area wide</description> +<id>1021</id> +<posX>48</posX> +<posY>104</posY> +<width>640</width> +<height>318</height> +<image>icon-folder.png</image> +<label>-</label> +<text>6</text> +<spinPosX>620</spinPosX> +<spinPosY>400</spinPosY> +<seperator>----------------------------------------------------------------------------------------------</seperator> +<font>font12</font> +<onleft>2</onleft> +<onright>2</onright> +<onup>2</onup> +<ondown>2</ondown> +<textcolor>ffdddddd</textcolor> +</control> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2009-04-06 15:10:00
|
Revision: 2760 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2760&view=rev Author: saamand Date: 2009-04-06 15:09:56 +0000 (Mon, 06 Apr 2009) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MyLyrics/LyricsEngine/LyricSearch.cs trunk/plugins/MyLyrics/LyricsEngine/LyricsEngine.csproj trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Wiki.cs trunk/plugins/MyLyrics/LyricsEngine/Properties/AssemblyInfo.cs trunk/plugins/MyLyrics/LyricsEngine/Properties/Settings.Designer.cs trunk/plugins/MyLyrics/LyricsEngine/Properties/Settings.settings trunk/plugins/MyLyrics/LyricsEngine/Setup.cs trunk/plugins/MyLyrics/LyricsEngine/app.config 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/LyricsLibrary.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 trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs trunk/plugins/MyLyrics/My Lyrics/change log.txt Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricSearch.cs =================================================================== (Binary files differ) Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsEngine.csproj =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsEngine.csproj 2009-04-06 12:08:03 UTC (rev 2759) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsEngine.csproj 2009-04-06 15:09:56 UTC (rev 2760) @@ -54,6 +54,7 @@ <Compile Include="LyricSearch.cs" /> <Compile Include="LyricDiagnostics.cs" /> <Compile Include="LyricsSites\Actionext.cs" /> + <Compile Include="LyricsSites\LrcFinder.cs" /> <Compile Include="LyricsSites\LyrDB.cs" /> <Compile Include="LyricsSites\HotLyrics.cs" /> <Compile Include="LyricsSites\Lyrics007.cs" /> @@ -102,6 +103,11 @@ <DesignTimeSharedInput>True</DesignTimeSharedInput> </Compile> <Compile Include="Setup.cs" /> + <Compile Include="Web References\lrcfinder\Reference.cs"> + <AutoGen>True</AutoGen> + <DesignTime>True</DesignTime> + <DependentUpon>Reference.map</DependentUpon> + </Compile> <Compile Include="Web References\org.lyricwiki\Reference.cs"> <AutoGen>True</AutoGen> <DesignTime>True</DesignTime> @@ -113,6 +119,17 @@ <WebReferences Include="Web References\" /> </ItemGroup> <ItemGroup> + <WebReferenceUrl Include="http://lrcfinder.profiler.nl/LrcFinder.asmx%3fop=FindLRC"> + <UrlBehavior>Dynamic</UrlBehavior> + <RelPath>Web References\lrcfinder\</RelPath> + <UpdateFromURL>http://lrcfinder.profiler.nl/LrcFinder.asmx%3fop=FindLRC</UpdateFromURL> + <ServiceLocationURL> + </ServiceLocationURL> + <CachedDynamicPropName> + </CachedDynamicPropName> + <CachedAppSettingsObjectName>Settings</CachedAppSettingsObjectName> + <CachedSettingsPropName>LyricsEngine_lrcfinder_LrcFinder</CachedSettingsPropName> + </WebReferenceUrl> <WebReferenceUrl Include="http://lyricwiki.org/server.php%3fwsdl"> <UrlBehavior>Dynamic</UrlBehavior> <RelPath>Web References\org.lyricwiki\</RelPath> @@ -125,6 +142,14 @@ <CachedSettingsPropName>LyricsEngine_org_lyricwiki_LyricWiki</CachedSettingsPropName> </WebReferenceUrl> </ItemGroup> + <ItemGroup> + <None Include="Web References\lrcfinder\LrcFinder.disco" /> + <None Include="Web References\lrcfinder\LrcFinder.wsdl" /> + <None Include="Web References\lrcfinder\Reference.map"> + <Generator>MSDiscoCodeGenerator</Generator> + <LastGenOutput>Reference.cs</LastGenOutput> + </None> + </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Wiki.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Wiki.cs 2009-04-06 12:08:03 UTC (rev 2759) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Wiki.cs 2009-04-06 15:09:56 UTC (rev 2760) @@ -79,8 +79,10 @@ { return MakeLyricFit(lyricsResult.lyrics); } - - return "Not found"; + else + { + return "Not found"; + } } catch (Exception) { Modified: trunk/plugins/MyLyrics/LyricsEngine/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/Properties/AssemblyInfo.cs 2009-04-06 12:08:03 UTC (rev 2759) +++ trunk/plugins/MyLyrics/LyricsEngine/Properties/AssemblyInfo.cs 2009-04-06 15:09:56 UTC (rev 2760) @@ -26,7 +26,7 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.23")] +[assembly: AssemblyVersion("1.30")] // // In order to sign your assembly you must specify a key to use. Refer to the Modified: trunk/plugins/MyLyrics/LyricsEngine/Properties/Settings.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/Properties/Settings.Designer.cs 2009-04-06 12:08:03 UTC (rev 2759) +++ trunk/plugins/MyLyrics/LyricsEngine/Properties/Settings.Designer.cs 2009-04-06 15:09:56 UTC (rev 2760) @@ -32,5 +32,33 @@ return ((string)(this["LyricsEngine_org_lyricwiki_LyricWiki"])); } } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("http://api.google.com/search/beta2")] + public string Google_GoogleSearchService { + get { + return ((string)(this["Google_GoogleSearchService"])); + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("http://api.google.com/search/beta2")] + public string MyLyrics_Google_GoogleSearchService { + get { + return ((string)(this["MyLyrics_Google_GoogleSearchService"])); + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.WebServiceUrl)] + [global::System.Configuration.DefaultSettingValueAttribute("http://lrcfinder.profiler.nl/LrcFinder.asmx")] + public string LyricsEngine_lrcfinder_LrcFinder { + get { + return ((string)(this["LyricsEngine_lrcfinder_LrcFinder"])); + } + } } } Modified: trunk/plugins/MyLyrics/LyricsEngine/Properties/Settings.settings =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/Properties/Settings.settings 2009-04-06 12:08:03 UTC (rev 2759) +++ trunk/plugins/MyLyrics/LyricsEngine/Properties/Settings.settings 2009-04-06 15:09:56 UTC (rev 2760) @@ -5,5 +5,14 @@ <Setting Name="LyricsEngine_org_lyricwiki_LyricWiki" Type="(Web Service URL)" Scope="Application"> <Value Profile="(Default)">http://lyricwiki.org/server.php</Value> </Setting> + <Setting Name="Google_GoogleSearchService" Type="System.String" Scope="Application"> + <Value Profile="(Default)">http://api.google.com/search/beta2</Value> + </Setting> + <Setting Name="MyLyrics_Google_GoogleSearchService" Type="System.String" Scope="Application"> + <Value Profile="(Default)">http://api.google.com/search/beta2</Value> + </Setting> + <Setting Name="LyricsEngine_lrcfinder_LrcFinder" Type="(Web Service URL)" Scope="Application"> + <Value Profile="(Default)">http://lrcfinder.profiler.nl/LrcFinder.asmx</Value> + </Setting> </Settings> </SettingsFile> \ No newline at end of file Modified: trunk/plugins/MyLyrics/LyricsEngine/Setup.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/Setup.cs 2009-04-06 12:08:03 UTC (rev 2759) +++ trunk/plugins/MyLyrics/LyricsEngine/Setup.cs 2009-04-06 15:09:56 UTC (rev 2760) @@ -6,8 +6,9 @@ { public static class Setup { - public static string[] BatchSearchSites = new string[7] + public static string[] BatchSearchSites = new string[8] { + "LrcFinder", "LyricWiki", "Lyrics007", "LyricsOnDemand", Modified: trunk/plugins/MyLyrics/LyricsEngine/app.config =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/app.config 2009-04-06 12:08:03 UTC (rev 2759) +++ trunk/plugins/MyLyrics/LyricsEngine/app.config 2009-04-06 15:09:56 UTC (rev 2760) @@ -7,14 +7,11 @@ </configSections> <applicationSettings> <LyricsEngine.Properties.Settings> - <setting name="Google_GoogleSearchService" serializeAs="String"> - <value>http://api.google.com/search/beta2</value> - </setting> <setting name="LyricsEngine_org_lyricwiki_LyricWiki" serializeAs="String"> <value>http://lyricwiki.org/server.php</value> </setting> - <setting name="MyLyrics_Google_GoogleSearchService" serializeAs="String"> - <value>http://api.google.com/search/beta2</value> + <setting name="LyricsEngine_lrcfinder_LrcFinder" serializeAs="String"> + <value>http://lrcfinder.profiler.nl/LrcFinder.asmx</value> </setting> </LyricsEngine.Properties.Settings> </applicationSettings> Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs 2009-04-06 12:08:03 UTC (rev 2759) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs 2009-04-06 15:09:56 UTC (rev 2760) @@ -80,7 +80,7 @@ this.lbInfo1.Name = "lbInfo1"; this.lbInfo1.Size = new System.Drawing.Size(197, 18); this.lbInfo1.TabIndex = 3; - this.lbInfo1.Text = "MyLyrics plugin, version 1.23"; + this.lbInfo1.Text = "MyLyrics plugin, version 1.30"; // // label2 // Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/FindLyric.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/FindLyric.Designer.cs 2009-04-06 12:08:03 UTC (rev 2759) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/FindLyric.Designer.cs 2009-04-06 15:09:56 UTC (rev 2760) @@ -52,6 +52,7 @@ this.cbLyricWiki = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.btClose = new System.Windows.Forms.Button(); this.btUpdate = new System.Windows.Forms.Button(); + this.cbLrcFinder = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.gbSearchInfo.SuspendLayout(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); @@ -176,6 +177,7 @@ // // gbLyricSites // + this.gbLyricSites.Controls.Add(this.cbLrcFinder); this.gbLyricSites.Controls.Add(this.cbLyrDB); this.gbLyricSites.Controls.Add(this.cbActionext); this.gbLyricSites.Controls.Add(this.btCancel); @@ -199,7 +201,7 @@ 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.Location = new System.Drawing.Point(237, 21); this.cbLyrDB.Name = "cbLyrDB"; this.cbLyrDB.Size = new System.Drawing.Size(53, 17); this.cbLyrDB.TabIndex = 18; @@ -212,7 +214,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(18, 44); + this.cbActionext.Location = new System.Drawing.Point(110, 21); this.cbActionext.Name = "cbActionext"; this.cbActionext.Size = new System.Drawing.Size(68, 17); this.cbActionext.TabIndex = 17; @@ -235,7 +237,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(346, 21); + this.cbHotLyrics.Location = new System.Drawing.Point(338, 44); this.cbHotLyrics.Name = "cbHotLyrics"; this.cbHotLyrics.Size = new System.Drawing.Size(71, 17); this.cbHotLyrics.TabIndex = 14; @@ -248,7 +250,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(246, 44); + this.cbSeekLyrics.Location = new System.Drawing.Point(338, 21); this.cbSeekLyrics.Name = "cbSeekLyrics"; this.cbSeekLyrics.Size = new System.Drawing.Size(79, 17); this.cbSeekLyrics.TabIndex = 15; @@ -261,7 +263,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(111, 21); + this.cbLyricsOnDemand.Location = new System.Drawing.Point(110, 44); this.cbLyricsOnDemand.Name = "cbLyricsOnDemand"; this.cbLyricsOnDemand.Size = new System.Drawing.Size(108, 17); this.cbLyricsOnDemand.TabIndex = 12; @@ -274,7 +276,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(246, 21); + this.cbLyrics007.Location = new System.Drawing.Point(237, 44); this.cbLyrics007.Name = "cbLyrics007"; this.cbLyrics007.Size = new System.Drawing.Size(72, 17); this.cbLyrics007.TabIndex = 13; @@ -287,7 +289,7 @@ this.cbLyricWiki.Checked = true; this.cbLyricWiki.CheckState = System.Windows.Forms.CheckState.Checked; this.cbLyricWiki.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.cbLyricWiki.Location = new System.Drawing.Point(16, 21); + this.cbLyricWiki.Location = new System.Drawing.Point(18, 44); this.cbLyricWiki.Name = "cbLyricWiki"; this.cbLyricWiki.Size = new System.Drawing.Size(67, 17); this.cbLyricWiki.TabIndex = 11; @@ -315,6 +317,19 @@ this.btUpdate.UseVisualStyleBackColor = true; this.btUpdate.Click += new System.EventHandler(this.btUpdate_Click); // + // cbLrcFinder + // + this.cbLrcFinder.AutoSize = true; + this.cbLrcFinder.Checked = true; + this.cbLrcFinder.CheckState = System.Windows.Forms.CheckState.Checked; + this.cbLrcFinder.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.cbLrcFinder.Location = new System.Drawing.Point(18, 21); + this.cbLrcFinder.Name = "cbLrcFinder"; + this.cbLrcFinder.Size = new System.Drawing.Size(68, 17); + this.cbLrcFinder.TabIndex = 19; + this.cbLrcFinder.Text = "LrcFinder"; + this.cbLrcFinder.UseVisualStyleBackColor = true; + // // FindLyric // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -371,5 +386,6 @@ private System.Windows.Forms.Button btCancel; internal MediaPortal.UserInterface.Controls.MPCheckBox cbActionext; internal MediaPortal.UserInterface.Controls.MPCheckBox cbLyrDB; + internal MediaPortal.UserInterface.Controls.MPCheckBox cbLrcFinder; } } \ 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 2009-04-06 12:08:03 UTC (rev 2759) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/FindLyric.cs 2009-04-06 15:09:56 UTC (rev 2760) @@ -82,6 +82,7 @@ using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MediaPortal.xml")) { + cbLrcFinder.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useLrcFinder", "True")).ToString().Equals("True") ? true : false; 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; @@ -152,6 +153,10 @@ sitesToSearch = new List<string>(); + if (cbLrcFinder.Checked) + { + sitesToSearch.Add("LrcFinder"); + } if (cbLyricWiki.Checked) { sitesToSearch.Add("LyricWiki"); @@ -303,7 +308,7 @@ if (markedDatabase && m_moveLyricFromMarkedDatabase) { - parent.RemoveSong(originalArtist, originalTitle); + parent.RemoveSong(originalArtist, originalTitle, true); string key = DatabaseUtil.CorrectKeyFormat(originalArtist, originalTitle); MyLyricsSettings.LyricsDB[key] = new LyricsItem(originalArtist, originalTitle, lyric, site); DatabaseUtil.SerializeLyricDB(); Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.cs 2009-04-06 12:08:03 UTC (rev 2759) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.cs 2009-04-06 15:09:56 UTC (rev 2760) @@ -88,7 +88,7 @@ } } } - catch {;} + catch { ;} finally { treeView.Sort(); @@ -194,7 +194,7 @@ treeView.Update(); } - public void RemoveSong(string artist, string title) + public void RemoveSong(string artist, string title, bool serializeDB) { try { @@ -225,7 +225,11 @@ // remove title from database CurrentDB.Remove(DatabaseUtil.CorrectKeyFormat(artist, title)); - DatabaseUtil.SerializeDB(CurrentDB); + + if (serializeDB) + { + DatabaseUtil.SerializeDB(CurrentDB); + } } } @@ -384,14 +388,14 @@ { for (int i = 0; i < titles.Count; i++) { - RemoveSong(m_CurrentArtist, (string)titles[i]); + RemoveSong(m_CurrentArtist, (string)titles[i], i == titles.Count - 1); } } } else { - RemoveSong(m_CurrentArtist, m_CurrentTitle); + RemoveSong(m_CurrentArtist, m_CurrentTitle, true); highlightSong(m_CurrentArtist, m_CurrentTitle, true); } updateLyricDatabaseStats(); @@ -554,7 +558,7 @@ LyricsItem item = CurrentDB[key]; // remove song from treeview and current database - RemoveSong(artist, title); + RemoveSong(artist, title, true); // add song to other database and serialize it if (CurrentDB.Equals(MyLyricsSettings.LyricsDB)) Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.cs 2009-04-06 12:08:03 UTC (rev 2759) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.cs 2009-04-06 15:09:56 UTC (rev 2760) @@ -306,6 +306,8 @@ using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MediaPortal.xml")) { + if (((string)xmlreader.GetValueAsString("myLyrics", "useLrcFinder", "True")).ToString().Equals("True")) + sitesToSearch.Add("LrcFinder"); if (((string)xmlreader.GetValueAsString("myLyrics", "useLyricWiki", "True")).ToString().Equals("True")) sitesToSearch.Add("LyricWiki"); if (((string)xmlreader.GetValueAsString("myLyrics", "useActionext", "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 2009-04-06 12:08:03 UTC (rev 2759) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs 2009-04-06 15:09:56 UTC (rev 2760) @@ -90,7 +90,9 @@ this.tbPluginName = new MediaPortal.UserInterface.Controls.MPTextBox(); this.lbPluginName = new MediaPortal.UserInterface.Controls.MPLabel(); this.gbLyricSites = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.rbLrcMode = new System.Windows.Forms.RadioButton(); this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.cbLrcFinder = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.cbLyrDB = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.cbActionext = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.cbLyrics007 = new MediaPortal.UserInterface.Controls.MPCheckBox(); @@ -804,6 +806,7 @@ // // gbLyricSites // + this.gbLyricSites.Controls.Add(this.rbLrcMode); this.gbLyricSites.Controls.Add(this.groupBox2); this.gbLyricSites.Controls.Add(this.groupBox1); this.gbLyricSites.Controls.Add(this.rdDefault); @@ -816,8 +819,21 @@ this.gbLyricSites.TabStop = false; this.gbLyricSites.Text = "Lyrics sites settings"; // + // rbLrcMode + // + this.rbLrcMode.AutoSize = true; + this.rbLrcMode.Location = new System.Drawing.Point(254, 23); + this.rbLrcMode.Name = "rbLrcMode"; + this.rbLrcMode.Size = new System.Drawing.Size(75, 17); + this.rbLrcMode.TabIndex = 29; + this.rbLrcMode.Text = "LRC mode"; + this.rbLrcMode.UseVisualStyleBackColor = true; + this.rbLrcMode.Leave += new System.EventHandler(this.WriteMediaPortalXML); + this.rbLrcMode.CheckedChanged += new System.EventHandler(this.rdTrackBar_CheckedChanged); + // // groupBox2 // + this.groupBox2.Controls.Add(this.cbLrcFinder); this.groupBox2.Controls.Add(this.cbLyrDB); this.groupBox2.Controls.Add(this.cbActionext); this.groupBox2.Controls.Add(this.cbLyrics007); @@ -832,13 +848,26 @@ this.groupBox2.TabStop = false; this.groupBox2.Text = "User select mode"; // + // cbLrcFinder + // + this.cbLrcFinder.AutoSize = true; + this.cbLrcFinder.Checked = true; + this.cbLrcFinder.CheckState = System.Windows.Forms.CheckState.Checked; + this.cbLrcFinder.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.cbLrcFinder.Location = new System.Drawing.Point(20, 70); + this.cbLrcFinder.Name = "cbLrcFinder"; + this.cbLrcFinder.Size = new System.Drawing.Size(68, 17); + this.cbLrcFinder.TabIndex = 10; + this.cbLrcFinder.Text = "LrcFinder"; + this.cbLrcFinder.UseVisualStyleBackColor = true; + // // 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.Location = new System.Drawing.Point(216, 26); this.cbLyrDB.Name = "cbLyrDB"; this.cbLyrDB.Size = new System.Drawing.Size(53, 17); this.cbLyrDB.TabIndex = 9; @@ -852,7 +881,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, 49); + this.cbActionext.Location = new System.Drawing.Point(131, 70); this.cbActionext.Name = "cbActionext"; this.cbActionext.Size = new System.Drawing.Size(68, 17); this.cbActionext.TabIndex = 8; @@ -866,7 +895,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(17, 48); + this.cbLyrics007.Location = new System.Drawing.Point(20, 49); this.cbLyrics007.Name = "cbLyrics007"; this.cbLyrics007.Size = new System.Drawing.Size(72, 17); this.cbLyrics007.TabIndex = 4; @@ -880,7 +909,7 @@ this.cbLyricWiki.Checked = true; this.cbLyricWiki.CheckState = System.Windows.Forms.CheckState.Checked; this.cbLyricWiki.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.cbLyricWiki.Location = new System.Drawing.Point(17, 71); + this.cbLyricWiki.Location = new System.Drawing.Point(131, 26); this.cbLyricWiki.Name = "cbLyricWiki"; this.cbLyricWiki.Size = new System.Drawing.Size(67, 17); this.cbLyricWiki.TabIndex = 2; @@ -894,7 +923,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(17, 26); + this.cbLyricsOnDemand.Location = new System.Drawing.Point(20, 26); this.cbLyricsOnDemand.Name = "cbLyricsOnDemand"; this.cbLyricsOnDemand.Size = new System.Drawing.Size(108, 17); this.cbLyricsOnDemand.TabIndex = 5; @@ -908,7 +937,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, 26); + this.cbHotLyrics.Location = new System.Drawing.Point(131, 48); this.cbHotLyrics.Name = "cbHotLyrics"; this.cbHotLyrics.Size = new System.Drawing.Size(71, 17); this.cbHotLyrics.TabIndex = 7; @@ -922,7 +951,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(216, 26); + this.cbSeekLyrics.Location = new System.Drawing.Point(216, 49); this.cbSeekLyrics.Name = "cbSeekLyrics"; this.cbSeekLyrics.Size = new System.Drawing.Size(79, 17); this.cbSeekLyrics.TabIndex = 6; @@ -985,19 +1014,20 @@ this.rdDefault.TabIndex = 23; this.rdDefault.Text = "Default select mode"; this.rdDefault.UseVisualStyleBackColor = true; - this.rdDefault.Leave += new System.EventHandler(this.rdTrackBar_CheckedChanged); + this.rdDefault.Leave += new System.EventHandler(this.WriteMediaPortalXML); this.rdDefault.CheckedChanged += new System.EventHandler(this.rdTrackBar_CheckedChanged); // // rbUserDefined // this.rbUserDefined.AutoSize = true; - this.rbUserDefined.Location = new System.Drawing.Point(150, 23); + this.rbUserDefined.Location = new System.Drawing.Point(141, 23); this.rbUserDefined.Name = "rbUserDefined"; this.rbUserDefined.Size = new System.Drawing.Size(107, 17); this.rbUserDefined.TabIndex = 22; this.rbUserDefined.Text = "User select mode"; this.rbUserDefined.UseVisualStyleBackColor = true; - this.rbUserDefined.Leave += new System.EventHandler(this.rdTrackBar_CheckedChanged); + this.rbUserDefined.Leave += new System.EventHandler(this.WriteMediaPortalXML); + this.rbUserDefined.CheckedChanged += new System.EventHandler(this.rdTrackBar_CheckedChanged); // // tabPageReplace // @@ -1218,5 +1248,7 @@ internal MediaPortal.UserInterface.Controls.MPCheckBox cbAutoChangeToLineLimit; private MediaPortal.UserInterface.Controls.MPLabel lblyricLengthLimit; internal MediaPortal.UserInterface.Controls.MPCheckBox cbUseAutoScrollAsDefault; + internal MediaPortal.UserInterface.Controls.MPCheckBox cbLrcFinder; + private System.Windows.Forms.RadioButton rbLrcMode; } } \ 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 2009-04-06 12:08:03 UTC (rev 2759) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.cs 2009-04-06 15:09:56 UTC (rev 2760) @@ -300,6 +300,7 @@ trackBar.Enabled = false; rbUserDefined.Checked = true; + cbLrcFinder.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useLrcFinder", "True")).ToString().Equals("True") ? true : false; 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; @@ -467,6 +468,8 @@ ArrayList sitesToSearch = new ArrayList(); + if (cbLrcFinder.Checked) + sitesToSearch.Add("LrcFinder"); if (cbLyricWiki.Checked) sitesToSearch.Add("LyricWiki"); if (cbActionext.Checked) @@ -487,7 +490,7 @@ ThreadFinished = new string[] { "", "", "You haven't selected any sites to search", "error" }; return; } - + sitesToSearchArray = (string[])sitesToSearch.ToArray(typeof(string)); @@ -657,7 +660,7 @@ private void bgWorkerSearch_DoWork(object sender, DoWorkEventArgs e) { -// Thread.CurrentThread.Name = "bgWorker - Search"; + // Thread.CurrentThread.Name = "bgWorker - Search"; #region 1. Sorting song lyricConfigInfosQueue = new Queue(); @@ -779,7 +782,7 @@ #endregion - startSearch: + startSearch: #region 2. Search music tags for lyrics @@ -1020,6 +1023,7 @@ { cbLyricsOnDemand.Checked = true; cbLyrics007.Checked = false; + cbLrcFinder.Checked = false; cbLyricWiki.Checked = false; cbHotLyrics.Checked = false; cbSeekLyrics.Checked = false; @@ -1030,6 +1034,7 @@ { cbLyricsOnDemand.Checked = true; cbLyrics007.Checked = true; + cbLrcFinder.Checked = false; cbLyricWiki.Checked = false; cbHotLyrics.Checked = false; cbSeekLyrics.Checked = false; @@ -1040,6 +1045,7 @@ { cbLyricsOnDemand.Checked = true; cbLyrics007.Checked = true; + cbLrcFinder.Checked = true; cbLyricWiki.Checked = true; cbHotLyrics.Checked = true; cbActionext.Checked = true; @@ -1050,6 +1056,7 @@ { cbLyricsOnDemand.Checked = true; cbLyrics007.Checked = true; + cbLrcFinder.Checked = true; cbLyricWiki.Checked = true; cbHotLyrics.Checked = true; cbSeekLyrics.Checked = true; @@ -1066,6 +1073,7 @@ { cbLyricsOnDemand.Checked = true; cbLyrics007.Checked = true; + cbLrcFinder.Checked = true; cbLyricWiki.Checked = true; cbHotLyrics.Checked = true; cbSeekLyrics.Checked = false; @@ -1081,6 +1089,7 @@ trackBar.Enabled = true; cbLyricsOnDemand.Enabled = false; cbLyrics007.Enabled = false; + cbLrcFinder.Enabled = false; cbLyricWiki.Enabled = false; cbHotLyrics.Enabled = false; cbSeekLyrics.Enabled = false; @@ -1088,17 +1097,40 @@ cbLyrDB.Enabled = false; trackBar_Scroll(null, null); } - else + else if (rbUserDefined.Checked) { trackBar.Enabled = false; cbLyricsOnDemand.Enabled = true; cbLyrics007.Enabled = true; + cbLrcFinder.Enabled = true; cbLyricWiki.Enabled = true; cbHotLyrics.Enabled = true; cbSeekLyrics.Enabled = true; cbActionext.Enabled = true; cbLyrDB.Enabled = true; } + else if (rbLrcMode.Checked) + { + trackBar.Enabled = false; + + cbLyricsOnDemand.Enabled = false; + cbLyrics007.Enabled = false; + cbLrcFinder.Enabled = false; + cbLyricWiki.Enabled = false; + cbHotLyrics.Enabled = false; + cbSeekLyrics.Enabled = false; + cbActionext.Enabled = false; + cbLyrDB.Enabled = false; + + cbLyricsOnDemand.Checked = false; + cbLyrics007.Checked = false; + cbLrcFinder.Checked = true; + cbLyricWiki.Checked = false; + cbHotLyrics.Checked = false; + cbSeekLyrics.Checked = false; + cbActionext.Checked = false; + cbLyrDB.Checked = false; + } } private void WriteMediaPortalXML(object sender, EventArgs e) @@ -1109,6 +1141,7 @@ xmlwriter.SetValue("myLyrics", "defaultSitesModeValue", trackBar.Value); xmlwriter.SetValue("myLyrics", "limit", tbLimit.Text); xmlwriter.SetValue("myLyrics", "pluginsName", tbPluginName.Text); + xmlwriter.SetValue("myLyrics", "useLrcFinder", cbLrcFinder.Checked.ToString()); xmlwriter.SetValue("myLyrics", "useLyricWiki", cbLyricWiki.Checked.ToString()); xmlwriter.SetValue("myLyrics", "useActionext", cbActionext.Checked.ToString()); xmlwriter.SetValue("myLyrics", "useLyrDB", cbLyrDB.Checked.ToString()); @@ -1144,14 +1177,11 @@ } } - if (find.ToString() != "" && replace.ToString() != "") - { - xmlwriter.SetValue("myLyrics", "find", find.ToString()); - xmlwriter.SetValue("myLyrics", "replace", replace.ToString()); + xmlwriter.SetValue("myLyrics", "find", find.ToString()); + xmlwriter.SetValue("myLyrics", "replace", replace.ToString()); - m_find = find.ToString(); - m_replace = replace.ToString(); - } + m_find = find.ToString(); + m_replace = replace.ToString(); } catch (Exception ex) { Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2009-04-06 12:08:03 UTC (rev 2759) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2009-04-06 15:09:56 UTC (rev 2760) @@ -350,11 +350,12 @@ resetGUI(selectedScreen); - bool useLyricWiki, useLyrics007, useLyricsOnDemand, useSeekLyrics, useHotLyrics, useActionext, useLyrDB; + bool useLyricWiki, useLrcFinder, useLyrics007, useLyricsOnDemand, useSeekLyrics, useHotLyrics, useActionext, useLyrDB; using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MediaPortal.xml")) { UseID3 = xmlreader.GetValueAsBool("musicfiles", "showid3", true); + useLrcFinder = ((string)xmlreader.GetValueAsString("myLyrics", "useLrcFinder", "True")).ToString().Equals("True") ? true : false; useLyricWiki = ((string)xmlreader.GetValueAsString("myLyrics", "useLyricWiki", "True")).ToString().Equals("True") ? true : false; useLyrics007 = ((string)xmlreader.GetValueAsString("myLyrics", "useLyrics007", "True")).ToString().Equals("True") ? true : false; useLyricsOnDemand = ((string)xmlreader.GetValueAsString("myLyrics", "useLyricsOnDemand", "True")).ToString().Equals("True") ? true : false; @@ -399,6 +400,10 @@ m_strippedPrefixStrings = MediaPortalUtil.GetStrippedPrefixStringArray(); ArrayList sitesToSearch = new ArrayList(); + if (useLrcFinder && Setup.IsMember("LrcFinder")) + { + sitesToSearch.Add("LrcFinder"); + } if (useLyricWiki && Setup.IsMember("LyricWiki")) { sitesToSearch.Add("LyricWiki"); @@ -712,81 +717,7 @@ if (m_AutomaticReadFromMusicTag && ((CurrentTrackTag.Lyrics.Length != 0 && (lrc = new SimpleLRC(m_artist, m_title, CurrentTrackTag.Lyrics)).IsValid)) || (lyricText.Length != 0 && (lrc = new SimpleLRC(m_artist, m_title, lyricText)).IsValid)) { - lyricsFound = true; - m_ValidLrcLyric = true; - - lrcTimeCollection = lrc.SimpleLRCTimeAndLineCollection; - lines = lrcTimeCollection.Copy(); - - //Let's see if the basic or wide version of the LRC-screen should be shown - bool aLongLinePresent = false; - if (m_useAutoOnLyricLength) - { - for (int i = 0; i < lines.Length; i++) - { - if (lines[i].Length > m_basicWideLimit) - { - aLongLinePresent = true; - break; - } - } - } - - if (basicScreenSelected.HasValue) - { - if (basicScreenSelected.Value) - { - resetGUI((int)MyLyricsSettings.Screen.LRC_BASIC); - } - else - { - resetGUI((int)MyLyricsSettings.Screen.LRC_WIDE); - } - } - else - { - if (aLongLinePresent) - { - resetGUI((int)MyLyricsSettings.Screen.LRC_WIDE); - } - else - { - resetGUI((int)MyLyricsSettings.Screen.LRC_BASIC); - } - } - - m_StatusText = ""; - GUIControl.SetControlLabel(GetID, (int)GUI_General_Controls.CONTROL_LBStatus, m_StatusText); - - // If lyricText is empty, the LRC file was pulled out of the music tag and is still not in the lyrics database - if (string.IsNullOrEmpty(lyricText)) - { - LyricsItem item = new LyricsItem(m_artist, m_title, CurrentTrackTag.Lyrics, "music tag"); - LyricsDB[DatabaseUtil.CorrectKeyFormat(m_artist, m_title)] = item; - - string path = MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Database, LyricsDBName); - using (FileStream fs = new FileStream(path, FileMode.Open)) - { - BinaryFormatter bf = new BinaryFormatter(); - LyricsDB.SetLastModified(); - bf.Serialize(fs, LyricsDB); - fs.Close(); - } - } - else - { - m_LyricText = lyricText; - } - - try - { - for (int i = tagRoundFinished * TAG_IN_ROUND; i < (tagRoundFinished + 1) * TAG_IN_ROUND; i++) - { - ShowLrcLine((int)GUI_LRC_Controls.CONTROL_VIEW_LINE + i, lines[i]); - ShowLrcLine((int)GUI_LRC_Controls.CONTROL_VIEW_LINE_DONE + i, lines[i]); - } - } - catch { ;} + StartShowingLrc(lyricText); } // 3) Lyric in music tag @@ -832,6 +763,86 @@ } } + private void StartShowingLrc(string lyricText) + { + lyricsFound = true; + m_ValidLrcLyric = true; + + lrcTimeCollection = lrc.SimpleLRCTimeAndLineCollection; + lines = lrcTimeCollection.Copy(); + + //Let's see if the basic or wide version of the LRC-screen should be shown + bool aLongLinePresent = false; + if (m_useAutoOnLyricLength) + { + for (int i = 0; i < lines.Length; i++) + { + if (lines[i].Length > m_basicWideLimit) + { + aLongLinePresent = true; + break; + } + } + } + + if (basicScreenSelected.HasValue) + { + if (basicScreenSelected.Value) + { + resetGUI((int)MyLyricsSettings.Screen.LRC_BASIC); + } + else + { + resetGUI((int)MyLyricsSettings.Screen.LRC_WIDE); + } + } + else + { + if (aLongLinePresent) + { + resetGUI((int)MyLyricsSettings.Screen.LRC_WIDE); + } + else + { + resetGUI((int)MyLyricsSettings.Screen.LRC_BASIC); + } + } + + m_StatusText = ""; + GUIControl.SetControlLabel(GetID, (int)GUI_General_Controls.CONTROL_LBStatus, m_StatusText); + + // If lyricText is empty, the LRC file was pulled out of the music tag and is still not in the lyrics database + if (string.IsNullOrEmpty(lyricText)) + { + LyricsItem item = new LyricsItem(m_artist, m_title, CurrentTrackTag.Lyrics, "music tag"); + LyricsDB[DatabaseUtil.CorrectKeyFormat(m_artist, m_title)] = item; + + string path = MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Database, LyricsDBName); + using (FileStream fs = new FileStream(path, FileMode.Open)) + { + BinaryFormatter bf = new BinaryFormatter(); + LyricsDB.SetLastModified(); + bf.Serialize(fs, LyricsDB); + fs.Close(); + } + } + else + { + m_LyricText = lyricText; + } + + try + { + for (int i = tagRoundFinished * TAG_IN_ROUND; i < (tagRoundFinished + 1) * TAG_IN_ROUND; i++) + { + ShowLrcLine((int)GUI_LRC_Controls.CONTROL_VIEW_LINE + i, lines[i]); + ShowLrcLine((int)GUI_LRC_Controls.CONTROL_VIEW_LINE_DONE + i, lines[i]); + } + } + catch { ;} + + } + private void tagLine() { if (alreadyValidLRC == false && selectedScreen == (int)MyLyricsSettings.Screen.LRC_EDITOR) @@ -997,22 +1008,32 @@ } else { - m_LyricText = MediaPortalUtil.MakePlainLyricPerfectToShow(m_LyricText); + // If LRC that has been found, then show lyric in LRC-mode + lrc = new SimpleLRC(null, null, m_LyricText); - if (basicScreenSelected.HasValue == false || basicScreenSelected.Value) + if (lrc.IsValid) { - resetGUI((int)MyLyricsSettings.Screen.LYRICS_BASIC); - GUIControl.SetControlLabel(GetID, CONTROL_LYRIC_SELECTED, m_LyricText); - GUIControl.FocusControl(GetID, CONTROL_LYRIC_SELECTED); + StartShowingLrc(m_LyricText); } + // else show plain lyric else { - resetGUI((int)MyLyricsSettings.Screen.LYRICS_WIDE); - GUIControl.SetControlLabel(GetID, CONTROL_LYRICWIDE_SELECTED, m_LyricText); - GUIControl.FocusControl(GetID, CONTROL_LYRICWIDE_SELECTED); + m_LyricText = MediaPortalUtil.MakePlainLyricPerfectToShow(m_LyricText); + + if (basicScreenSelected.HasValue == false || basicScreenSelected.Value) + { + resetGUI((int)MyLyricsSettings.Screen.LYRICS_BASIC); + GUIControl.SetControlLabel(GetID, CONTROL_LYRIC_SELECTED, m_LyricText); + GUIControl.FocusControl(GetID, CONTROL_LYRIC_SELECTED); + } + else + { + resetGUI((int)MyLyricsSettings.Screen.LYRICS_WIDE); + GUIControl.SetControlLabel(GetID, CONTROL_LYRICWIDE_SELECTED, m_LyricText); + GUIControl.FocusControl(GetID, CONTROL_LYRICWIDE_SELECTED); + } } - } } Modified: trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs 2009-04-06 12:08:03 UTC (rev 2759) +++ trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs 2009-04-06 15:09:56 UTC (rev 2760) @@ -31,5 +31,5 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.23")] -[assembly: AssemblyFileVersion("1.23")] +[assembly: AssemblyVersion("1.30")] +[assembly: AssemblyFileVersion("1.30")] Modified: trunk/plugins/MyLyrics/My Lyrics/change log.txt =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/change log.txt 2009-04-06 12:08:03 UTC (rev 2759) +++ trunk/plugins/MyLyrics/My Lyrics/change log.txt 2009-04-06 15:09:56 UTC (rev 2760) @@ -1,4 +1,4 @@ -Release notes to MyLyrics 1.23 +Release notes to MyLyrics 1.30 MyLyrics is a windows plugin for MediaPortal which enables the display of lyrics for the currently played music file inside MediaPortal. The plugin is able show LRC and plain lyrics, and uses both musictags and online searches to find lyrics. @@ -16,31 +16,27 @@ Keys: - W key (or '#' button on remote): Toggle between basic and wide screen. - E key (or '*' button on remote): Toggle between lyric and editor screen. -- S key: Increase the vertical scroll speed. A total of six speed values. +- S key: Increase the vertical scroll speed when in scroll mode. A total of six speed values. - Enter key (or 'OK' on remote): Tag line on LRC editor screen. Screens: - Lyrics basic: shows lyric with coverart on the right (default lyrics screen). - Lyrics wide: shows wider lyric area and no coverart. + (Two sub modes for both Lyrics basic and Lyrics wide: static mode (default) or scroll mode) - LRC basic: shows lrc file and coverart on the right (default lrc screen). - LRC wide: shows wider lrc area and no coverart (the plugin autoselects this if the lrc contains one or more long lines). -- LRC editor: enables the creation of lrc lyric from a plain lyric. +- LRC editor: enables the creation of lrc lyric from a plain lyric. Compatible with MediaPortal 1.0.0.0 final. Installation: Simple copy the content of the zip-file into your MP library (typical C:\Program Files\Team MediaPortal\MediaPortal). -Noteworthy changes since version 1.21: -* Fix: Better support for non-English characters. -* Fix: Support for credentials for proxy calls helping users behind a proxy. -* Add: Support automatic scroll using the textboxscrollup controls (requires MyLyrics 1.22+ compatible skin!). -* Add: The lyrics line limit length in LRC can manually be set in configuration. -* Add: Support for the lyric site LyrDB - Song Lyrics - The biggest lyrics portal on the net!. -* Add: On the Lyrics database tab you can choose to see only the LRCs of your lyrics database. -* Add: StreamedMP skin supported (MyLyrics 1.22+ compatible). -* Fix: Vertical black lines caused by use of "\r\n" in Label controls is eliminated by using "\n" instead. -* Fix: Show previous screen issue and back trace issues with MP fixed. +Noteworthy changes since version 1.23: +* Add: Support for BeenieBoys LrcFinder webservice (thanks BeenieBoy!). +* Add: LRC mode added to the configuration (searches only for LRC-files). +* Fix: Deleted entries in "Find & replace" dialogue were not removed correctly. +* Fix: Performance improvement when deleting entry in lyrics database. For skin-makers: I've added the scroll feature once again which basically means that all skin-makers must add a couple of new controls to the MyLyrics.xml file. The two new controls have the id's 1020 and 1021 and are basically twins of the two textbox controls with id's 20 and 21. The main difference is that the new controls are of the type textboxscrollup and also have a little smaller value for the height (due to nature of the textboxscrollup control). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2009-04-07 19:03:28
|
Revision: 2766 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2766&view=rev Author: saamand Date: 2009-04-07 19:03:23 +0000 (Tue, 07 Apr 2009) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MyLyrics/LyricsEngine/LyricSearch.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.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 trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricSearch.cs =================================================================== (Binary files differ) Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.cs 2009-04-07 18:24:32 UTC (rev 2765) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.cs 2009-04-07 19:03:23 UTC (rev 2766) @@ -285,7 +285,7 @@ tbLyrics.Text = m_OriginalLyric; tbLyrics.Enabled = true; - lbTitle.Text = "\"" + m_CurrentArtist + " - " + m_CurrentTitle + "\"" + (!item.Source.Equals("") ? " found in " + item.Source : ""); + lbTitle.Text = "\"" + m_CurrentArtist + " - " + m_CurrentTitle + "\"" + (!item.Source.Equals("") ? " found at " + item.Source : ""); btSearchSingle.Enabled = true; } Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs 2009-04-07 18:24:32 UTC (rev 2765) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs 2009-04-07 19:03:23 UTC (rev 2766) @@ -115,6 +115,8 @@ this.tabPageAbout = new System.Windows.Forms.TabPage(); this.btClose = new MediaPortal.UserInterface.Controls.MPButton(); this.bgWorkerSearch = new System.ComponentModel.BackgroundWorker(); + this.gbLrc = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.cbUploadLrcAutomatically = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.tabControl.SuspendLayout(); this.tabPageDatabase.SuspendLayout(); this.gbGenerel.SuspendLayout(); @@ -134,6 +136,7 @@ this.tabPageReplace.SuspendLayout(); this.mpGroupBox4.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dbGridView)).BeginInit(); + this.gbLrc.SuspendLayout(); this.SuspendLayout(); // // tabControl @@ -605,6 +608,7 @@ // // tabPageSetup // + this.tabPageSetup.Controls.Add(this.gbLrc); this.tabPageSetup.Controls.Add(this.gbGUI); this.tabPageSetup.Controls.Add(this.gbTag); this.tabPageSetup.Controls.Add(this.mpGroupBox3); @@ -625,7 +629,7 @@ this.gbGUI.Controls.Add(this.lblyricLengthLimit); this.gbGUI.Controls.Add(this.cbUseAutoScrollAsDefault); this.gbGUI.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.gbGUI.Location = new System.Drawing.Point(5, 235); + this.gbGUI.Location = new System.Drawing.Point(5, 211); this.gbGUI.Name = "gbGUI"; this.gbGUI.Size = new System.Drawing.Size(538, 83); this.gbGUI.TabIndex = 33; @@ -688,9 +692,9 @@ this.gbTag.Controls.Add(this.cbMusicTagAlwaysCheck); this.gbTag.Controls.Add(this.cbMusicTagWrite); this.gbTag.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.gbTag.Location = new System.Drawing.Point(5, 324); + this.gbTag.Location = new System.Drawing.Point(5, 347); this.gbTag.Name = "gbTag"; - this.gbTag.Size = new System.Drawing.Size(538, 52); + this.gbTag.Size = new System.Drawing.Size(538, 45); this.gbTag.TabIndex = 31; this.gbTag.TabStop = false; this.gbTag.Text = "Music tags"; @@ -725,9 +729,9 @@ this.mpGroupBox3.Controls.Add(this.cbMoveSongFrom); this.mpGroupBox3.Controls.Add(this.cbAutoFetch); this.mpGroupBox3.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.mpGroupBox3.Location = new System.Drawing.Point(5, 382); + this.mpGroupBox3.Location = new System.Drawing.Point(5, 398); this.mpGroupBox3.Name = "mpGroupBox3"; - this.mpGroupBox3.Size = new System.Drawing.Size(538, 92); + this.mpGroupBox3.Size = new System.Drawing.Size(538, 69); this.mpGroupBox3.TabIndex = 30; this.mpGroupBox3.TabStop = false; this.mpGroupBox3.Text = "Find lyric dialog settings"; @@ -736,7 +740,7 @@ // this.cbAutomaticUpdate.AutoSize = true; this.cbAutomaticUpdate.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.cbAutomaticUpdate.Location = new System.Drawing.Point(16, 45); + this.cbAutomaticUpdate.Location = new System.Drawing.Point(274, 23); this.cbAutomaticUpdate.Name = "cbAutomaticUpdate"; this.cbAutomaticUpdate.Size = new System.Drawing.Size(222, 17); this.cbAutomaticUpdate.TabIndex = 8; @@ -750,7 +754,7 @@ this.cbMoveSongFrom.Checked = true; this.cbMoveSongFrom.CheckState = System.Windows.Forms.CheckState.Checked; this.cbMoveSongFrom.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.cbMoveSongFrom.Location = new System.Drawing.Point(16, 68); + this.cbMoveSongFrom.Location = new System.Drawing.Point(16, 46); this.cbMoveSongFrom.Name = "cbMoveSongFrom"; this.cbMoveSongFrom.Size = new System.Drawing.Size(341, 17); this.cbMoveSongFrom.TabIndex = 7; @@ -779,7 +783,7 @@ this.mpGroupBox2.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.mpGroupBox2.Location = new System.Drawing.Point(5, 5); this.mpGroupBox2.Name = "mpGroupBox2"; - this.mpGroupBox2.Size = new System.Drawing.Size(538, 59); + this.mpGroupBox2.Size = new System.Drawing.Size(538, 50); this.mpGroupBox2.TabIndex = 29; this.mpGroupBox2.TabStop = false; this.mpGroupBox2.Text = "Basic settings"; @@ -787,7 +791,7 @@ // tbPluginName // this.tbPluginName.BorderColor = System.Drawing.Color.Empty; - this.tbPluginName.Location = new System.Drawing.Point(96, 24); + this.tbPluginName.Location = new System.Drawing.Point(94, 19); this.tbPluginName.MaxLength = 30; this.tbPluginName.Name = "tbPluginName"; this.tbPluginName.Size = new System.Drawing.Size(144, 20); @@ -798,7 +802,7 @@ // lbPluginName // this.lbPluginName.AutoSize = true; - this.lbPluginName.Location = new System.Drawing.Point(13, 27); + this.lbPluginName.Location = new System.Drawing.Point(13, 22); this.lbPluginName.Name = "lbPluginName"; this.lbPluginName.Size = new System.Drawing.Size(68, 13); this.lbPluginName.TabIndex = 14; @@ -812,9 +816,9 @@ this.gbLyricSites.Controls.Add(this.rdLyricsMode); this.gbLyricSites.Controls.Add(this.rbUserSelectMode); this.gbLyricSites.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.gbLyricSites.Location = new System.Drawing.Point(5, 70); + this.gbLyricSites.Location = new System.Drawing.Point(5, 61); this.gbLyricSites.Name = "gbLyricSites"; - this.gbLyricSites.Size = new System.Drawing.Size(538, 159); + this.gbLyricSites.Size = new System.Drawing.Size(538, 144); this.gbLyricSites.TabIndex = 28; this.gbLyricSites.TabStop = false; this.gbLyricSites.Text = "Lyrics search mode"; @@ -844,7 +848,7 @@ this.groupBox2.Controls.Add(this.cbSeekLyrics); this.groupBox2.Location = new System.Drawing.Point(229, 48); this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(301, 100); + this.groupBox2.Size = new System.Drawing.Size(301, 90); this.groupBox2.TabIndex = 28; this.groupBox2.TabStop = false; this.groupBox2.Text = "Selected lyric sites to search"; @@ -855,7 +859,7 @@ this.cbLrcFinder.Checked = true; this.cbLrcFinder.CheckState = System.Windows.Forms.CheckState.Checked; this.cbLrcFinder.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.cbLrcFinder.Location = new System.Drawing.Point(20, 70); + this.cbLrcFinder.Location = new System.Drawing.Point(20, 61); this.cbLrcFinder.Name = "cbLrcFinder"; this.cbLrcFinder.Size = new System.Drawing.Size(68, 17); this.cbLrcFinder.TabIndex = 10; @@ -868,7 +872,7 @@ 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(216, 26); + this.cbLyrDB.Location = new System.Drawing.Point(216, 17); this.cbLyrDB.Name = "cbLyrDB"; this.cbLyrDB.Size = new System.Drawing.Size(53, 17); this.cbLyrDB.TabIndex = 9; @@ -882,7 +886,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, 70); + this.cbActionext.Location = new System.Drawing.Point(131, 61); this.cbActionext.Name = "cbActionext"; this.cbActionext.Size = new System.Drawing.Size(68, 17); this.cbActionext.TabIndex = 8; @@ -896,7 +900,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(20, 49); + this.cbLyrics007.Location = new System.Drawing.Point(20, 40); this.cbLyrics007.Name = "cbLyrics007"; this.cbLyrics007.Size = new System.Drawing.Size(72, 17); this.cbLyrics007.TabIndex = 4; @@ -910,7 +914,7 @@ this.cbLyricWiki.Checked = true; this.cbLyricWiki.CheckState = System.Windows.Forms.CheckState.Checked; this.cbLyricWiki.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.cbLyricWiki.Location = new System.Drawing.Point(131, 26); + this.cbLyricWiki.Location = new System.Drawing.Point(131, 17); this.cbLyricWiki.Name = "cbLyricWiki"; this.cbLyricWiki.Size = new System.Drawing.Size(67, 17); this.cbLyricWiki.TabIndex = 2; @@ -924,7 +928,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(20, 26); + this.cbLyricsOnDemand.Location = new System.Drawing.Point(20, 17); this.cbLyricsOnDemand.Name = "cbLyricsOnDemand"; this.cbLyricsOnDemand.Size = new System.Drawing.Size(108, 17); this.cbLyricsOnDemand.TabIndex = 5; @@ -938,7 +942,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, 48); + this.cbHotLyrics.Location = new System.Drawing.Point(131, 39); this.cbHotLyrics.Name = "cbHotLyrics"; this.cbHotLyrics.Size = new System.Drawing.Size(71, 17); this.cbHotLyrics.TabIndex = 7; @@ -952,7 +956,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(216, 49); + this.cbSeekLyrics.Location = new System.Drawing.Point(216, 40); this.cbSeekLyrics.Name = "cbSeekLyrics"; this.cbSeekLyrics.Size = new System.Drawing.Size(79, 17); this.cbSeekLyrics.TabIndex = 6; @@ -967,16 +971,16 @@ this.groupBox1.Controls.Add(this.lbSpeed); this.groupBox1.Location = new System.Drawing.Point(6, 48); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(217, 100); + this.groupBox1.Size = new System.Drawing.Size(217, 90); this.groupBox1.TabIndex = 27; this.groupBox1.TabStop = false; - this.groupBox1.Text = "Default select mode"; + this.groupBox1.Text = "Search priority"; // // mpLabel2 // this.mpLabel2.AutoSize = true; this.mpLabel2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.mpLabel2.Location = new System.Drawing.Point(151, 25); + this.mpLabel2.Location = new System.Drawing.Point(151, 21); this.mpLabel2.Name = "mpLabel2"; this.mpLabel2.Size = new System.Drawing.Size(43, 13); this.mpLabel2.TabIndex = 26; @@ -986,7 +990,7 @@ // this.trackBar.BackColor = System.Drawing.SystemColors.Control; this.trackBar.LargeChange = 3; - this.trackBar.Location = new System.Drawing.Point(36, 42); + this.trackBar.Location = new System.Drawing.Point(35, 37); this.trackBar.Maximum = 3; this.trackBar.Name = "trackBar"; this.trackBar.Size = new System.Drawing.Size(158, 45); @@ -1000,7 +1004,7 @@ // this.lbSpeed.AutoSize = true; this.lbSpeed.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lbSpeed.Location = new System.Drawing.Point(29, 25); + this.lbSpeed.Location = new System.Drawing.Point(29, 21); this.lbSpeed.Name = "lbSpeed"; this.lbSpeed.Size = new System.Drawing.Size(38, 13); this.lbSpeed.TabIndex = 24; @@ -1114,6 +1118,29 @@ this.bgWorkerSearch.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.bgWorkerSearch_RunWorkerCompleted); this.bgWorkerSearch.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.bgWorkerSearch_ProgressChanged); // + // gbLrc + // + this.gbLrc.Controls.Add(this.cbUploadLrcAutomatically); + this.gbLrc.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.gbLrc.Location = new System.Drawing.Point(5, 296); + this.gbLrc.Name = "gbLrc"; + this.gbLrc.Size = new System.Drawing.Size(538, 45); + this.gbLrc.TabIndex = 32; + this.gbLrc.TabStop = false; + this.gbLrc.Text = "LRC settings"; + // + // cbUploadLrcAutomatically + // + this.cbUploadLrcAutomatically.AutoSize = true; + this.cbUploadLrcAutomatically.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.cbUploadLrcAutomatically.Location = new System.Drawing.Point(17, 20); + this.cbUploadLrcAutomatically.Name = "cbUploadLrcAutomatically"; + this.cbUploadLrcAutomatically.Size = new System.Drawing.Size(275, 17); + this.cbUploadLrcAutomatically.TabIndex = 7; + this.cbUploadLrcAutomatically.Text = "Upload manual added LRC to LrcFinder automatically"; + this.cbUploadLrcAutomatically.UseVisualStyleBackColor = true; + this.cbUploadLrcAutomatically.MouseLeave += new System.EventHandler(this.WriteMediaPortalXML); + // // MyLyricsSetup // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -1160,6 +1187,8 @@ this.mpGroupBox4.ResumeLayout(false); this.mpGroupBox4.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.dbGridView)).EndInit(); + this.gbLrc.ResumeLayout(false); + this.gbLrc.PerformLayout(); this.ResumeLayout(false); } @@ -1253,5 +1282,7 @@ internal MediaPortal.UserInterface.Controls.MPCheckBox cbUseAutoScrollAsDefault; internal MediaPortal.UserInterface.Controls.MPCheckBox cbLrcFinder; private System.Windows.Forms.RadioButton rbLrcMode; + private MediaPortal.UserInterface.Controls.MPGroupBox gbLrc; + internal MediaPortal.UserInterface.Controls.MPCheckBox cbUploadLrcAutomatically; } } \ 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 2009-04-07 18:24:32 UTC (rev 2765) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.cs 2009-04-07 19:03:23 UTC (rev 2766) @@ -280,6 +280,8 @@ cbAutoChangeToLineLimit.Checked = xmlreader.GetValue("myLyrics", "useAutoOnLyricLength").Equals("yes"); tbLyricsLimit.Text = xmlreader.GetValueAsString("myLyrics", "AutoLyricLength", "45"); + cbUploadLrcAutomatically.Checked = xmlreader.GetValue("myLyrics", "uploadLrcToLrcFinder").Equals("yes"); + lbSongsLimitNote.Text = ("(You have currently " + m_TotalTitles.ToString() + " titles in your music database)"); trackBar.Value = ((int)xmlreader.GetValueAsInt("myLyrics", "defaultSitesModeValue", 2)); @@ -1182,6 +1184,7 @@ xmlwriter.SetValueAsBool("myLyrics", "useAutoscroll", cbUseAutoScrollAsDefault.Checked); xmlwriter.SetValueAsBool("myLyrics", "useAutoOnLyricLength", cbAutoChangeToLineLimit.Checked); xmlwriter.SetValue("myLyrics", "AutoLyricLength", tbLyricsLimit.Text); + xmlwriter.SetValueAsBool("myLyrics", "uploadLrcToLrcFinder", cbUploadLrcAutomatically.Checked); xmlwriter.SetValueAsBool("myLyrics", "automaticFetch", cbAutoFetch.Checked); xmlwriter.SetValueAsBool("myLyrics", "automaticUpdateWhenFirstFound", cbAutomaticUpdate.Checked); xmlwriter.SetValueAsBool("myLyrics", "moveLyricFromMarkedDatabase", cbMoveSongFrom.Checked); Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2009-04-07 18:24:32 UTC (rev 2765) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2009-04-07 19:03:23 UTC (rev 2766) @@ -167,6 +167,8 @@ internal bool m_useAutoOnLyricLength = false; internal int m_basicWideLimit = 45; + internal bool m_uploadLrcToLrcFinder = false; + SimpleLRC lrc; SimpleLRCTimeAndLineCollection lrcTimeCollection; Stopwatch stopwatch; @@ -371,6 +373,8 @@ m_useAutoOnLyricLength = ((string)xmlreader.GetValueAsString("myLyrics", "useAutoOnLyricLength", "False")).ToString().Equals("yes") ? true : false; m_basicWideLimit = xmlreader.GetValueAsInt("myLyrics", "AutoLyricLength", 45); + m_uploadLrcToLrcFinder = ((string)xmlreader.GetValueAsString("myLyrics", "uploadLrcToLrcFinder", "False")).ToString().Equals("yes") ? true : false; + skin = ((string)xmlreader.GetValueAsString("skin", "name", "Blue3")); m_crossfade = xmlreader.GetValueAsInt("audioplayer", "crossfade", 2000); @@ -895,16 +899,22 @@ dlg.SetLine(3, String.Empty); dlg.DoModal(GUIWindowManager.ActiveWindow); + StringBuilder lyric = new StringBuilder(); + + string artist = LyricUtil.CapatalizeString(m_artist); + string title = LyricUtil.CapatalizeString(m_title); - StringBuilder lyric = new StringBuilder(); + lyric.Append(string.Format("[ar:{0}]\n", artist)); + lyric.Append(string.Format("[ti:{0}]\n", title)); + lyric.Append(string.Format("[by:{0}]\n", "MediaPortal")); + lyric.Append(string.Format("[offset:{0}]\n", "500")); + for (int i = 0; i < lines.Length; i++) { lyric.Append(lines[i] + "\n"); } lyric.Replace("\r", ""); - string artist = LyricUtil.CapatalizeString(m_artist); - string title = LyricUtil.CapatalizeString(m_title); string lyricAsString = lyric.ToString(); int lastLineShift = lyricAsString.LastIndexOf("\n"); @@ -925,6 +935,13 @@ m_LyricText = lyricAsString; m_ValidLrcLyric = true; + // Upload LRC to LrcFinder if user has accepted in configuration + if (m_uploadLrcToLrcFinder) + { + LyricsEngine.LyricSites.LrcFinder lrcFinder = new LyricsEngine.LyricSites.LrcFinder(); + lrcFinder.SaveLyric(m_LyricText); + } + } } } Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj 2009-04-07 18:24:32 UTC (rev 2765) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj 2009-04-07 19:03:23 UTC (rev 2766) @@ -5,7 +5,7 @@ <ProductVersion>9.0.21022</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{BBB2DAE2-0D83-4B4B-85B6-D1B5A7E10039}</ProjectGuid> - <OutputType>WinExe</OutputType> + <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>MyLyrics</RootNamespace> <AssemblyName>MyLyrics</AssemblyName> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2009-04-13 07:24:13
|
Revision: 2784 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2784&view=rev Author: saamand Date: 2009-04-13 07:24:11 +0000 (Mon, 13 Apr 2009) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.resx trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj trunk/plugins/MyLyrics/My Lyrics/change log.txt Added Paths: ----------- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LrcFinder.cs Added: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LrcFinder.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LrcFinder.cs (rev 0) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LrcFinder.cs 2009-04-13 07:24:11 UTC (rev 2784) @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using LyricsEngine.lrcfinder; +using LyricsEngine; + +namespace LyricsEngine.LyricSites +{ + public class LrcFinder + { + private lrcfinder.LrcFinder lrcFinder; + private string artist = ""; + private string title = ""; + public static bool Abort; + + + public LrcFinder() + { + lrcFinder = new lrcfinder.LrcFinder(); + } + + public string LrcFinderSearch(string artist, string title) + { + this.artist = artist; + this.title = title; + + string lrc = string.Empty; + + if (Abort == false) + { + try + { + lrc = lrcFinder.FindLRC(this.artist, this.title); + } + catch + { + lrc = "Not found"; + } + } + + if (IsLyric(lrc)) + { + return lrc; + } + else + { + return "Not found"; + } + } + + + private bool IsLyric(string lrc) + { + if (!lrc.Equals("Not found") && !lrc.Equals("NOT FOUND") && lrc.Length != 0) + { + return true; + } + else + { + return false; + } + } + + public bool SaveLyric(string lrcFile) + { + try + { + string result = lrcFinder.SaveLRC(lrcFile); + return result.Equals("DONE"); + } + catch + { + return false; + } + } + } +} Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.cs 2009-04-11 05:58:35 UTC (rev 2783) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.cs 2009-04-13 07:24:11 UTC (rev 2784) @@ -362,6 +362,13 @@ } } + SimpleLRC lrc = new SimpleLRC(capArtist, capTitle, lyrics); + if (lrc.IsValid && parent.cbUploadLrcAutomatically.Checked) + { + LyricsEngine.LyricSites.LrcFinder lrcFinder = new LyricsEngine.LyricSites.LrcFinder(); + lrcFinder.SaveLyric(lyrics); + } + btSave.Enabled = false; treeView.Focus(); } Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs 2009-04-11 05:58:35 UTC (rev 2783) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs 2009-04-13 07:24:11 UTC (rev 2784) @@ -74,6 +74,8 @@ this.lbLyricsFound2 = new MediaPortal.UserInterface.Controls.MPLabel(); this.lbLyricsFound = new MediaPortal.UserInterface.Controls.MPLabel(); this.tabPageSetup = new MediaPortal.UserInterface.Controls.MPTabPage(); + this.gbLrc = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.cbUploadLrcAutomatically = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.gbGUI = new MediaPortal.UserInterface.Controls.MPGroupBox(); this.tbLyricsLimit = new MediaPortal.UserInterface.Controls.MPTextBox(); this.cbAutoChangeToLineLimit = new MediaPortal.UserInterface.Controls.MPCheckBox(); @@ -115,8 +117,6 @@ this.tabPageAbout = new System.Windows.Forms.TabPage(); this.btClose = new MediaPortal.UserInterface.Controls.MPButton(); this.bgWorkerSearch = new System.ComponentModel.BackgroundWorker(); - this.gbLrc = new MediaPortal.UserInterface.Controls.MPGroupBox(); - this.cbUploadLrcAutomatically = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.tabControl.SuspendLayout(); this.tabPageDatabase.SuspendLayout(); this.gbGenerel.SuspendLayout(); @@ -125,6 +125,7 @@ this.gbProgress.SuspendLayout(); this.gbMusicDBSearchStats.SuspendLayout(); this.tabPageSetup.SuspendLayout(); + this.gbLrc.SuspendLayout(); this.gbGUI.SuspendLayout(); this.gbTag.SuspendLayout(); this.mpGroupBox3.SuspendLayout(); @@ -136,7 +137,6 @@ this.tabPageReplace.SuspendLayout(); this.mpGroupBox4.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dbGridView)).BeginInit(); - this.gbLrc.SuspendLayout(); this.SuspendLayout(); // // tabControl @@ -622,6 +622,29 @@ this.tabPageSetup.Text = "Settings"; this.tabPageSetup.UseVisualStyleBackColor = true; // + // gbLrc + // + this.gbLrc.Controls.Add(this.cbUploadLrcAutomatically); + this.gbLrc.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.gbLrc.Location = new System.Drawing.Point(5, 296); + this.gbLrc.Name = "gbLrc"; + this.gbLrc.Size = new System.Drawing.Size(538, 45); + this.gbLrc.TabIndex = 32; + this.gbLrc.TabStop = false; + this.gbLrc.Text = "LRC settings"; + // + // cbUploadLrcAutomatically + // + this.cbUploadLrcAutomatically.AutoSize = true; + this.cbUploadLrcAutomatically.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.cbUploadLrcAutomatically.Location = new System.Drawing.Point(17, 20); + this.cbUploadLrcAutomatically.Name = "cbUploadLrcAutomatically"; + this.cbUploadLrcAutomatically.Size = new System.Drawing.Size(275, 17); + this.cbUploadLrcAutomatically.TabIndex = 7; + this.cbUploadLrcAutomatically.Text = "Upload manual added LRC to LrcFinder automatically"; + this.cbUploadLrcAutomatically.UseVisualStyleBackColor = true; + this.cbUploadLrcAutomatically.MouseLeave += new System.EventHandler(this.WriteMediaPortalXML); + // // gbGUI // this.gbGUI.Controls.Add(this.tbLyricsLimit); @@ -1118,29 +1141,6 @@ this.bgWorkerSearch.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.bgWorkerSearch_RunWorkerCompleted); this.bgWorkerSearch.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.bgWorkerSearch_ProgressChanged); // - // gbLrc - // - this.gbLrc.Controls.Add(this.cbUploadLrcAutomatically); - this.gbLrc.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.gbLrc.Location = new System.Drawing.Point(5, 296); - this.gbLrc.Name = "gbLrc"; - this.gbLrc.Size = new System.Drawing.Size(538, 45); - this.gbLrc.TabIndex = 32; - this.gbLrc.TabStop = false; - this.gbLrc.Text = "LRC settings"; - // - // cbUploadLrcAutomatically - // - this.cbUploadLrcAutomatically.AutoSize = true; - this.cbUploadLrcAutomatically.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.cbUploadLrcAutomatically.Location = new System.Drawing.Point(17, 20); - this.cbUploadLrcAutomatically.Name = "cbUploadLrcAutomatically"; - this.cbUploadLrcAutomatically.Size = new System.Drawing.Size(275, 17); - this.cbUploadLrcAutomatically.TabIndex = 7; - this.cbUploadLrcAutomatically.Text = "Upload manual added LRC to LrcFinder automatically"; - this.cbUploadLrcAutomatically.UseVisualStyleBackColor = true; - this.cbUploadLrcAutomatically.MouseLeave += new System.EventHandler(this.WriteMediaPortalXML); - // // MyLyricsSetup // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -1156,7 +1156,7 @@ this.MinimumSize = new System.Drawing.Size(568, 560); this.Name = "MyLyricsSetup"; this.ShowIcon = false; - this.Text = "My Lyrics Configuration"; + this.Text = "MyLyrics Configuration"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MyLyricsSetup_FormClosing); this.tabControl.ResumeLayout(false); this.tabPageDatabase.ResumeLayout(false); @@ -1168,6 +1168,8 @@ this.gbProgress.ResumeLayout(false); this.gbMusicDBSearchStats.ResumeLayout(false); this.tabPageSetup.ResumeLayout(false); + this.gbLrc.ResumeLayout(false); + this.gbLrc.PerformLayout(); this.gbGUI.ResumeLayout(false); this.gbGUI.PerformLayout(); this.gbTag.ResumeLayout(false); @@ -1187,8 +1189,6 @@ this.mpGroupBox4.ResumeLayout(false); this.mpGroupBox4.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.dbGridView)).EndInit(); - this.gbLrc.ResumeLayout(false); - this.gbLrc.PerformLayout(); this.ResumeLayout(false); } Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.resx =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.resx 2009-04-11 05:58:35 UTC (rev 2783) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.resx 2009-04-13 07:24:11 UTC (rev 2784) @@ -123,12 +123,6 @@ <metadata name="Replace.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> - <metadata name="Find.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="Replace.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> <metadata name="bgWorkerSearch.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>6, 4</value> </metadata> Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2009-04-11 05:58:35 UTC (rev 2783) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2009-04-13 07:24:11 UTC (rev 2784) @@ -891,14 +891,6 @@ } else { - GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow( - (int)GUIWindow.Window.WINDOW_DIALOG_OK); - dlg.SetHeading("LRC creation completed!"); - dlg.SetLine(1, "The lyric has been converted"); - dlg.SetLine(2, "to a LRC."); - dlg.SetLine(3, String.Empty); - dlg.DoModal(GUIWindowManager.ActiveWindow); - StringBuilder lyric = new StringBuilder(); string artist = LyricUtil.CapatalizeString(m_artist); @@ -942,6 +934,8 @@ lrcFinder.SaveLyric(m_LyricText); } + selectedScreen = (int)MyLyricsSettings.Screen.LRC_BASIC; + ShowLyricOnScreen(m_LyricText, "MediaPortal"); } } } @@ -1134,29 +1128,6 @@ private void resetGUI(int screenID) { - //if ((screenID == (int)MyLyricsSettings.Screen.LYRICS_WIDE || screenID == (int)MyLyricsSettings.Screen.LRC_WIDE || screenID == (int)MyLyricsSettings.Screen.LRC_EDITOR)) - //{ - // GUIControl.HideControl(GetID, (int)GUI_General_Controls.CONTROL_UPNEXT); - // GUIControl.HideControl(GetID, (int)GUI_General_Controls.CONTROL_ALBUM); - // GUIControl.HideControl(GetID, (int)GUI_General_Controls.CONTROL_YEAR); - // GUIControl.HideControl(GetID, (int)GUI_General_Controls.CONTROL_TRACKTITLE); - // GUIControl.HideControl(GetID, (int)GUI_General_Controls.CONTROL_TRACKARTIST); - // GUIControl.HideControl(GetID, (int)GUI_General_Controls.CONTROL_NUMBERDURATION); - // GUIControl.HideControl(GetID, (int)GUI_General_Controls.CONTROL_NEXTTRACK); - // GUIControl.HideControl(GetID, (int)GUI_General_Controls.CONTROL_NEXTARTIST); - //} - //else - //{ - // GUIControl.ShowControl(GetID, (int)GUI_General_Controls.CONTROL_UPNEXT); - // GUIControl.ShowControl(GetID, (int)GUI_General_Controls.CONTROL_ALBUM); - // GUIControl.ShowControl(GetID, (int)GUI_General_Controls.CONTROL_YEAR); - // GUIControl.ShowControl(GetID, (int)GUI_General_Controls.CONTROL_TRACKTITLE); - // GUIControl.ShowControl(GetID, (int)GUI_General_Controls.CONTROL_TRACKARTIST); - // GUIControl.ShowControl(GetID, (int)GUI_General_Controls.CONTROL_NUMBERDURATION); - // GUIControl.ShowControl(GetID, (int)GUI_General_Controls.CONTROL_NEXTTRACK); - // GUIControl.ShowControl(GetID, (int)GUI_General_Controls.CONTROL_NEXTARTIST); - //} - int prevSelectedScreen = selectedScreen; selectedScreen = screenID; @@ -1299,7 +1270,7 @@ GUIControl.HideControl(GetID, CONTROL_LYRIC_SELECTED); GUIControl.HideControl(GetID, CONTROL_LYRICWIDE_SELECTED); - // album art only visible for lyrics_basic screen AND + // album art only visible for lyrics_basic screen GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_CURRENTLY); GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_DURATION); GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_ALBUM); @@ -1345,15 +1316,15 @@ GUIControl.HideControl(GetID, CONTROL_LYRIC_SELECTED); GUIControl.HideControl(GetID, CONTROL_LYRICWIDE_SELECTED); - // album art only visible for lyrics_basic screen - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_CURRENTLY); - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_DURATION); - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_ALBUM); - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_YEAR); - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_NOWPLAYINGBACK); - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_ALBUMART); - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_PROGRESS); - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_PROGRESSIMAGE); + // album art only visible for basic screen + GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_CURRENTLY); + GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_DURATION); + GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_ALBUM); + GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_YEAR); + GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_NOWPLAYINGBACK); + GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_ALBUMART); + GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_PROGRESS); + GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_PROGRESSIMAGE); // LRC controls GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_TAGBUTTON); Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj 2009-04-11 05:58:35 UTC (rev 2783) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj 2009-04-13 07:24:11 UTC (rev 2784) @@ -5,7 +5,7 @@ <ProductVersion>9.0.21022</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{BBB2DAE2-0D83-4B4B-85B6-D1B5A7E10039}</ProjectGuid> - <OutputType>Library</OutputType> + <OutputType>WinExe</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>MyLyrics</RootNamespace> <AssemblyName>MyLyrics</AssemblyName> Modified: trunk/plugins/MyLyrics/My Lyrics/change log.txt =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/change log.txt 2009-04-11 05:58:35 UTC (rev 2783) +++ trunk/plugins/MyLyrics/My Lyrics/change log.txt 2009-04-13 07:24:11 UTC (rev 2784) @@ -33,8 +33,10 @@ Simple copy the content of the zip-file into your MP library (typical C:\Program Files\Team MediaPortal\MediaPortal). Noteworthy changes since version 1.23: -* Add: Support for BeenieBoys LrcFinder webservice (thanks BeenieBoy!). -* Add: LRC mode added to the configuration (searches only for LRC-files). +* Add: Support for LrcFinder webservice (a big thank you to BeenieBoy!). +* Add: Option to upload manual created LRC file to LrcFinder and share it with the community (default disabled). +* Add: LRC mode added to the configuration (search only for LRC-files). +* Add: LRC editor mode screen extended to include coverart. * Fix: Deleted entries in "Find & replace" dialogue were not removed correctly. * Fix: Performance improvement when deleting entry in lyrics database. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2009-05-12 15:49:43
|
Revision: 2860 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2860&view=rev Author: saamand Date: 2009-05-12 15:49:36 +0000 (Tue, 12 May 2009) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MyLyrics/LyricsEngine/LRC/SimpleLRC.cs trunk/plugins/MyLyrics/LyricsEngine/LRC/SimpleLRCFormat.cs trunk/plugins/MyLyrics/LyricsEngine/LRC/SimpleLRCTimeAndLine.cs trunk/plugins/MyLyrics/LyricsEngine/LRC/SimpleLRCTimeAndLineCollection.cs trunk/plugins/MyLyrics/LyricsEngine/LyricSearch.cs trunk/plugins/MyLyrics/LyricsEngine/LyricsController.cs trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Actionext.cs trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/HotLyrics.cs trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LrcFinder.cs trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyrDB.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/LyricsEngine/Web References/org.lyricwiki/Reference.cs trunk/plugins/MyLyrics/LyricsEngine/Web References/org.lyricwiki/server.wsdl trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.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 trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj trunk/plugins/MyLyrics/My Lyrics/MyLyricsExternCode.cs trunk/plugins/MyLyrics/My Lyrics/MyLyricsSettings.cs trunk/plugins/MyLyrics/My Lyrics/change log.txt Modified: trunk/plugins/MyLyrics/LyricsEngine/LRC/SimpleLRC.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LRC/SimpleLRC.cs 2009-05-10 22:18:04 UTC (rev 2859) +++ trunk/plugins/MyLyrics/LyricsEngine/LRC/SimpleLRC.cs 2009-05-12 15:49:36 UTC (rev 2860) @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Text; using System.IO; +using System.Collections; namespace LyricsEngine.LRC { @@ -9,14 +10,22 @@ { string artist; string title; + string offset; string album; string lyric; bool isValid; - System.Collections.ArrayList lyricLines; - System.Collections.ArrayList simpleLRCTimeAndLineArray; + ArrayList lyricLines; + private ArrayList simpleLRCTimeAndLineArray; + private ArrayList simpleLRCTimeAndLineArrayWithOffset; SimpleLRCTimeAndLineCollection simpleLRCTimeAndLineCollection; + SimpleLRCTimeAndLineCollection simpleLRCTimeAndLineCollectionWithOffset; + + /// <summary> + /// Constructor used in the MyLyrics configuration + /// </summary> + /// <param name="file"></param> public SimpleLRC(string file) { FileInfo fileInfo = new FileInfo(file); @@ -52,7 +61,7 @@ this.artist = artist; this.title = title; - string[] separators = new string[1]{"\n"}; + string[] separators = new string[1] { "\n" }; string[] lines = lyric.Split(separators, StringSplitOptions.None); string line = ""; lyricLines = new System.Collections.ArrayList(); @@ -75,6 +84,24 @@ simpleLRCTimeAndLineCollection = new SimpleLRCTimeAndLineCollection((SimpleLRCTimeAndLine[])simpleLRCTimeAndLineArray.ToArray(typeof(SimpleLRCTimeAndLine))); isValid = true; } + + simpleLRCTimeAndLineArrayWithOffset = new System.Collections.ArrayList(); + + int offsetInt = 0; + + if (int.TryParse(offset, out offsetInt)) + { + for (int i = 0; i < simpleLRCTimeAndLineArray.Count; i++) + { + simpleLRCTimeAndLineArrayWithOffset.Add(((SimpleLRCTimeAndLine)simpleLRCTimeAndLineArray[i]).IncludeOffset(offsetInt)); + } + + simpleLRCTimeAndLineCollectionWithOffset = new SimpleLRCTimeAndLineCollection((SimpleLRCTimeAndLine[])simpleLRCTimeAndLineArrayWithOffset.ToArray(typeof(SimpleLRCTimeAndLine))); + } + else + { + simpleLRCTimeAndLineCollectionWithOffset = simpleLRCTimeAndLineCollection; + } } private bool getLRCinfoFromFile(ref string line, bool originalLine) @@ -107,28 +134,28 @@ int NEXT = 1; int minStart, minLength, secStart, secLength, msecStart, msecLength = 0; - long min, sec, msec = 0; + int min, sec, msec = 0; sec = 0; minStart = NEXT; minLength = m.Value.IndexOf(":") - minStart; - min = long.Parse(m.Value.Substring(minStart, minLength)); + min = int.Parse(m.Value.Substring(minStart, minLength)); secStart = minStart + minLength + NEXT; if (m.Value.IndexOf(".") != -1 && m.Value.IndexOf(".") < m.Value.IndexOf("]")) { secLength = m.Value.IndexOf(".") - secStart; - sec = long.Parse(m.Value.Substring(secStart, secLength)); + sec = int.Parse(m.Value.Substring(secStart, secLength)); msecStart = secStart + secLength + NEXT; msecLength = m.Value.IndexOf("]") - msecStart; - msec = long.Parse(m.Value.Substring(msecStart, msecLength)); + msec = int.Parse(m.Value.Substring(msecStart, msecLength)); } else { secLength = m.Value.IndexOf("]") - secStart; - sec = long.Parse(m.Value.Substring(secStart, secLength)); + sec = int.Parse(m.Value.Substring(secStart, secLength)); } string lineTemp = lineWithNewLine; @@ -165,6 +192,13 @@ album = LyricsEngine.LyricUtil.CapatalizeString((album.Substring(0, album.LastIndexOf("]")))); return true; } + + else if ((m = LRC.SimpleLRCFormat.OffsetLineStartRegex.Match(line)).Success) + { + offset = line.Substring(m.Index + m.Length); + offset = LyricsEngine.LyricUtil.CapatalizeString((offset.Substring(0, offset.LastIndexOf("]")))); + return true; + } else { return true; @@ -187,6 +221,11 @@ get { return album; } } + public string Offset + { + get { return offset; } + } + public string Lyric { get { return lyric; } @@ -197,10 +236,11 @@ get { return isValid; } } - public SimpleLRCTimeAndLineCollection SimpleLRCTimeAndLineCollection + public SimpleLRCTimeAndLineCollection SimpleLRCTimeAndLineCollectionWithOffset { - get { return simpleLRCTimeAndLineCollection; } + get { return simpleLRCTimeAndLineCollectionWithOffset; } } + #endregion } } Modified: trunk/plugins/MyLyrics/LyricsEngine/LRC/SimpleLRCFormat.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LRC/SimpleLRCFormat.cs 2009-05-10 22:18:04 UTC (rev 2859) +++ trunk/plugins/MyLyrics/LyricsEngine/LRC/SimpleLRCFormat.cs 2009-05-12 15:49:36 UTC (rev 2860) @@ -9,6 +9,7 @@ { public static Regex ArtistLineStartRegex = new Regex(@"\[ar\w*\:", RegexOptions.IgnoreCase); public static Regex TitleLineStartRegex = new Regex(@"\[ti\w*\:", RegexOptions.IgnoreCase); + public static Regex OffsetLineStartRegex = new Regex(@"\[offset\w*\:", RegexOptions.IgnoreCase); public static Regex AlbumLineStartRegex = new Regex(@"\[al\w*\:", RegexOptions.IgnoreCase); public static Regex LineLineRegex = new Regex(@"\[\d+:\d+\.*\d*\]"); } Modified: trunk/plugins/MyLyrics/LyricsEngine/LRC/SimpleLRCTimeAndLine.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LRC/SimpleLRCTimeAndLine.cs 2009-05-10 22:18:04 UTC (rev 2859) +++ trunk/plugins/MyLyrics/LyricsEngine/LRC/SimpleLRCTimeAndLine.cs 2009-05-12 15:49:36 UTC (rev 2860) @@ -6,10 +6,10 @@ { public class SimpleLRCTimeAndLine : IComparable { - long min, sec, msec; + int min, sec, msec; string line; - public SimpleLRCTimeAndLine(long min, long sec, long msec, string line) + public SimpleLRCTimeAndLine(int min, int sec, int msec, string line) { this.min = min; this.sec = sec; @@ -17,6 +17,27 @@ this.line = line; } + public SimpleLRCTimeAndLine IncludeOffset(int offset) + { + if ((this.min * 60 * 1000 + this.sec * 1000 + this.msec) < offset) + { + this.min = 0; + this.sec = 0; + this.msec = 0; + return this; + } + + DateTime time = new DateTime(1111, 11, 11, 0, this.min, this.sec, this.msec); + time = time.AddMilliseconds(-offset); + + this.min = time.Minute; + this.sec = time.Second; + this.msec = time.Millisecond; + + return this; + } + + public long Time { get { return min * 60 * 1000 + sec * 1000 + msec; } @@ -24,7 +45,8 @@ public string TimeString { - get { return min.ToString() + ":" + sec.ToString() + "." + msec.ToString(); } + get { return "[" + min.ToString() + ":" + (sec.ToString().Length == 2 ? sec.ToString() : "0" + sec.ToString()) + "." + (msec.ToString().Length >= 2 ? msec.ToString().Substring(0, 2) : msec.ToString() + "0") + "]"; } + } public string Line Modified: trunk/plugins/MyLyrics/LyricsEngine/LRC/SimpleLRCTimeAndLineCollection.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LRC/SimpleLRCTimeAndLineCollection.cs 2009-05-10 22:18:04 UTC (rev 2859) +++ trunk/plugins/MyLyrics/LyricsEngine/LRC/SimpleLRCTimeAndLineCollection.cs 2009-05-12 15:49:36 UTC (rev 2860) @@ -11,6 +11,11 @@ private object[] items; + public SimpleLRCTimeAndLineCollection() + { + + } + public SimpleLRCTimeAndLineCollection(object[] array) { items = array; Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricSearch.cs =================================================================== (Binary files differ) Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsController.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsController.cs 2009-05-10 22:18:04 UTC (rev 2859) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsController.cs 2009-05-12 15:49:36 UTC (rev 2860) @@ -179,7 +179,6 @@ internal void StatusUpdate(string artist, string title, string site, bool lyricFound) { - //LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Information, 0, LyricDiagnostics.elapsedTimeString() + artist + " - " + title + " - " + site + " - " +lyricFound.ToString() ); if (lyricFound) ++m_noOfLyricsFound; else Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Actionext.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Actionext.cs 2009-05-10 22:18:04 UTC (rev 2859) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Actionext.cs 2009-05-12 15:49:36 UTC (rev 2860) @@ -26,8 +26,6 @@ this.timeLimit = timeLimit; timer = new System.Timers.Timer(); - if (LyricDiagnostics.TraceSource != null) LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Information, 0, LyricDiagnostics.ElapsedTimeString() + "Actionext(" + artist + ", " + title + ")"); - artist = LyricUtil.RemoveFeatComment(artist); artist = LyricUtil.TrimForParenthesis(artist); artist = artist.Replace(" ", "_"); Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/HotLyrics.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/HotLyrics.cs 2009-05-10 22:18:04 UTC (rev 2859) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/HotLyrics.cs 2009-05-12 15:49:36 UTC (rev 2860) @@ -26,8 +26,6 @@ this.timeLimit = timeLimit / 2; timer = new System.Timers.Timer(); - if (LyricDiagnostics.TraceSource != null) LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Information, 0, LyricDiagnostics.ElapsedTimeString() + "SeekLyrics(" + artist + ", " + title + ")"); - artist = LyricUtil.RemoveFeatComment(artist); artist = LyricUtil.TrimForParenthesis(artist); artist = LyricUtil.CapatalizeString(artist); Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LrcFinder.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LrcFinder.cs 2009-05-10 22:18:04 UTC (rev 2859) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LrcFinder.cs 2009-05-12 15:49:36 UTC (rev 2860) @@ -4,6 +4,8 @@ using System.Threading; using LyricsEngine.lrcfinder; using LyricsEngine; +using System.Data; +using System.Diagnostics; namespace LyricsEngine.LyricSites { @@ -13,14 +15,15 @@ private string artist = ""; private string title = ""; public static bool Abort; + public static string Domain = null; public LrcFinder() { - lrcFinder = new lrcfinder.LrcFinder(); + } - public string LrcFinderSearch(string artist, string title) + public string FindLRC(string artist, string title) { this.artist = artist; this.title = title; @@ -29,18 +32,32 @@ if (Abort == false) { + lrcFinder = new lrcfinder.LrcFinder(); + try { + if (string.IsNullOrEmpty(Domain)) + { + string[] domains = lrcFinder.NewDomain(); + Random r = new Random(); + Domain = domains[r.Next(domains.Length)] as string; + } + + lrcFinder.Url = Domain + @"/LrcFinder.asmx"; + lrcFinder.RequestEncoding = Encoding.UTF8; + lrc = lrcFinder.FindLRC(this.artist, this.title); } - catch + catch (Exception e) { lrc = "Not found"; } } - if (IsLyric(lrc)) + if (LrcReturned(lrc)) { + //Encoding iso8859 = Encoding.GetEncoding("ISO-8859-1"); + //string make = Encoding.UTF8.GetString(iso8859.GetBytes(lrc)); return lrc; } else @@ -49,8 +66,38 @@ } } + public DataTable FindLRCs(string artist, string title) + { + this.artist = artist; + this.title = title; - private bool IsLyric(string lrc) + DataTable lrcs = null; + + if (Abort == false) + { + lrcFinder = new lrcfinder.LrcFinder(); + + try + { + if (string.IsNullOrEmpty(Domain)) + { + string[] domains = lrcFinder.NewDomain(); + Random r = new Random(); + Domain = domains[r.Next(domains.Length)] as string; + } + + lrcs = lrcFinder.FindLRCs(this.artist, this.title); + } + catch + { + //lrcs = null; + } + } + + return lrcs; + } + + private bool LrcReturned(string lrc) { if (!lrc.Equals("Not found") && !lrc.Equals("NOT FOUND") && lrc.Length != 0) { @@ -62,10 +109,19 @@ } } - public bool SaveLyric(string lrcFile) + public bool SaveLrc(string lrcFile) { + lrcFinder = new lrcfinder.LrcFinder(); + try { + if (string.IsNullOrEmpty(Domain)) + { + string[] domains = lrcFinder.NewDomain(); + Random r = new Random(); + Domain = domains[r.Next(domains.Length)] as string; + } + string result = lrcFinder.SaveLRC(lrcFile); return result.Equals("DONE"); } Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyrDB.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyrDB.cs 2009-05-10 22:18:04 UTC (rev 2859) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyrDB.cs 2009-05-12 15:49:36 UTC (rev 2860) @@ -29,8 +29,6 @@ m_EventStop_SiteSearches = eventStop_SiteSearches; - if (LyricDiagnostics.TraceSource != null) LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Information, 0, LyricDiagnostics.ElapsedTimeString() + "LyrDB(" + artist + ", " + title + ")"); - artist = LyricUtil.RemoveFeatComment(artist); artist = LyricUtil.TrimForParenthesis(artist); title = LyricUtil.RemoveFeatComment(title); Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Lyrics007.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Lyrics007.cs 2009-05-10 22:18:04 UTC (rev 2859) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Lyrics007.cs 2009-05-12 15:49:36 UTC (rev 2860) @@ -27,8 +27,6 @@ this.timeLimit = timeLimit / 2; timer = new System.Timers.Timer(); - if (LyricDiagnostics.TraceSource != null) LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Information, 0, LyricDiagnostics.ElapsedTimeString() + "Lyrics007(" + artist + ", " + title + ")"); - artist = LyricUtil.RemoveFeatComment(artist); artist = LyricUtil.TrimForParenthesis(artist); artist = artist.Replace("#", ""); Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyricsOnDemand.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyricsOnDemand.cs 2009-05-10 22:18:04 UTC (rev 2859) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyricsOnDemand.cs 2009-05-12 15:49:36 UTC (rev 2860) @@ -26,8 +26,6 @@ this.timeLimit = timeLimit; timer = new System.Timers.Timer(); - if (LyricDiagnostics.TraceSource != null) LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Information, 0, LyricDiagnostics.ElapsedTimeString() + "LyricsOnDemand(" + artist + ", " + title + ")"); - artist = LyricUtil.RemoveFeatComment(artist); artist = LyricUtil.TrimForParenthesis(artist); artist = LyricUtil.DeleteSpecificChars(artist); Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/SeekLyrics.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/SeekLyrics.cs 2009-05-10 22:18:04 UTC (rev 2859) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/SeekLyrics.cs 2009-05-12 15:49:36 UTC (rev 2860) @@ -27,8 +27,6 @@ this.timeLimit = timeLimit; timer = new System.Timers.Timer(); - if (LyricDiagnostics.TraceSource != null) LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Information, 0, LyricDiagnostics.ElapsedTimeString() + "SeekLyrics(" + artist + ", " + title + ")"); - artist = LyricUtil.RemoveFeatComment(artist); artist = LyricUtil.TrimForParenthesis(artist); artist = artist.Replace(" ", "-"); Modified: trunk/plugins/MyLyrics/LyricsEngine/Web References/org.lyricwiki/Reference.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/Web References/org.lyricwiki/Reference.cs 2009-05-10 22:18:04 UTC (rev 2859) +++ trunk/plugins/MyLyrics/LyricsEngine/Web References/org.lyricwiki/Reference.cs 2009-05-12 15:49:36 UTC (rev 2860) @@ -47,12 +47,16 @@ private System.Threading.SendOrPostCallback getAlbumOperationCompleted; + private System.Threading.SendOrPostCallback getHometownOperationCompleted; + private System.Threading.SendOrPostCallback postArtistOperationCompleted; private System.Threading.SendOrPostCallback postAlbumOperationCompleted; private System.Threading.SendOrPostCallback postSongOperationCompleted; + private System.Threading.SendOrPostCallback postSong_flagsOperationCompleted; + private bool useDefaultCredentialsSetExplicitly; /// <remarks/> @@ -119,6 +123,9 @@ public event getAlbumCompletedEventHandler getAlbumCompleted; /// <remarks/> + public event getHometownCompletedEventHandler getHometownCompleted; + + /// <remarks/> public event postArtistCompletedEventHandler postArtistCompleted; /// <remarks/> @@ -128,6 +135,9 @@ public event postSongCompletedEventHandler postSongCompleted; /// <remarks/> + public event postSong_flagsCompletedEventHandler postSong_flagsCompleted; + + /// <remarks/> [System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:LyricWiki#checkSongExists", RequestNamespace="urn:LyricWiki", ResponseNamespace="urn:LyricWiki")] [return: System.Xml.Serialization.SoapElementAttribute("return")] public bool checkSongExists(string artist, string song) { @@ -417,6 +427,38 @@ } /// <remarks/> + [System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:LyricWiki#getHometown", RequestNamespace="urn:LyricWiki", ResponseNamespace="urn:LyricWiki")] + [return: System.Xml.Serialization.SoapElementAttribute("country")] + public string getHometown(string artist, out string state, out string hometown) { + object[] results = this.Invoke("getHometown", new object[] { + artist}); + state = ((string)(results[1])); + hometown = ((string)(results[2])); + return ((string)(results[0])); + } + + /// <remarks/> + public void getHometownAsync(string artist) { + this.getHometownAsync(artist, null); + } + + /// <remarks/> + public void getHometownAsync(string artist, object userState) { + if ((this.getHometownOperationCompleted == null)) { + this.getHometownOperationCompleted = new System.Threading.SendOrPostCallback(this.OngetHometownOperationCompleted); + } + this.InvokeAsync("getHometown", new object[] { + artist}, this.getHometownOperationCompleted, userState); + } + + private void OngetHometownOperationCompleted(object arg) { + if ((this.getHometownCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.getHometownCompleted(this, new getHometownCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// <remarks/> [System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:LyricWiki#postArtist", RequestNamespace="urn:LyricWiki", ResponseNamespace="urn:LyricWiki")] [return: System.Xml.Serialization.SoapElementAttribute("dataUsed")] public bool postArtist(bool overwriteIfExists, ref string artist, string[] albums, out string message) { @@ -538,6 +580,49 @@ } /// <remarks/> + [System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:LyricWiki#postSong_flags", RequestNamespace="urn:LyricWiki", ResponseNamespace="urn:LyricWiki")] + [return: System.Xml.Serialization.SoapElementAttribute("dataUsed")] + public bool postSong_flags(bool overwriteIfExists, ref string artist, ref string song, string lyrics, string[] onAlbums, string flags, out string message) { + object[] results = this.Invoke("postSong_flags", new object[] { + overwriteIfExists, + artist, + song, + lyrics, + onAlbums, + flags}); + artist = ((string)(results[1])); + song = ((string)(results[2])); + message = ((string)(results[3])); + return ((bool)(results[0])); + } + + /// <remarks/> + public void postSong_flagsAsync(bool overwriteIfExists, string artist, string song, string lyrics, string[] onAlbums, string flags) { + this.postSong_flagsAsync(overwriteIfExists, artist, song, lyrics, onAlbums, flags, null); + } + + /// <remarks/> + public void postSong_flagsAsync(bool overwriteIfExists, string artist, string song, string lyrics, string[] onAlbums, string flags, object userState) { + if ((this.postSong_flagsOperationCompleted == null)) { + this.postSong_flagsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnpostSong_flagsOperationCompleted); + } + this.InvokeAsync("postSong_flags", new object[] { + overwriteIfExists, + artist, + song, + lyrics, + onAlbums, + flags}, this.postSong_flagsOperationCompleted, userState); + } + + private void OnpostSong_flagsOperationCompleted(object arg) { + if ((this.postSong_flagsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.postSong_flagsCompleted(this, new postSong_flagsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// <remarks/> public new void CancelAsync(object userState) { base.CancelAsync(userState); } @@ -603,6 +688,8 @@ private string lyricsField; + private string urlField; + /// <remarks/> public string artist { get { @@ -632,6 +719,16 @@ this.lyricsField = value; } } + + /// <remarks/> + public string url { + get { + return this.urlField; + } + set { + this.urlField = value; + } + } } /// <remarks/> @@ -979,6 +1076,48 @@ /// <remarks/> [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1434")] + public delegate void getHometownCompletedEventHandler(object sender, getHometownCompletedEventArgs e); + + /// <remarks/> + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1434")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class getHometownCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal getHometownCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// <remarks/> + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + + /// <remarks/> + public string state { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[1])); + } + } + + /// <remarks/> + public string hometown { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[2])); + } + } + } + + /// <remarks/> + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1434")] public delegate void postArtistCompletedEventHandler(object sender, postArtistCompletedEventArgs e); /// <remarks/> @@ -1126,6 +1265,56 @@ } } } + + /// <remarks/> + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1434")] + public delegate void postSong_flagsCompletedEventHandler(object sender, postSong_flagsCompletedEventArgs e); + + /// <remarks/> + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1434")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class postSong_flagsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal postSong_flagsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// <remarks/> + public bool Result { + get { + this.RaiseExceptionIfNecessary(); + return ((bool)(this.results[0])); + } + } + + /// <remarks/> + public string artist { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[1])); + } + } + + /// <remarks/> + public string song { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[2])); + } + } + + /// <remarks/> + public string message { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[3])); + } + } + } } #pragma warning restore 1591 \ No newline at end of file Modified: trunk/plugins/MyLyrics/LyricsEngine/Web References/org.lyricwiki/server.wsdl =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/Web References/org.lyricwiki/server.wsdl 2009-05-10 22:18:04 UTC (rev 2859) +++ trunk/plugins/MyLyrics/LyricsEngine/Web References/org.lyricwiki/server.wsdl 2009-05-12 15:49:36 UTC (rev 2860) @@ -36,6 +36,7 @@ <xsd:element name="artist" type="xsd:string" /> <xsd:element name="song" type="xsd:string" /> <xsd:element name="lyrics" type="xsd:string" /> + <xsd:element name="url" type="xsd:string" /> </xsd:all> </xsd:complexType> <xsd:complexType name="SOTDResult"> @@ -129,6 +130,14 @@ <wsdl:part name="amazonLink" type="xsd:string" /> <wsdl:part name="songs" type="tns:ArrayOfstring" /> </wsdl:message> + <wsdl:message name="getHometownRequest"> + <wsdl:part name="artist" type="xsd:string" /> + </wsdl:message> + <wsdl:message name="getHometownResponse"> + <wsdl:part name="country" type="xsd:string" /> + <wsdl:part name="state" type="xsd:string" /> + <wsdl:part name="hometown" type="xsd:string" /> + </wsdl:message> <wsdl:message name="postArtistRequest"> <wsdl:part name="overwriteIfExists" type="xsd:boolean" /> <wsdl:part name="artist" type="xsd:string" /> @@ -167,6 +176,20 @@ <wsdl:part name="dataUsed" type="xsd:boolean" /> <wsdl:part name="message" type="xsd:string" /> </wsdl:message> + <wsdl:message name="postSong_flagsRequest"> + <wsdl:part name="overwriteIfExists" type="xsd:boolean" /> + <wsdl:part name="artist" type="xsd:string" /> + <wsdl:part name="song" type="xsd:string" /> + <wsdl:part name="lyrics" type="xsd:string" /> + <wsdl:part name="onAlbums" type="tns:AlbumResultArray" /> + <wsdl:part name="flags" type="xsd:string" /> + </wsdl:message> + <wsdl:message name="postSong_flagsResponse"> + <wsdl:part name="artist" type="xsd:string" /> + <wsdl:part name="song" type="xsd:string" /> + <wsdl:part name="dataUsed" type="xsd:boolean" /> + <wsdl:part name="message" type="xsd:string" /> + </wsdl:message> <wsdl:portType name="LyricWikiPortType"> <wsdl:operation name="checkSongExists"> <documentation>Check if a song exists in the LyricWiki database yet</documentation> @@ -213,6 +236,11 @@ <wsdl:input message="tns:getAlbumRequest" /> <wsdl:output message="tns:getAlbumResponse" /> </wsdl:operation> + <wsdl:operation name="getHometown"> + <documentation>Gets the hometown for an artist</documentation> + <wsdl:input message="tns:getHometownRequest" /> + <wsdl:output message="tns:getHometownResponse" /> + </wsdl:operation> <wsdl:operation name="postArtist"> <documentation>Posts data of an artist and their discography. Will create any missing album pages based on the data passed in.</documentation> <wsdl:input message="tns:postArtistRequest" /> @@ -228,6 +256,11 @@ <wsdl:input message="tns:postSongRequest" /> <wsdl:output message="tns:postSongResponse" /> </wsdl:operation> + <wsdl:operation name="postSong_flags"> + <documentation>Posts data for a single song. If correcting exiting lyrics, make sure overwriteIfExists is set to true. In the onAlbums array, if artist is left blank, it will default to the artist of the song.For the flags parameter, this is a comma-separated list of flags. For example, pass 'LW_SANDBOX' in to use the sandbox for testing and not actually update the site.</documentation> + <wsdl:input message="tns:postSong_flagsRequest" /> + <wsdl:output message="tns:postSong_flagsResponse" /> + </wsdl:operation> </wsdl:portType> <wsdl:binding name="LyricWikiBinding" type="tns:LyricWikiPortType"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc" /> @@ -312,6 +345,15 @@ <soap:body use="encoded" namespace="urn:LyricWiki" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> </wsdl:output> </wsdl:operation> + <wsdl:operation name="getHometown"> + <soap:operation soapAction="urn:LyricWiki#getHometown" style="rpc" /> + <wsdl:input> + <soap:body use="encoded" namespace="urn:LyricWiki" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> + </wsdl:input> + <wsdl:output> + <soap:body use="encoded" namespace="urn:LyricWiki" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> + </wsdl:output> + </wsdl:operation> <wsdl:operation name="postArtist"> <soap:operation soapAction="urn:LyricWiki#postArtist" style="rpc" /> <wsdl:input> @@ -339,6 +381,15 @@ <soap:body use="encoded" namespace="urn:LyricWiki" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> </wsdl:output> </wsdl:operation> + <wsdl:operation name="postSong_flags"> + <soap:operation soapAction="urn:LyricWiki#postSong_flags" style="rpc" /> + <wsdl:input> + <soap:body use="encoded" namespace="urn:LyricWiki" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> + </wsdl:input> + <wsdl:output> + <soap:body use="encoded" namespace="urn:LyricWiki" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> + </wsdl:output> + </wsdl:operation> </wsdl:binding> <wsdl:service name="LyricWiki"> <wsdl:port name="LyricWikiPort" binding="tns:LyricWikiBinding"> Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.cs 2009-05-10 22:18:04 UTC (rev 2859) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.cs 2009-05-12 15:49:36 UTC (rev 2860) @@ -366,7 +366,7 @@ if (lrc.IsValid && parent.cbUploadLrcAutomatically.Checked) { LyricsEngine.LyricSites.LrcFinder lrcFinder = new LyricsEngine.LyricSites.LrcFinder(); - lrcFinder.SaveLyric(lyrics); + lrcFinder.SaveLrc(lyrics); } btSave.Enabled = false; Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.cs 2009-05-10 22:18:04 UTC (rev 2859) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.cs 2009-05-12 15:49:36 UTC (rev 2860) @@ -296,7 +296,7 @@ m_noOfSearchesToComplete -= m_noOfSearchesCompleted; m_noOfSearchesCompleted = 0; m_noOfCurrentlySearches = 0; - + if (bwOnlineSearch.IsBusy) { Thread.Sleep(2000); @@ -396,7 +396,7 @@ lbStats.Text = string.Format("Lyrics: {0} - Lyrics in LyricsDB: {1} - Lyrics in MarkedDB: {2}", lvSongs.Items.Count, lyricsInLyricDB, lyricsInMarkedDB); } - private void ChangeSearchingSubItemsToCancelled() + private void ChangeStatusOnSubItems(bool cancelled) { foreach (ListViewItem lvi in lvSelectedSongs.Items) { @@ -404,16 +404,23 @@ { string artist = lvi.SubItems[0].Text; string title = lvi.SubItems[1].Text; - if (DatabaseUtil.IsTrackInLyricsMarkedDatabase(MyLyricsSettings.LyricsMarkedDB, artist, title).Equals(DatabaseUtil.LYRIC_FOUND)) + if (DatabaseUtil.IsTrackInLyricsMarkedDatabase(MyLyricsSettings.LyricsMarkedDB, artist, title).Equals(DatabaseUtil.LYRIC_MARKED)) { lvi.SubItems[2].Text = "MarkedDB"; + if (cancelled) + { + lvi.SubItems[3].Text = "-"; + } + else + { + lvi.SubItems[3].Text = "miss"; + } } else { lvi.SubItems[2].Text = "-"; + lvi.SubItems[3].Text = "-"; } - - lvi.SubItems[3].Text = "-"; } } } @@ -524,6 +531,7 @@ lvi.ImageIndex = 0; lvi.SubItems[2].Text = "LyricsDB"; lvi.SubItems[3].Text = "OK"; + lvi.EnsureVisible(); string capArtist = LyricUtil.CapatalizeString(artist); string capTitle = LyricUtil.CapatalizeString(title); @@ -543,16 +551,13 @@ } m_noOfCurrentlySearches -= 1; + ++m_noOfSearchesCompleted; - if (++m_noOfSearchesCompleted == m_noOfSearchesToComplete) - { - ChangeButtonsEnableState(); - RefreshSongsListView(); - } - break; } } + + //lvSelectedSongs.Update(); } private void lyricNotFoundMethod(String artist, String title, String message, String site) @@ -564,6 +569,7 @@ { lvi.SubItems[2].Text = "MarkedDB"; lvi.SubItems[3].Text = "miss"; + lvi.EnsureVisible(); string capArtist = LyricUtil.CapatalizeString(artist); string capTitle = LyricUtil.CapatalizeString(title); @@ -575,16 +581,13 @@ DatabaseUtil.SerializeLyricMarkedDB(); m_noOfCurrentlySearches -= 1; + ++m_noOfSearchesCompleted; - if (++m_noOfSearchesCompleted == m_noOfSearchesToComplete) - { - ChangeButtonsEnableState(); - RefreshSongsListView(); - } - break; } } + + //lvSelectedSongs.Update(); } @@ -592,11 +595,16 @@ // Called from worker thread using delegate and Control.Invoke private void ThreadFinishedMethod(string artist, string title, string message, string site) { - ; + ChangeButtonsEnableState(); + RefreshSongsListView(); + ChangeStatusOnSubItems(false); + + lvSelectedSongs.Update(); } private void ThreadExceptionMethod(Object o) { + lvSelectedSongs.Update(); } #endregion @@ -717,7 +725,7 @@ Thread.Sleep(500); RefreshSongsListView(); RefreshArtistStats(); - ChangeSearchingSubItemsToCancelled(); + ChangeStatusOnSubItems(true); } Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs 2009-05-10 22:18:04 UTC (rev 2859) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs 2009-05-12 15:49:36 UTC (rev 2860) @@ -75,7 +75,11 @@ this.lbLyricsFound = new MediaPortal.UserInterface.Controls.MPLabel(); this.tabPageSetup = new MediaPortal.UserInterface.Controls.MPTabPage(); this.gbLrc = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.tbLrcTaggingName = new MediaPortal.UserInterface.Controls.MPTextBox(); + this.lbLrcTaggingName = new MediaPortal.UserInterface.Controls.MPLabel(); + this.tbLrcTaggingOffset = new MediaPortal.UserInterface.Controls.MPTextBox(); this.cbUploadLrcAutomatically = new MediaPortal.UserInterface.Controls.MPCheckBox(); + this.lbLrcTaggingOffset = new MediaPortal.UserInterface.Controls.MPLabel(); this.gbGUI = new MediaPortal.UserInterface.Controls.MPGroupBox(); this.tbLyricsLimit = new MediaPortal.UserInterface.Controls.MPTextBox(); this.cbAutoChangeToLineLimit = new MediaPortal.UserInterface.Controls.MPCheckBox(); @@ -624,15 +628,52 @@ // // gbLrc // + this.gbLrc.Controls.Add(this.tbLrcTaggingName); + this.gbLrc.Controls.Add(this.lbLrcTaggingName); + this.gbLrc.Controls.Add(this.tbLrcTaggingOffset); this.gbLrc.Controls.Add(this.cbUploadLrcAutomatically); + this.gbLrc.Controls.Add(this.lbLrcTaggingOffset); this.gbLrc.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.gbLrc.Location = new System.Drawing.Point(5, 296); + this.gbLrc.Location = new System.Drawing.Point(5, 287); this.gbLrc.Name = "gbLrc"; - this.gbLrc.Size = new System.Drawing.Size(538, 45); + this.gbLrc.Size = new System.Drawing.Size(538, 64); this.gbLrc.TabIndex = 32; this.gbLrc.TabStop = false; this.gbLrc.Text = "LRC settings"; // + // tbLrcTaggingName + // + this.tbLrcTaggingName.BorderColor = System.Drawing.Color.Empty; + this.tbLrcTaggingName.Location = new System.Drawing.Point(355, 39); + this.tbLrcTaggingName.MaxLength = 30; + this.tbLrcTaggingName.Name = "tbLrcTaggingName"; + this.tbLrcTaggingName.Size = new System.Drawing.Size(122, 20); + this.tbLrcTaggingName.TabIndex = 18; + this.tbLrcTaggingName.Leave += new System.EventHandler(this.WriteMediaPortalXML); + // + // lbLrcTaggingName + // + this.lbLrcTaggingName.AutoSize = true; + this.lbLrcTaggingName.Location = new System.Drawing.Point(271, 42); + this.lbLrcTaggingName.Name = "lbLrcTaggingName"; + this.lbLrcTaggingName.Size = new System.Drawing.Size(78, 13); + this.lbLrcTaggingName.TabIndex = 17; + this.lbLrcTaggingName.Text = "Tagging name:"; + // + // tbLrcTaggingOffset + // + this.tbLrcTaggingOffset.BorderColor = System.Drawing.Color.Empty; + this.tbLrcTaggingOffset.Location = new System.Drawing.Point(146, 38); + this.tbLrcTaggingOffset.MaximumSize = new System.Drawing.Size(33, 20); + this.tbLrcTaggingOffset.MaxLength = 30; + this.tbLrcTaggingOffset.MinimumSize = new System.Drawing.Size(33, 20); + this.tbLrcTaggingOffset.Name = "tbLrcTaggingOffset"; + this.tbLrcTaggingOffset.RightToLeft = System.Windows.Forms.RightToLeft.Yes; + this.tbLrcTaggingOffset.Size = new System.Drawing.Size(33, 20); + this.tbLrcTaggingOffset.TabIndex = 15; + this.tbLrcTaggingOffset.Text = "0"; + this.tbLrcTaggingOffset.Leave += new System.EventHandler(this.WriteMediaPortalXML); + // // cbUploadLrcAutomatically // this.cbUploadLrcAutomatically.AutoSize = true; @@ -645,6 +686,15 @@ this.cbUploadLrcAutomatically.UseVisualStyleBackColor = true; this.cbUploadLrcAutomatically.MouseLeave += new System.EventHandler(this.WriteMediaPortalXML); // + // lbLrcTaggingOffset + // + this.lbLrcTaggingOffset.AutoSize = true; + this.lbLrcTaggingOffset.Location = new System.Drawing.Point(13, 42); + this.lbLrcTaggingOffset.Name = "lbLrcTaggingOffset"; + this.lbLrcTaggingOffset.Size = new System.Drawing.Size(132, 13); + this.lbLrcTaggingOffset.TabIndex = 16; + this.lbLrcTaggingOffset.Text = "LRC tagging offset (msec):"; + // // gbGUI // this.gbGUI.Controls.Add(this.tbLyricsLimit); @@ -652,9 +702,9 @@ this.gbGUI.Controls.Add(this.lblyricLengthLimit); this.gbGUI.Controls.Add(this.cbUseAutoScrollAsDefault); this.gbGUI.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.gbGUI.Location = new System.Drawing.Point(5, 211); + this.gbGUI.Location = new System.Drawing.Point(5, 196); this.gbGUI.Name = "gbGUI"; - this.gbGUI.Size = new System.Drawing.Size(538, 83); + this.gbGUI.Size = new System.Drawing.Size(538, 87); this.gbGUI.TabIndex = 33; this.gbGUI.TabStop = false; this.gbGUI.Text = "Gui settings"; @@ -663,10 +713,10 @@ // this.tbLyricsLimit.BorderColor = System.Drawing.Color.Empty; this.tbLyricsLimit.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.tbLyricsLimit.Location = new System.Drawing.Point(141, 61); - this.tbLyricsLimit.MaximumSize = new System.Drawing.Size(24, 14); + this.tbLyricsLimit.Location = new System.Drawing.Point(146, 59); + this.tbLyricsLimit.MaximumSize = new System.Drawing.Size(24, 18); this.tbLyricsLimit.MaxLength = 30; - this.tbLyricsLimit.MinimumSize = new System.Drawing.Size(24, 14); + this.tbLyricsLimit.MinimumSize = new System.Drawing.Size(24, 18); this.tbLyricsLimit.Name = "tbLyricsLimit"; this.tbLyricsLimit.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.tbLyricsLimit.Size = new System.Drawing.Size(24, 18); @@ -678,7 +728,7 @@ // this.cbAutoChangeToLineLimit.AutoSize = true; this.cbAutoChangeToLineLimit.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.cbAutoChangeToLineLimit.Location = new System.Drawing.Point(16, 42); + this.cbAutoChangeToLineLimit.Location = new System.Drawing.Point(16, 41); this.cbAutoChangeToLineLimit.Name = "cbAutoChangeToLineLimit"; this.cbAutoChangeToLineLimit.Size = new System.Drawing.Size(443, 17); this.cbAutoChangeToLineLimit.TabIndex = 7; @@ -692,7 +742,7 @@ // this.lblyricLengthLimit.AutoSize = true; this.lblyricLengthLimit.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblyricLengthLimit.Location = new System.Drawing.Point(38, 62); + this.lblyricLengthLimit.Location = new System.Drawing.Point(38, 60); this.lblyricLengthLimit.Name = "lblyricLengthLimit"; this.lblyricLengthLimit.Size = new System.Drawing.Size(103, 13); this.lblyricLengthLimit.TabIndex = 16; @@ -715,9 +765,9 @@ this.gbTag.Controls.Add(this.cbMusicTagAlwaysCheck); this.gbTag.Controls.Add(this.cbMusicTagWrite); this.gbTag.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.gbTag.Location = new System.Drawing.Point(5, 347); + this.gbTag.Location = new System.Drawing.Point(5, 357); this.gbTag.Name = "gbTag"; - this.gbTag.Size = new System.Drawing.Size(538, 45); + this.gbTag.Size = new System.Drawing.Size(538, 44); this.gbTag.TabIndex = 31; this.gbTag.TabStop = false; this.gbTag.Text = "Music tags"; @@ -752,7 +802,7 @@ this.mpGroupBox3.Controls.Add(this.cbMoveSongFrom); this.mpGroupBox3.Controls.Add(this.cbAutoFetch); this.mpGroupBox3.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.mpGroupBox3.Location = new System.Drawing.Point(5, 398); + this.mpGroupBox3.Location = new System.Drawing.Point(5, 406); this.mpGroupBox3.Name = "mpGroupBox3"; this.mpGroupBox3.Size = new System.Drawing.Size(538, 69); this.mpGroupBox3.TabIndex = 30; @@ -806,7 +856,7 @@ this.mpGroupBox2.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.mpGroupBox2.Location = new System.Drawing.Point(5, 5); this.mpGroupBox2.Name = "mpGroupBox2"; - this.mpGroupBox2.Size = new System.Drawing.Size(538, 50); + this.mpGroupBox2.Size = new System.Drawing.Size(538, 46); this.mpGroupBox2.TabIndex = 29; this.mpGroupBox2.TabStop = false; this.mpGroupBox2.Text = "Basic settings"; @@ -839,9 +889,9 @@ this.gbLyricSites.Controls.Add(this.rdLyricsMode); this.gbLyricSites.Controls.Add(this.rbUserSelectMode); this.gbLyricSites.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.gbLyricSites.Location = new System.Drawing.Point(5, 61); + this.gbLyricSites.Location = new System.Drawing.Point(5, 52); this.gbLyricSites.Name = "gbLyricSites"; - this.gbLyricSites.Size = new System.Drawing.Size(538, 144); + this.gbLyricSites.Size = new System.Drawing.Size(538, 142); this.gbLyricSites.TabIndex = 28; this.gbLyricSites.TabStop = false; this.gbLyricSites.Text = "Lyrics search mode"; @@ -1053,8 +1103,8 @@ this.rbUserSelectMode.Name = "rbUserSelectMode"; this.rbUserSelectMode.Size = new System.Drawing.Size(107, 17); this.rbUserSelectMode.TabIndex = 22; - this.rbUserSelectMode.Tag = "User select mode"; - this.rbUserSelectMode.Text = "User select mode"; + this.rbUserSelectMode.Tag = "Custom mode"; + this.rbUserSelectMode.Text = "Custom mode"; this.rbUserSelectMode.UseVisualStyleBackColor = true; this.rbUserSelectMode.Leave += new System.EventHandler(this.WriteMediaPortalXML); this.rbUserSelectMode.CheckedChanged += new System.EventHandler(this.rdTrackBar_CheckedChanged); @@ -1284,5 +1334,9 @@ private System.Windows.Forms.RadioButton rbLrcMode; private MediaPortal.UserInterface.Controls.MPGroupBox gbLrc; internal MediaPortal.UserInterface.Controls.MPCheckBox cbUploadLrcAutomatically; + private MediaPortal.UserInterface.Controls.MPTextBox tbLrcTaggingOffset; + private MediaPortal.UserInterface.Controls.MPLabel lbLrcTaggingOffset; + private MediaPortal.UserInterface.Controls.MPTextBox tbLrcTaggingName; + private MediaPortal.UserInterface.Controls.MPLabel lbLrcTaggingName; } } \ 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 2009-05-10 22:18:04 UTC (rev 2859) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.cs 2009-05-12 15:49:36 UTC (rev 2860) @@ -85,7 +85,7 @@ string[] m_strippedPrefixStrings; - const int m_NoOfCurrentSearchesAllowed = 6; + const int m_NoOfCurrentSearchesAllowed = 8; int m_Limit = 100; // Collections and arrays @@ -116,8 +116,6 @@ public MyLyricsSetup() { - //LyricDiagnostics.OpenLog(MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Log, MyLyricsSettings.LogName)); - #region Initialize GUI and class InitializeComponent(); lyricsLibraryUC = new LyricsLibrary(this); @@ -279,6 +277,8 @@ cbUseAutoScrollAsDefault.Checked = xmlreader.GetValue("myLyrics", "useAutoscroll").Equals("yes"); cbAutoChangeToLineLimit.Checked = xmlreader.GetValue("myLyrics", "useAutoOnLyricLength").Equals("yes"); tbLyricsLimit.Text = xmlreader.GetValueAsString("myLyrics", "AutoLyricLength", "45"); + tbLrcTaggingOffset.Text = xmlreader.GetValueAsString("myLyrics", "LrcTaggingOffset", "0"); + tbLrcTaggingName.Text = xmlreader.GetValueAsString("myLyrics", "LrcTaggingName", ""); cbUploadLrcAutomatically.Checked = xmlreader.GetValue("myLyrics", "uploadLrcToLrcFinder").Equals("yes"); @@ -635,6 +635,7 @@ this.Invoke(m_DelegateLyricFound, value); } } + public Object[] LyricNotFound { set @@ -959,7 +960,7 @@ private void MyLyricsSetup_FormClosing(object sender, FormClosingEventArgs e) { - LyricDiagnostics.Dispose(); + //LyricDiagnostics.Dispose(); } private void timer_Tick(object sender, EventArgs e) @@ -1069,7 +1070,11 @@ cbActionext.Checked = true; } - WriteMediaPortalXML(null, null); + if (sender != null) + { + WriteMediaPortalXML(null, null); + } + } private void trackBar_ValueChanged(object sender, EventArgs e) @@ -1185,6 +1190,8 @@ xmlwriter.SetValueAsBool("myLyrics", "useAutoOnLyricLength", cbAutoChangeToLineLimit.Checked); xmlwriter.SetValue("myLyrics", "AutoLyricLength", tbLyricsLimit.Text); xmlwriter.SetValueAsBool("myLyrics", "uploadLrcToLrcFinder", cbUploadLrcAutomatically.Checked); + xmlwriter.SetValue("myLyrics", "LrcTaggingOffset", tbLrcTaggingOffset.Text); + xmlwriter.SetValue("myLyrics", "LrcTaggingName", tbLrcTaggingName.Text); xmlwriter.SetValueAsBool("myLyrics", "automaticFetch", cbAutoFetch.Checked); xmlwriter.SetValueAsBool("myLyrics", "automaticUpdateWhenFirstFound", cbAutomaticUpdate.Checked); xmlwriter.SetValueAsBool("myLyrics", "moveLyricFromMarkedDatabase", cbMoveSongFrom.Checked); Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2009-05-10 22:18:04 UTC (rev 2859) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2009-05-12 15:49:36 UTC (rev 2860) @@ -23,6 +23,7 @@ using MediaPortal.GUI.Music; using System.Collections; +using LyricsEngine.LyricSites; namespace MyLyrics { @@ -37,39 +38,40 @@ public static int WINDOW_MYLYRICS = 90478; - private int selectedScreen = 0; - private Nullable<bool> basicScreenSelected = null; - string lyricsScreenXML = "MyLyrics.xml"; + private int m_selectedScreen = 0; + private Nullable<bool> m_basicScreenSelected = null; + string m_lyricsScreenXML = "MyLyrics.xml"; - int startingScrollSpeedVertical; + int m_startingScrollSpeedVertical; - string skin = ""; + string m_skin = ""; - bool exitingMyLyrics = false; - bool newTrack = false; - bool alreadyValidLRC = false; + bool m_newTrack = false; + bool m_alreadyValidLRC = false; bool m_ValidLrcLyric = false; // A valid LRC-lyric always overwrites a normal lyric in both Lyrics db and music tag (if allowed) - //bool m_OkToCallPreviousMenu = false; + bool m_useLyricWiki, m_useLrcFinder, m_useLyrics007, m_useLyricsOnDemand, m_useSeekLyrics, m_useHotLyrics, m_useActionext, m_useLyrDB; - private string CurrentThumbFileName = string.Empty; - private MusicTag PreviousTrackTag = null; - private MusicTag CurrentTrackTag = null; - private MusicTag NextTrackTag = null; - private bool UseID3 = false; - private List<String> ImagePathContainer = null; - private System.Timers.Timer ImageChangeTimer = null; - private object _imageMutex = null; - private string CurrentTrackFileName = string.Empty; - private string NextTrackFileName = string.Empty; - private PlayListPlayer PlaylistPlayer = null; + private string m_CurrentThumbFileName = string.Empty; + private MusicTag m_PreviousTrackTag = null; + private MusicTag m_CurrentTrackTag = null; + private MusicTag m_NextTrackTag = null; + private bool m_UseID3 = false; + private List<String> m_ImagePathContainer = null; + private System.Timers.Timer m_ImageChangeTimer = null; + private object m_imageMutex = null; + private string m_CurrentTrackFileName = string.Empty; + private string m_NextTrackFileName = string.Empty; + private PlayListPlayer m_PlaylistPlayer = null; private System.Timers.Timer m_WriteTagTimer = null; + private List<string[]> m_LyricsToWriteToTag = null; + // worker thread Thread m_LyricControllerThread; - LyricsController lc; + LyricsController m_lc; // events used to stop worker thread ManualResetEvent m_EventStopThread; @@ -85,24 +87,30 @@ int m_crossfade = 0; + int m_Sear... [truncated message content] |
From: <sa...@us...> - 2009-05-19 14:59:17
|
Revision: 2866 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2866&view=rev Author: saamand Date: 2009-05-19 14:59:09 +0000 (Tue, 19 May 2009) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LrcFinder.cs trunk/plugins/MyLyrics/My Lyrics/DatabaseUtil.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.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 trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LrcFinder.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LrcFinder.cs 2009-05-18 13:35:16 UTC (rev 2865) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LrcFinder.cs 2009-05-19 14:59:09 UTC (rev 2866) @@ -36,16 +36,8 @@ try { - if (string.IsNullOrEmpty(Domain)) - { - string[] domains = lrcFinder.NewDomain(); - Random r = new Random(); - Domain = domains[r.Next(domains.Length)] as string; - } + lrcFinder.Url = GetUrl(); - lrcFinder.Url = Domain + @"/LrcFinder.asmx"; - lrcFinder.RequestEncoding = Encoding.UTF8; - lrc = lrcFinder.FindLRC(this.artist, this.title); } catch (Exception e) @@ -79,12 +71,7 @@ try { - if (string.IsNullOrEmpty(Domain)) - { - string[] domains = lrcFinder.NewDomain(); - Random r = new Random(); - Domain = domains[r.Next(domains.Length)] as string; - } + lrcFinder.Url = GetUrl(); lrcs = lrcFinder.FindLRCs(this.artist, this.title); } @@ -115,12 +102,7 @@ try { - if (string.IsNullOrEmpty(Domain)) - { - string[] domains = lrcFinder.NewDomain(); - Random r = new Random(); - Domain = domains[r.Next(domains.Length)] as string; - } + lrcFinder.Url = GetUrl(); string result = lrcFinder.SaveLRC(lrcFile); return result.Equals("DONE"); @@ -130,5 +112,37 @@ return false; } } + + public bool SaveLrcWithGuid(string lrcFile, Guid guid) + { + lrcFinder = new lrcfinder.LrcFinder(); + + try + { + lrcFinder.Url = GetUrl(); + + string result = lrcFinder.SaveLRCWithGuid(lrcFile, guid); + return result.Equals("DONE"); + } + catch + { + return false; + } + } + + private string GetUrl() + { + Domain = "http://testLRCFinder.profiler.nl"; + + if (string.IsNullOrEmpty(Domain)) + { + string[] domains = lrcFinder.NewDomain(); + Random r = new Random(); + Domain = domains[r.Next(domains.Length)] as string; + } + + return Domain + @"/LrcFinder.asmx"; + } + } } Modified: trunk/plugins/MyLyrics/My Lyrics/DatabaseUtil.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/DatabaseUtil.cs 2009-05-18 13:35:16 UTC (rev 2865) +++ trunk/plugins/MyLyrics/My Lyrics/DatabaseUtil.cs 2009-05-19 14:59:09 UTC (rev 2866) @@ -5,6 +5,7 @@ using System.Runtime.Serialization.Formatters.Binary; using LyricsEngine; +using LyricsEngine.LRC; namespace MyLyrics { @@ -15,44 +16,77 @@ internal const int LYRIC_NOT_FOUND = -1; internal const int LYRIC_MARKED = 0; internal const int LYRIC_FOUND = 1; + internal const int LRC_FOUND = 2; + internal const int LRC_NOT_FOUND = 3; - internal static int IsTrackInLyricsDatabase(LyricsDatabase lyricDB, string artist, string title) + internal static int IsSongInLyricsDatabase(LyricsDatabase lyricDB, string artist, string title) { string lyricText = ""; - try + + string capatalizedArtist = LyricUtil.CapatalizeString(artist); + string capatalizedTitle = LyricUtil.CapatalizeString(title); + + string key = CorrectKeyFormat(capatalizedArtist, capatalizedTitle); + + if (lyricDB.ContainsKey(key)) { - string capatalizedArtist = LyricUtil.CapatalizeString(artist); - string capatalizedTitle = LyricUtil.CapatalizeString(title); + lyricText = lyricDB[key].Lyrics; - lyricText = lyricDB[CorrectKeyFormat(capatalizedArtist, capatalizedTitle)].Lyrics; + if (lyricText.Equals(MARK)) + { + return LYRIC_MARKED; + } + else + { + return LYRIC_FOUND; + } } - catch + else { return LYRIC_NOT_FOUND; } + } - if (lyricText.Equals(MARK)) + internal static int IsSongInLyricsMarkedDatabase(LyricsDatabase lyricMarkedDB, string artist, string title) + { + string key = DatabaseUtil.CorrectKeyFormat(LyricUtil.CapatalizeString(artist), LyricUtil.CapatalizeString(title)); + + if (lyricMarkedDB.ContainsKey(key)) { return LYRIC_MARKED; } else { - return LYRIC_FOUND; + return LYRIC_NOT_FOUND; } } - internal static int IsTrackInLyricsMarkedDatabase(LyricsDatabase lyricMarkedDB, string artist, string title) + internal static int IsSongInLyricsDatabaseAsLRC(LyricsDatabase lyricDB, string artist, string title) { - string lyricsText = ""; - try + string lyricText = ""; + + string capatalizedArtist = LyricUtil.CapatalizeString(artist); + string capatalizedTitle = LyricUtil.CapatalizeString(title); + + string key = CorrectKeyFormat(capatalizedArtist, capatalizedTitle); + + if (lyricDB.ContainsKey(key)) { - lyricsText = lyricMarkedDB[DatabaseUtil.CorrectKeyFormat(LyricUtil.CapatalizeString(artist), LyricUtil.CapatalizeString(title))].Lyrics; + lyricText = lyricDB[key].Lyrics; + + if (new SimpleLRC(capatalizedArtist, capatalizedTitle, lyricText).IsValid) + { + return LRC_FOUND; + } + else + { + return LYRIC_FOUND; + } } - catch + else { - return LYRIC_NOT_FOUND; + return LRC_NOT_FOUND; } - return LYRIC_MARKED; } @@ -64,12 +98,12 @@ public static void WriteToLyricsDatabase(LyricsDatabase lyricsDB, LyricsDatabase lyricsMarkedDB, string capArtist, string capTitle, string lyric, string site) { - if (DatabaseUtil.IsTrackInLyricsDatabase(lyricsDB, capArtist, capTitle).Equals(DatabaseUtil.LYRIC_NOT_FOUND)) + if (DatabaseUtil.IsSongInLyricsDatabase(lyricsDB, capArtist, capTitle).Equals(DatabaseUtil.LYRIC_NOT_FOUND)) { lyricsDB.Add(DatabaseUtil.CorrectKeyFormat(capArtist, capTitle), new LyricsItem(capArtist, capTitle, lyric, site)); } - if (DatabaseUtil.IsTrackInLyricsMarkedDatabase(lyricsMarkedDB, capArtist, capTitle).Equals(DatabaseUtil.LYRIC_MARKED)) + if (DatabaseUtil.IsSongInLyricsMarkedDatabase(lyricsMarkedDB, capArtist, capTitle).Equals(DatabaseUtil.LYRIC_MARKED)) { lyricsMarkedDB.Remove(DatabaseUtil.CorrectKeyFormat(capArtist, capTitle)); } @@ -80,14 +114,14 @@ LyricsDatabase otherDatabase = GetOtherLyricsDatabase(currentLyricsDB); string key = DatabaseUtil.CorrectKeyFormat(capArtist, capTitle); - if (DatabaseUtil.IsTrackInLyricsDatabase(currentLyricsDB, capArtist, capTitle).Equals(DatabaseUtil.LYRIC_NOT_FOUND) == false) + if (DatabaseUtil.IsSongInLyricsDatabase(currentLyricsDB, capArtist, capTitle).Equals(DatabaseUtil.LYRIC_NOT_FOUND) == false) { currentLyricsDB.Remove(key); } currentLyricsDB.Add(key, new LyricsItem(capArtist, capTitle, lyric, site)); - if (DatabaseUtil.IsTrackInLyricsMarkedDatabase(otherDatabase, capArtist, capTitle).Equals(DatabaseUtil.LYRIC_MARKED)) + if (DatabaseUtil.IsSongInLyricsMarkedDatabase(otherDatabase, capArtist, capTitle).Equals(DatabaseUtil.LYRIC_MARKED)) { otherDatabase.Remove(DatabaseUtil.CorrectKeyFormat(capArtist, capTitle)); } Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/ExportTags.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/ExportTags.cs 2009-05-18 13:35:16 UTC (rev 2865) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/ExportTags.cs 2009-05-19 14:59:09 UTC (rev 2866) @@ -79,7 +79,7 @@ string capArtist = LyricsEngine.LyricUtil.CapatalizeString(song.Artist); string capTitle = LyricsEngine.LyricUtil.CapatalizeString(song.Title); - if (DatabaseUtil.IsTrackInLyricsDatabase(MyLyricsSettings.LyricsDB, capArtist, capTitle).Equals(DatabaseUtil.LYRIC_FOUND)) + if (DatabaseUtil.IsSongInLyricsDatabase(MyLyricsSettings.LyricsDB, capArtist, capTitle).Equals(DatabaseUtil.LYRIC_FOUND)) { string lyric = MyLyricsSettings.LyricsDB[DatabaseUtil.CorrectKeyFormat(capArtist, capTitle)].Lyrics; Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/ImportTags.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/ImportTags.cs 2009-05-18 13:35:16 UTC (rev 2865) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/ImportTags.cs 2009-05-19 14:59:09 UTC (rev 2866) @@ -78,7 +78,7 @@ string capArtist = LyricsEngine.LyricUtil.CapatalizeString(tag.Artist); string capTitle = LyricsEngine.LyricUtil.CapatalizeString(tag.Title); - if (DatabaseUtil.IsTrackInLyricsDatabase(MyLyricsSettings.LyricsDB, capArtist, capTitle).Equals(DatabaseUtil.LYRIC_FOUND)) + if (DatabaseUtil.IsSongInLyricsDatabase(MyLyricsSettings.LyricsDB, capArtist, capTitle).Equals(DatabaseUtil.LYRIC_FOUND)) { // If lyric exists in LyricsDb then only import (and overwrite) if it isn't an LRC-file string lyricsText = (string)MyLyricsSettings.LyricsDB[DatabaseUtil.CorrectKeyFormat(capArtist, capTitle)].Lyrics; Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.cs 2009-05-18 13:35:16 UTC (rev 2865) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/LyricsLibrary.cs 2009-05-19 14:59:09 UTC (rev 2866) @@ -162,7 +162,7 @@ { LyricsItem item = new LyricsItem(artist, title, lyrics, site); - if (DatabaseUtil.IsTrackInLyricsDatabase(CurrentDB, artist, title).Equals(DatabaseUtil.LYRIC_NOT_FOUND)) + if (DatabaseUtil.IsSongInLyricsDatabase(CurrentDB, artist, title).Equals(DatabaseUtil.LYRIC_NOT_FOUND)) { CurrentDB.Add(DatabaseUtil.CorrectKeyFormat(artist, title), item); AddSong(item); @@ -274,7 +274,7 @@ m_CurrentArtist = LyricUtil.CapatalizeString(artist); m_CurrentTitle = LyricUtil.CapatalizeString(title); - if (DatabaseUtil.IsTrackInLyricsDatabase(CurrentDB, m_CurrentArtist, m_CurrentTitle).Equals(DatabaseUtil.LYRIC_FOUND)) + if (DatabaseUtil.IsSongInLyricsDatabase(CurrentDB, m_CurrentArtist, m_CurrentTitle).Equals(DatabaseUtil.LYRIC_FOUND)) { LyricsItem item = CurrentDB[DatabaseUtil.CorrectKeyFormat(m_CurrentArtist, m_CurrentTitle)]; string lyricsText = item.Lyrics; @@ -366,7 +366,7 @@ if (lrc.IsValid && parent.cbUploadLrcAutomatically.Checked) { LyricsEngine.LyricSites.LrcFinder lrcFinder = new LyricsEngine.LyricSites.LrcFinder(); - lrcFinder.SaveLrc(lyrics); + lrcFinder.SaveLrcWithGuid(lyrics, parent.m_guid); } btSave.Enabled = false; @@ -547,7 +547,7 @@ LyricsItem item = CurrentDB[key]; CurrentDB.Remove(key); - if (!DatabaseUtil.IsTrackInLyricsDatabase(otherDatabase, artist, item.Title).Equals(DatabaseUtil.LYRIC_NOT_FOUND)) + if (!DatabaseUtil.IsSongInLyricsDatabase(otherDatabase, artist, item.Title).Equals(DatabaseUtil.LYRIC_NOT_FOUND)) { otherDatabase.Add(key, item); } Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.cs 2009-05-18 13:35:16 UTC (rev 2865) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.cs 2009-05-19 14:59:09 UTC (rev 2866) @@ -184,7 +184,7 @@ ListViewItem lvi = new ListViewItem(capatalizedTitle); lvi.Tag = capatalizedTitle; - int status = DatabaseUtil.IsTrackInLyricsDatabase(MyLyricsSettings.LyricsDB, capatalizedArtist, capatalizedTitle); + int status = DatabaseUtil.IsSongInLyricsDatabase(MyLyricsSettings.LyricsDB, capatalizedArtist, capatalizedTitle); switch (status) { case DatabaseUtil.LYRIC_FOUND: @@ -197,7 +197,7 @@ lvi.SubItems.Add("-"); break; case DatabaseUtil.LYRIC_NOT_FOUND: - if (DatabaseUtil.IsTrackInLyricsMarkedDatabase(MyLyricsSettings.LyricsMarkedDB, capatalizedArtist, capatalizedTitle).Equals(DatabaseUtil.LYRIC_MARKED)) + if (DatabaseUtil.IsSongInLyricsMarkedDatabase(MyLyricsSettings.LyricsMarkedDB, capatalizedArtist, capatalizedTitle).Equals(DatabaseUtil.LYRIC_MARKED)) { lvi.SubItems.Add("MarkedDB"); lvi.SubItems.Add("-"); @@ -404,7 +404,7 @@ { string artist = lvi.SubItems[0].Text; string title = lvi.SubItems[1].Text; - if (DatabaseUtil.IsTrackInLyricsMarkedDatabase(MyLyricsSettings.LyricsMarkedDB, artist, title).Equals(DatabaseUtil.LYRIC_MARKED)) + if (DatabaseUtil.IsSongInLyricsMarkedDatabase(MyLyricsSettings.LyricsMarkedDB, artist, title).Equals(DatabaseUtil.LYRIC_MARKED)) { lvi.SubItems[2].Text = "MarkedDB"; if (cancelled) @@ -574,7 +574,7 @@ string capArtist = LyricUtil.CapatalizeString(artist); string capTitle = LyricUtil.CapatalizeString(title); - if (DatabaseUtil.IsTrackInLyricsMarkedDatabase(MyLyricsSettings.LyricsMarkedDB, capArtist, capTitle).Equals(DatabaseUtil.LYRIC_NOT_FOUND)) + if (DatabaseUtil.IsSongInLyricsMarkedDatabase(MyLyricsSettings.LyricsMarkedDB, capArtist, capTitle).Equals(DatabaseUtil.LYRIC_NOT_FOUND)) { MyLyricsSettings.LyricsMarkedDB.Add(DatabaseUtil.CorrectKeyFormat(capArtist, capTitle), new LyricsItem(capArtist, capTitle, "", "")); } Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs 2009-05-18 13:35:16 UTC (rev 2865) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs 2009-05-19 14:59:09 UTC (rev 2866) @@ -1101,7 +1101,7 @@ this.rbUserSelectMode.AutoSize = true; this.rbUserSelectMode.Location = new System.Drawing.Point(208, 23); this.rbUserSelectMode.Name = "rbUserSelectMode"; - this.rbUserSelectMode.Size = new System.Drawing.Size(107, 17); + this.rbUserSelectMode.Size = new System.Drawing.Size(89, 17); this.rbUserSelectMode.TabIndex = 22; this.rbUserSelectMode.Tag = "Custom mode"; this.rbUserSelectMode.Text = "Custom mode"; Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.cs 2009-05-18 13:35:16 UTC (rev 2865) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.cs 2009-05-19 14:59:09 UTC (rev 2866) @@ -82,6 +82,8 @@ bool m_automaticWriteToMusicTag = true; bool m_automaticReadFromToMusicTag = true; + private string m_guidString = string.Empty; + public Guid m_guid; string[] m_strippedPrefixStrings; @@ -280,6 +282,8 @@ tbLrcTaggingOffset.Text = xmlreader.GetValueAsString("myLyrics", "LrcTaggingOffset", "0"); tbLrcTaggingName.Text = xmlreader.GetValueAsString("myLyrics", "LrcTaggingName", ""); + m_guidString = ((string)xmlreader.GetValueAsString("myLyrics", "Guid", "")); + cbUploadLrcAutomatically.Checked = xmlreader.GetValue("myLyrics", "uploadLrcToLrcFinder").Equals("yes"); lbSongsLimitNote.Text = ("(You have currently " + m_TotalTitles.ToString() + " titles in your music database)"); @@ -314,6 +318,21 @@ } } } + + if (string.IsNullOrEmpty(m_guidString)) + { + m_guid = Guid.NewGuid(); + m_guidString = m_guid.ToString("P"); + + using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings("MediaPortal.xml")) + { + xmlwriter.SetValue("myLyrics", "Guid", m_guidString); + } + } + else + { + m_guid = new Guid(m_guidString); + } } catch (Exception ex) { @@ -552,7 +571,7 @@ string capArtist = LyricUtil.CapatalizeString(artist); string capTitle = LyricUtil.CapatalizeString(title); - if (m_MarkSongsWhenNoLyricFound && DatabaseUtil.IsTrackInLyricsMarkedDatabase(MyLyricsSettings.LyricsMarkedDB, capArtist, capTitle).Equals(DatabaseUtil.LYRIC_NOT_FOUND)) + if (m_MarkSongsWhenNoLyricFound && DatabaseUtil.IsSongInLyricsMarkedDatabase(MyLyricsSettings.LyricsMarkedDB, capArtist, capTitle).Equals(DatabaseUtil.LYRIC_NOT_FOUND)) { MyLyricsSettings.LyricsMarkedDB.Add(DatabaseUtil.CorrectKeyFormat(capArtist, capTitle), new LyricsItem(capArtist, capTitle, "", "")); } @@ -721,24 +740,24 @@ string capArtist = LyricUtil.CapatalizeString(tag.Artist); string capTitle = LyricUtil.CapatalizeString(tag.Title); - if (DatabaseUtil.IsTrackInLyricsDatabase(MyLyricsSettings.LyricsDB, capArtist, capTitle).Equals(DatabaseUtil.LYRIC_NOT_FOUND)) + if (DatabaseUtil.IsSongInLyricsDatabase(MyLyricsSettings.LyricsDB, capArtist, capTitle).Equals(DatabaseUtil.LYRIC_NOT_FOUND)) { MyLyricsSettings.LyricsDB.Add(DatabaseUtil.CorrectKeyFormat(capArtist, capTitle), new LyricsItem(capArtist, capTitle, tag.Lyrics, "music tag")); } - if (DatabaseUtil.IsTrackInLyricsMarkedDatabase(MyLyricsSettings.LyricsMarkedDB, capArtist, capTitle).Equals(DatabaseUtil.LYRIC_MARKED)) + if (DatabaseUtil.IsSongInLyricsMarkedDatabase(MyLyricsSettings.LyricsMarkedDB, capArtist, capTitle).Equals(DatabaseUtil.LYRIC_MARKED)) { MyLyricsSettings.LyricsMarkedDB.Remove(DatabaseUtil.CorrectKeyFormat(capArtist, capTitle)); } } else { - int status = DatabaseUtil.IsTrackInLyricsDatabase(MyLyricsSettings.LyricsDB, song.Artist, song.Title); + int status = DatabaseUtil.IsSongInLyricsDatabase(MyLyricsSettings.LyricsDB, song.Artist, song.Title); bool isTrackInLyricsMarkedDatabase = true; if (!m_DisregardKnownLyric && status.Equals(DatabaseUtil.LYRIC_FOUND) - || (!m_DisregardMarkedLyric && ((isTrackInLyricsMarkedDatabase = DatabaseUtil.IsTrackInLyricsMarkedDatabase(MyLyricsSettings.LyricsMarkedDB, song.Artist, song.Title).Equals(DatabaseUtil.LYRIC_MARKED)) || status.Equals(DatabaseUtil.LYRIC_MARKED))) - || (status.Equals(DatabaseUtil.LYRIC_NOT_FOUND) && !DatabaseUtil.IsTrackInLyricsMarkedDatabase(MyLyricsSettings.LyricsMarkedDB, song.Artist, song.Title).Equals(DatabaseUtil.LYRIC_MARKED))) + || (!m_DisregardMarkedLyric && ((isTrackInLyricsMarkedDatabase = DatabaseUtil.IsSongInLyricsMarkedDatabase(MyLyricsSettings.LyricsMarkedDB, song.Artist, song.Title).Equals(DatabaseUtil.LYRIC_MARKED)) || status.Equals(DatabaseUtil.LYRIC_MARKED))) + || (status.Equals(DatabaseUtil.LYRIC_NOT_FOUND) && !DatabaseUtil.IsSongInLyricsMarkedDatabase(MyLyricsSettings.LyricsMarkedDB, song.Artist, song.Title).Equals(DatabaseUtil.LYRIC_MARKED))) { songNotKnown = 1; Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2009-05-18 13:35:16 UTC (rev 2865) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2009-05-19 14:59:09 UTC (rev 2866) @@ -46,6 +46,9 @@ string m_skin = ""; + string m_guidString = null; + Guid m_guid; + bool m_newTrack = false; bool m_alreadyValidLRC = false; bool m_ValidLrcLyric = false; // A valid LRC-lyric always overwrites a normal lyric in both Lyrics db and music tag (if allowed) @@ -196,6 +199,7 @@ internal string m_LrcTaggingName = null; internal bool m_uploadLrcToLrcFinder = false; + internal bool m_confirmedNoUploadLrcToLrcFinder = false; SimpleLRC m_SimpleLrc; SimpleLRCTimeAndLineCollection m_LrcTimeCollection; @@ -257,12 +261,17 @@ StopThread(); m_newTrack = false; - m_artist = m_CurrentTrackTag.Artist.Trim(); - m_artist = m_artist.Replace("| ", ""); - m_artist = m_artist.Replace(" |", ""); - m_title = m_CurrentTrackTag.Title.Trim(); + if (m_CurrentTrackTag != null) + { + m_artist = m_CurrentTrackTag.Artist.Trim(); + m_artist = m_artist.Replace("| ", ""); + m_artist = m_artist.Replace(" |", ""); + m_artist = m_artist.Replace("''", "'"); + m_title = m_CurrentTrackTag.Title.Trim(); + m_title = m_title.Replace("''", "'"); - getAlbumArt(); + getAlbumArt(); + } } if (m_CurrentTrackTag != null) @@ -355,7 +364,7 @@ { ShowLRCtoEdit(); } - else if (DatabaseUtil.IsTrackInLyricsDatabase(m_LyricsDB, m_artist, m_title).Equals(DatabaseUtil.LYRIC_FOUND)) + else if (DatabaseUtil.IsSongInLyricsDatabase(m_LyricsDB, m_artist, m_title).Equals(DatabaseUtil.LYRIC_FOUND)) { LyricsItem item = m_LyricsDB[DatabaseUtil.CorrectKeyFormat(m_artist, m_title)]; m_LyricText = item.Lyrics; @@ -406,6 +415,8 @@ private void ShowLRCtoEdit() { + m_LyricText = m_LyricText.Trim(); + SimpleLRC lrc = new SimpleLRC(m_artist, m_title, m_LyricText); if (lrc.IsValid) @@ -426,6 +437,7 @@ { GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_LINE + i, m_lines[i]); GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_LINE_DONE + i, m_lines[i]); + GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_TIME + i, "[xx:xx.xx]"); } } catch { ;} @@ -463,9 +475,12 @@ m_LrcTaggingName = ((string)xmlreader.GetValueAsString("myLyrics", "LrcTaggingName", "")); m_uploadLrcToLrcFinder = ((string)xmlreader.GetValueAsString("myLyrics", "uploadLrcToLrcFinder", "False")).ToString().Equals("yes") ? true : false; + m_confirmedNoUploadLrcToLrcFinder = ((string)xmlreader.GetValueAsString("myLyrics", "confirmedNoUploadLrcToLrcFinder", "False")).ToString().Equals("yes") ? true : false; m_skin = ((string)xmlreader.GetValueAsString("skin", "name", "Blue3")); + m_guidString = ((string)xmlreader.GetValueAsString("myLyrics", "Guid", "")); + m_crossfade = xmlreader.GetValueAsInt("audioplayer", "crossfade", 2000); m_Find = xmlreader.GetValueAsString("myLyrics", "find", ""); @@ -489,7 +504,22 @@ GUIControl.HideControl(GetID, (int)GUI_Lyrics_Controls.CONTROL_LyricWide_Scroll); } + if (string.IsNullOrEmpty(m_guidString)) + { + m_guid = Guid.NewGuid(); + m_guidString = m_guid.ToString("P"); + using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings("MediaPortal.xml")) + { + xmlwriter.SetValue("myLyrics", "Guid", m_guidString); + } + } + else + { + m_guid = new Guid(m_guidString); + } + + m_strippedPrefixStrings = MediaPortalUtil.GetStrippedPrefixStringArray(); ArrayList sitesToSearch = new ArrayList(); @@ -661,8 +691,8 @@ } else if (m_selectedScreen == (int)MyLyricsSettings.Screen.LRC_PICK) { - m_basicScreenSelected = true; - FindLrc(); + //m_basicScreenSelected = true; + //FindLrc(); } } else if (action.m_key.KeyChar.Equals(115)) @@ -719,7 +749,7 @@ if (m_LrcTable != null && m_LrcTable.Rows.Count > 0) { - m_LyricText = m_LrcTable.Rows[0][3] as string; + m_LyricText = m_LrcTable.Rows[0][2] as string; m_SimpleLrc = new SimpleLRC(null, null, m_LyricText); StartShowingLrc(m_LyricText, true); @@ -918,6 +948,7 @@ if (m_SimpleLrc.IsValid) { StartShowingLrc(m_CurrentTrackTag.Lyrics, false); + SaveLyricToDatabase(m_artist, m_title, m_CurrentTrackTag.Lyrics, "music tag", true); return true; } } @@ -1122,15 +1153,7 @@ m_StatusText = ""; GUIControl.SetControlLabel(GetID, (int)GUI_General_Controls.CONTROL_LBStatus, m_StatusText); - // If lyricText is empty, the LRC file was pulled out of the music tag and is still not in the lyrics database - if (string.IsNullOrEmpty(lyricText)) - { - SaveLyricToDatabase(m_artist, m_title, m_CurrentTrackTag.Lyrics, "music tag", true); - } - else - { - m_LyricText = lyricText; - } + m_LyricText = lyricText; try { @@ -1191,10 +1214,10 @@ { for (int i = 0; i < m_TAG_IN_ROUND && m_LRCLinesTotal + i < m_lines.Length; i++) { - GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_LINE + i); - GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_TIME + i, ""); GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_LINE + i, m_lines[m_tagRoundFinished * m_TAG_IN_ROUND + i]); GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_LINE_DONE + i, m_lines[m_tagRoundFinished * m_TAG_IN_ROUND + i]); + GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_LINE + i); + GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_TIME + i, "[xx:xx.xx]"); } } catch { ;} @@ -1207,28 +1230,28 @@ string artist = LyricUtil.CapatalizeString(m_artist); string title = LyricUtil.CapatalizeString(m_title); - lyric.Append(string.Format("[ar:{0}]\n", artist)); - lyric.Append(string.Format("[ti:{0}]\n", title)); + lyric.AppendLine(string.Format("[ar:{0}]", artist)); + lyric.AppendLine(string.Format("[ti:{0}]", title)); if (!string.IsNullOrEmpty(m_LrcTaggingName)) { - lyric.Append(string.Format("[by:{0}]\n", m_LrcTaggingName)); + lyric.AppendLine(string.Format("[by:{0}]", m_LrcTaggingName)); } if (!string.IsNullOrEmpty(m_LrcTaggingOffset)) { - lyric.Append(string.Format("[offset:{0}]\n", m_LrcTaggingOffset)); + lyric.AppendLine(string.Format("[offset:{0}]", m_LrcTaggingOffset)); } - lyric.Append("[ap:MediaPortal]\n"); + lyric.AppendLine("[ap:MediaPortal]"); for (int i = 0; i < m_lines.Length; i++) { - lyric.Append(m_lines[i] + "\n"); + lyric.AppendLine(m_lines[i] + ""); } + lyric.Replace("\r", ""); string lyricAsString = lyric.ToString(); - int lastLineShift = lyricAsString.LastIndexOf("\n"); - lyricAsString = lyricAsString.Substring(0, lastLineShift); + //lyricAsString = lyricAsString.Substring(0, lastLineShift); m_LyricText = lyricAsString; SaveLyricToDatabase(artist, title, m_LyricText, "MyLyrics LRC Editor", true); @@ -1240,35 +1263,81 @@ SaveLyricToTagLists(m_CurrentTrackTag.FileName, m_LyricText); } + m_selectedScreen = (int)MyLyricsSettings.Screen.LRC_BASIC; + ShowLyricOnScreen(m_LyricText, "MediaPortal"); + // Upload LRC to LrcFinder if user has accepted in configuration if (m_uploadLrcToLrcFinder) { - LyricsEngine.LyricSites.LrcFinder lrcFinder = new LyricsEngine.LyricSites.LrcFinder(); + UploadLrcFile(m_LyricText); + } + else if (!m_confirmedNoUploadLrcToLrcFinder) + { + GUIDialogYesNo dlgYesNo = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_YES_NO); + if (dlgYesNo != null) + { + dlgYesNo.SetHeading("Upload to LRCFinder?"); - bool lrcUploaded = lrcFinder.SaveLrc(m_LyricText); + dlgYesNo.SetLine(1, string.Empty); + dlgYesNo.SetLine(2, "Upload this and future created"); + dlgYesNo.SetLine(3, "LRC files to LrcFinder?"); + dlgYesNo.DoModal(GetID); + if (dlgYesNo.IsConfirmed) + { + UploadLrcFile(m_LyricText); - if (lrcUploaded) - { - string status = "Your LRC was successfully uploaded"; - GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_LRCPICK_STATUS, status); + m_uploadLrcToLrcFinder = true; + + using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings("MediaPortal.xml")) + { + xmlwriter.SetValue("myLyrics", "uploadLrcToLrcFinder", "yes"); + } + } + else + { + m_confirmedNoUploadLrcToLrcFinder = true; + + using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings("MediaPortal.xml")) + { + xmlwriter.SetValue("myLyrics", "confirmedNoUploadLrcToLrcFinder", "yes"); + } + } } - else - { - string status = "LrcFinder could not be reached..."; - GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_LRCPICK_STATUS, status); - } - } - - m_selectedScreen = (int)MyLyricsSettings.Screen.LRC_BASIC; - ShowLyricOnScreen(m_LyricText, "MediaPortal"); } } } + + private void UploadLrcFile(string lrcFile) + { + LyricsEngine.LyricSites.LrcFinder lrcFinder = new LyricsEngine.LyricSites.LrcFinder(); + + bool lrcUploaded = lrcFinder.SaveLrcWithGuid(lrcFile, m_guid); + + if (lrcUploaded) + { + string status = "Your LRC was successfully uploaded"; + GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_LRCPICK_STATUS, status); + } + else + { + string status = "LrcFinder could not be reached..."; + GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_LRCPICK_STATUS, status); + } + } + private void RemoveLatestTagLine() { --m_LRCLinesTotal; + + if (m_LRCLinesTotal < 0) + { + m_LRCLinesTotal = 0; + return; + } + + string lastTimeStampTemp = m_lines[m_LRCLinesTotal].Substring(0, 9); m_lines[m_LRCLinesTotal] = m_lines[m_LRCLinesTotal].Substring(9); if (--m_currentLRCLineIndex < 0) @@ -1276,29 +1345,29 @@ m_currentLRCLineIndex = m_TAG_IN_ROUND - 1; --m_tagRoundFinished; - GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_TIME + m_currentLRCLineIndex, ""); - GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_LINE + m_currentLRCLineIndex, m_lines[m_LRCLinesTotal]); - GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_LINE_DONE + m_currentLRCLineIndex, m_lines[m_LRCLinesTotal]); - try { - for (int i = 0; i < m_TAG_IN_ROUND - 1; i++) + for (int i = 0; i < m_TAG_IN_ROUND; i++) { - GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_TIME + i, m_lines[m_tagRoundFinished * m_TAG_IN_ROUND + i].Substring(0, 8)); + GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_TIME + i, m_lines[m_tagRoundFinished * m_TAG_IN_ROUND + i].Substring(0, 9)); GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_LINE + i, m_lines[m_tagRoundFinished * m_TAG_IN_ROUND + i].Substring(9)); GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_LINE_DONE + i, m_lines[m_tagRoundFinished * m_TAG_IN_ROUND + i].Substring(9)); + GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_LINE_DONE + i); GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_LINE + i); } } catch { ;} + GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_LINE + m_currentLRCLineIndex); + GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_LINE_DONE + m_currentLRCLineIndex); + GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_TIME + m_currentLRCLineIndex, "[xx:xx.xx]"); + } else { - GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_TIME + m_currentLRCLineIndex, ""); - GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_LINE + m_currentLRCLineIndex, m_lines[m_LRCLinesTotal]); GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_LINE + m_currentLRCLineIndex); GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_LINE_DONE + m_currentLRCLineIndex); + GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_EDIT_TIME + m_currentLRCLineIndex, "[xx:xx.xx]"); } } @@ -1423,18 +1492,23 @@ string capArtist = LyricUtil.CapatalizeString(artist); string capTitle = LyricUtil.CapatalizeString(title); - if (DatabaseUtil.IsTrackInLyricsDatabase(m_LyricsDB, capArtist, capTitle).Equals(DatabaseUtil.LYRIC_NOT_FOUND)) + if (DatabaseUtil.IsSongInLyricsDatabase(m_LyricsDB, capArtist, capTitle).Equals(DatabaseUtil.LYRIC_NOT_FOUND)) { + m_LyricsDB.Add(DatabaseUtil.CorrectKeyFormat(capArtist, capTitle), new LyricsItem(capArtist, capTitle, lyric, site)); + SaveDatabase(m_LyricsDBName, m_LyricsDB); + } + else if (!DatabaseUtil.IsSongInLyricsDatabaseAsLRC(m_LyricsDB, capArtist, capTitle).Equals(DatabaseUtil.LRC_FOUND)) + { m_LyricsDB[DatabaseUtil.CorrectKeyFormat(capArtist, capTitle)] = new LyricsItem(capArtist, capTitle, lyric, site); SaveDatabase(m_LyricsDBName, m_LyricsDB); } else if (lrc) { - m_LyricsDB.Add(DatabaseUtil.CorrectKeyFormat(capArtist, capTitle), new LyricsItem(capArtist, capTitle, lyric, site)); + m_LyricsDB[DatabaseUtil.CorrectKeyFormat(capArtist, capTitle)] = new LyricsItem(capArtist, capTitle, lyric, site); SaveDatabase(m_LyricsDBName, m_LyricsDB); } - if (DatabaseUtil.IsTrackInLyricsMarkedDatabase(m_LyricsMarkedDB, capArtist, capTitle).Equals(DatabaseUtil.LYRIC_MARKED)) + if (DatabaseUtil.IsSongInLyricsMarkedDatabase(m_LyricsMarkedDB, capArtist, capTitle).Equals(DatabaseUtil.LYRIC_MARKED)) { m_LyricsMarkedDB.Remove(DatabaseUtil.CorrectKeyFormat(capArtist, capTitle)); SaveDatabase(m_LyricsMarkedDBName, m_LyricsMarkedDB); @@ -1448,7 +1522,7 @@ { BinaryFormatter bf = new BinaryFormatter(); lyricsDatabase.SetLastModified(); - bf.Serialize(fs, dbName); + bf.Serialize(fs, lyricsDatabase); fs.Close(); } } Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj 2009-05-18 13:35:16 UTC (rev 2865) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj 2009-05-19 14:59:09 UTC (rev 2866) @@ -5,7 +5,7 @@ <ProductVersion>9.0.21022</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{BBB2DAE2-0D83-4B4B-85B6-D1B5A7E10039}</ProjectGuid> - <OutputType>Library</OutputType> + <OutputType>WinExe</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>MyLyrics</RootNamespace> <AssemblyName>MyLyrics</AssemblyName> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2009-05-22 21:00:19
|
Revision: 2868 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2868&view=rev Author: saamand Date: 2009-05-22 21:00:13 +0000 (Fri, 22 May 2009) Log Message: ----------- MyLyrics 1.30 Modified Paths: -------------- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LrcFinder.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 Configuration/MyLyricsSetup.resx trunk/plugins/MyLyrics/My Lyrics/change log.txt Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LrcFinder.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LrcFinder.cs 2009-05-20 12:49:40 UTC (rev 2867) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LrcFinder.cs 2009-05-22 21:00:13 UTC (rev 2868) @@ -132,7 +132,7 @@ private string GetUrl() { - Domain = "http://testLRCFinder.profiler.nl"; + //Domain = "http://testLRCFinder.profiler.nl"; if (string.IsNullOrEmpty(Domain)) { Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.cs 2009-05-20 12:49:40 UTC (rev 2867) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.cs 2009-05-22 21:00:13 UTC (rev 2868) @@ -38,7 +38,7 @@ string[] m_strippedPrefixStrings = null; - bool m_lockButtons = true; + private bool m_Searching = false; Thread m_LyricControllerThread; ManualResetEvent m_EventStopThread; @@ -259,7 +259,7 @@ private void Search_Init() { - m_lockButtons = false; + m_Searching = true; MyLyricsSetup.UpdateLibraryUI = true; ChangeButtonsEnableState(); @@ -595,6 +595,8 @@ // Called from worker thread using delegate and Control.Invoke private void ThreadFinishedMethod(string artist, string title, string message, string site) { + m_Searching = false; + ChangeButtonsEnableState(); RefreshSongsListView(); ChangeStatusOnSubItems(false); @@ -611,20 +613,38 @@ private void ChangeButtonsEnableState() { - if (m_lockButtons == false) + if (m_Searching == true) { - ((MyLyricsSetup)m_Parent).btClose.Enabled = !((MyLyricsSetup)m_Parent).btClose.Enabled; - btSearch.Enabled = !btSearch.Enabled; - btCancel.Enabled = !btCancel.Enabled; - btAdd.Enabled = !btAdd.Enabled; - btAddAll.Enabled = !btAddAll.Enabled; - btDeselectAll.Enabled = !btDeselectAll.Enabled; - btDeselectAll2.Enabled = !btDeselectAll2.Enabled; - btRemove.Enabled = !btRemove.Enabled; - btRemoveAll.Enabled = !btRemoveAll.Enabled; - btSelectAll.Enabled = !btSelectAll.Enabled; - btSelectAll2.Enabled = !btSelectAll2.Enabled; + m_Parent.tabControl.SelectedIndexChanged -= new System.EventHandler(m_Parent.tabControl_SelectedIndexChanged); + + ((MyLyricsSetup)m_Parent).btClose.Enabled = false; + btSearch.Enabled = false; + btCancel.Enabled = true; + btAdd.Enabled = false; + btAddAll.Enabled = false; + btDeselectAll.Enabled = false; + btDeselectAll2.Enabled = false; + btRemove.Enabled = false; + btRemoveAll.Enabled = false; + btSelectAll.Enabled = false; + btSelectAll2.Enabled = false; } + else + { + m_Parent.tabControl.SelectedIndexChanged += new System.EventHandler(m_Parent.tabControl_SelectedIndexChanged); + + ((MyLyricsSetup)m_Parent).btClose.Enabled = true; + btSearch.Enabled = true; + btCancel.Enabled = false; + btAdd.Enabled = true; + btAddAll.Enabled = true; + btDeselectAll.Enabled = true; + btDeselectAll2.Enabled = true; + btRemove.Enabled = true; + btRemoveAll.Enabled = true; + btSelectAll.Enabled = true; + btSelectAll2.Enabled = true; + } } private void bw_DoWork(object sender, DoWorkEventArgs e) @@ -721,7 +741,7 @@ bwMusicTagSearch.CancelAsync(); bwOnlineSearch.CancelAsync(); ChangeButtonsEnableState(); - m_lockButtons = true; + m_Searching = false; Thread.Sleep(500); RefreshSongsListView(); RefreshArtistStats(); @@ -776,6 +796,7 @@ private void btSearch_Click(object sender, EventArgs e) { + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MediaPortal.xml")) { if (xmlreader.GetValueAsBool("myLyrics", "automaticReadFromMusicTag", true)) Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs 2009-05-20 12:49:40 UTC (rev 2867) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs 2009-05-22 21:00:13 UTC (rev 2868) @@ -1245,7 +1245,6 @@ #endregion - private MediaPortal.UserInterface.Controls.MPTabControl tabControl; private MediaPortal.UserInterface.Controls.MPTabPage tabPageSetup; private MediaPortal.UserInterface.Controls.MPTabPage tabPageLyricsDatabase; private MediaPortal.UserInterface.Controls.MPGroupBox gbMusicDBSearchStats; @@ -1338,5 +1337,6 @@ private MediaPortal.UserInterface.Controls.MPLabel lbLrcTaggingOffset; private MediaPortal.UserInterface.Controls.MPTextBox tbLrcTaggingName; private MediaPortal.UserInterface.Controls.MPLabel lbLrcTaggingName; + public MediaPortal.UserInterface.Controls.MPTabControl tabControl; } } \ 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 2009-05-20 12:49:40 UTC (rev 2867) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.cs 2009-05-22 21:00:13 UTC (rev 2868) @@ -1018,7 +1018,7 @@ } } - private void tabControl_SelectedIndexChanged(object sender, EventArgs e) + public void tabControl_SelectedIndexChanged(object sender, EventArgs e) { if (tabControl.SelectedIndex == 0) { Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.resx =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.resx 2009-05-20 12:49:40 UTC (rev 2867) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.resx 2009-05-22 21:00:13 UTC (rev 2868) @@ -123,6 +123,12 @@ <metadata name="Replace.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> + <metadata name="Find.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </metadata> + <metadata name="Replace.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </metadata> <metadata name="bgWorkerSearch.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>6, 4</value> </metadata> Modified: trunk/plugins/MyLyrics/My Lyrics/change log.txt =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/change log.txt 2009-05-20 12:49:40 UTC (rev 2867) +++ trunk/plugins/MyLyrics/My Lyrics/change log.txt 2009-05-22 21:00:13 UTC (rev 2868) @@ -1,17 +1,17 @@ Release notes to MyLyrics 1.30 -MyLyrics is a windows plugin for MediaPortal which enables the display of lyrics for the currently played music file inside MediaPortal. +MyLyrics enables the display of lyrics for the currently played music file inside MediaPortal. The plugin is able show LRC and plain lyrics, and uses both musictags and online searches to find lyrics. Basic features: -* Dynamic search for the lyrics to currently playing music file. -* Browse your music database and select the songs for which you want to find lyrics. +* Dynamic search for the lyrics (both LRC's and plain lyrics) to the currently played music file. +* Browse your music database and select the songs to which you want to find lyrics. * Batch search for lyrics matching songs in music database. * Search single title and select amoung lyrics from various lyrics sites. * Add/delete/edit lyrics and save changes in lyrics databases. * Import/export lyrics to/from music tags. * Include lyrics from the Internet, musictags, text- and lrc-files. -* Create a LRC from a basic lyric on the fly. +* Create a LRC from a basic lyric on the fly and share it with the community. Keys: - W key (or '#' button on remote): Toggle between basic and wide screen. @@ -28,7 +28,7 @@ (Two sub modes for both Lyrics basic and Lyrics wide: static mode (default) or scroll mode) - LRC basic: shows lrc file and coverart on the right (default lrc screen). - LRC wide: shows wider lrc area and no coverart (the plugin autoselects this if the lrc contains one or more long lines). -- LRC pick: uses BennieBoy's LrcFinder to select among different matching LRC entries. +- LRC pick: uses BennieBoy's LRCFinder to select among different matching LRC entries. - LRC editor: enables the creation of lrc lyric from a plain lyric. Compatible with MediaPortal 1.0.2. @@ -37,9 +37,9 @@ Simple copy the content of the zip-file into your MP library (typical C:\Program Files\Team MediaPortal\MediaPortal). Noteworthy changes since version 1.23: +* Add: Support for LRCFinder webservice (a big, BIG thank you to BennieBoy!). * Add: New screen "LRC pick" added (enter and leave by pressing 'P'). -* Add: Support for LrcFinder webservice (a big, BIG thank you to BennieBoy!). -* Add: Option to upload manual created LRC file to LrcFinder and share it with the community (default disabled). +* Add: Option to upload manual created LRC file to LRCFinder and share it with the community (default disabled). * Add: Toggle between LRC and lyric mode with hotkey 'F'. * Add: LRC mode added to the configuration (search only for LRC-files). * Add: In LRC editor mode 'backslash' can be used to erase the latest tagged line. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2009-05-28 13:10:34
|
Revision: 2872 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2872&view=rev Author: saamand Date: 2009-05-28 13:10:24 +0000 (Thu, 28 May 2009) Log Message: ----------- Modified Paths: -------------- 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 Configuration/MyLyricsSetup.resx trunk/plugins/MyLyrics/My Lyrics/MyLyricsSettings.cs Added Paths: ----------- trunk/plugins/MyLyrics/LyricsEngine/Web References/lrcfinder/ trunk/plugins/MyLyrics/LyricsEngine/Web References/lrcfinder/LrcFinder.disco trunk/plugins/MyLyrics/LyricsEngine/Web References/lrcfinder/LrcFinder.wsdl trunk/plugins/MyLyrics/LyricsEngine/Web References/lrcfinder/Reference.cs trunk/plugins/MyLyrics/LyricsEngine/Web References/lrcfinder/Reference.map Added: trunk/plugins/MyLyrics/LyricsEngine/Web References/lrcfinder/LrcFinder.disco =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/Web References/lrcfinder/LrcFinder.disco (rev 0) +++ trunk/plugins/MyLyrics/LyricsEngine/Web References/lrcfinder/LrcFinder.disco 2009-05-28 13:10:24 UTC (rev 2872) @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<discovery xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/disco/"> + <contractRef ref="http://lrcfinder.profiler.nl/LrcFinder.asmx?wsdl" docRef="http://lrcfinder.profiler.nl/LrcFinder.asmx" xmlns="http://schemas.xmlsoap.org/disco/scl/" /> + <soap address="http://lrcfinder.profiler.nl/LrcFinder.asmx" xmlns:q1="http://tempuri.org/" binding="q1:LrcFinderSoap" xmlns="http://schemas.xmlsoap.org/disco/soap/" /> + <soap address="http://lrcfinder.profiler.nl/LrcFinder.asmx" xmlns:q2="http://tempuri.org/" binding="q2:LrcFinderSoap12" xmlns="http://schemas.xmlsoap.org/disco/soap/" /> +</discovery> \ No newline at end of file Added: trunk/plugins/MyLyrics/LyricsEngine/Web References/lrcfinder/LrcFinder.wsdl =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/Web References/lrcfinder/LrcFinder.wsdl (rev 0) +++ trunk/plugins/MyLyrics/LyricsEngine/Web References/lrcfinder/LrcFinder.wsdl 2009-05-28 13:10:24 UTC (rev 2872) @@ -0,0 +1,252 @@ +<?xml version="1.0" encoding="utf-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/" xmlns:s1="http://microsoft.com/wsdl/types/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + <wsdl:types> + <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/"> + <s:import namespace="http://microsoft.com/wsdl/types/" /> + <s:element name="FindLRC"> + <s:complexType> + <s:sequence> + <s:element minOccurs="0" maxOccurs="1" name="artist" type="s:string" /> + <s:element minOccurs="0" maxOccurs="1" name="title" type="s:string" /> + </s:sequence> + </s:complexType> + </s:element> + <s:element name="FindLRCResponse"> + <s:complexType> + <s:sequence> + <s:element minOccurs="0" maxOccurs="1" name="FindLRCResult" type="s:string" /> + </s:sequence> + </s:complexType> + </s:element> + <s:element name="FindLRCs"> + <s:complexType> + <s:sequence> + <s:element minOccurs="0" maxOccurs="1" name="artist" type="s:string" /> + <s:element minOccurs="0" maxOccurs="1" name="title" type="s:string" /> + </s:sequence> + </s:complexType> + </s:element> + <s:element name="FindLRCsResponse"> + <s:complexType> + <s:sequence> + <s:element minOccurs="0" maxOccurs="1" name="FindLRCsResult"> + <s:complexType> + <s:sequence> + <s:any minOccurs="0" maxOccurs="unbounded" namespace="http://www.w3.org/2001/XMLSchema" processContents="lax" /> + <s:any minOccurs="1" namespace="urn:schemas-microsoft-com:xml-diffgram-v1" processContents="lax" /> + </s:sequence> + </s:complexType> + </s:element> + </s:sequence> + </s:complexType> + </s:element> + <s:element name="SaveLRC"> + <s:complexType> + <s:sequence> + <s:element minOccurs="0" maxOccurs="1" name="lrcFileString" type="s:string" /> + </s:sequence> + </s:complexType> + </s:element> + <s:element name="SaveLRCResponse"> + <s:complexType> + <s:sequence> + <s:element minOccurs="0" maxOccurs="1" name="SaveLRCResult" type="s:string" /> + </s:sequence> + </s:complexType> + </s:element> + <s:element name="SaveLRCWithGuid"> + <s:complexType> + <s:sequence> + <s:element minOccurs="0" maxOccurs="1" name="lrcFileString" type="s:string" /> + <s:element minOccurs="1" maxOccurs="1" name="guid" type="s1:guid" /> + </s:sequence> + </s:complexType> + </s:element> + <s:element name="SaveLRCWithGuidResponse"> + <s:complexType> + <s:sequence> + <s:element minOccurs="0" maxOccurs="1" name="SaveLRCWithGuidResult" type="s:string" /> + </s:sequence> + </s:complexType> + </s:element> + <s:element name="NewDomain"> + <s:complexType /> + </s:element> + <s:element name="NewDomainResponse"> + <s:complexType> + <s:sequence> + <s:element minOccurs="0" maxOccurs="1" name="NewDomainResult" type="tns:ArrayOfString" /> + </s:sequence> + </s:complexType> + </s:element> + <s:complexType name="ArrayOfString"> + <s:sequence> + <s:element minOccurs="0" maxOccurs="unbounded" name="string" nillable="true" type="s:string" /> + </s:sequence> + </s:complexType> + </s:schema> + <s:schema elementFormDefault="qualified" targetNamespace="http://microsoft.com/wsdl/types/"> + <s:simpleType name="guid"> + <s:restriction base="s:string"> + <s:pattern value="[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}" /> + </s:restriction> + </s:simpleType> + </s:schema> + </wsdl:types> + <wsdl:message name="FindLRCSoapIn"> + <wsdl:part name="parameters" element="tns:FindLRC" /> + </wsdl:message> + <wsdl:message name="FindLRCSoapOut"> + <wsdl:part name="parameters" element="tns:FindLRCResponse" /> + </wsdl:message> + <wsdl:message name="FindLRCsSoapIn"> + <wsdl:part name="parameters" element="tns:FindLRCs" /> + </wsdl:message> + <wsdl:message name="FindLRCsSoapOut"> + <wsdl:part name="parameters" element="tns:FindLRCsResponse" /> + </wsdl:message> + <wsdl:message name="SaveLRCSoapIn"> + <wsdl:part name="parameters" element="tns:SaveLRC" /> + </wsdl:message> + <wsdl:message name="SaveLRCSoapOut"> + <wsdl:part name="parameters" element="tns:SaveLRCResponse" /> + </wsdl:message> + <wsdl:message name="SaveLRCWithGuidSoapIn"> + <wsdl:part name="parameters" element="tns:SaveLRCWithGuid" /> + </wsdl:message> + <wsdl:message name="SaveLRCWithGuidSoapOut"> + <wsdl:part name="parameters" element="tns:SaveLRCWithGuidResponse" /> + </wsdl:message> + <wsdl:message name="NewDomainSoapIn"> + <wsdl:part name="parameters" element="tns:NewDomain" /> + </wsdl:message> + <wsdl:message name="NewDomainSoapOut"> + <wsdl:part name="parameters" element="tns:NewDomainResponse" /> + </wsdl:message> + <wsdl:portType name="LrcFinderSoap"> + <wsdl:operation name="FindLRC"> + <wsdl:input message="tns:FindLRCSoapIn" /> + <wsdl:output message="tns:FindLRCSoapOut" /> + </wsdl:operation> + <wsdl:operation name="FindLRCs"> + <wsdl:input message="tns:FindLRCsSoapIn" /> + <wsdl:output message="tns:FindLRCsSoapOut" /> + </wsdl:operation> + <wsdl:operation name="SaveLRC"> + <wsdl:input message="tns:SaveLRCSoapIn" /> + <wsdl:output message="tns:SaveLRCSoapOut" /> + </wsdl:operation> + <wsdl:operation name="SaveLRCWithGuid"> + <wsdl:input message="tns:SaveLRCWithGuidSoapIn" /> + <wsdl:output message="tns:SaveLRCWithGuidSoapOut" /> + </wsdl:operation> + <wsdl:operation name="NewDomain"> + <wsdl:input message="tns:NewDomainSoapIn" /> + <wsdl:output message="tns:NewDomainSoapOut" /> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="LrcFinderSoap" type="tns:LrcFinderSoap"> + <soap:binding transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="FindLRC"> + <soap:operation soapAction="http://tempuri.org/FindLRC" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="FindLRCs"> + <soap:operation soapAction="http://tempuri.org/FindLRCs" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="SaveLRC"> + <soap:operation soapAction="http://tempuri.org/SaveLRC" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="SaveLRCWithGuid"> + <soap:operation soapAction="http://tempuri.org/SaveLRCWithGuid" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="NewDomain"> + <soap:operation soapAction="http://tempuri.org/NewDomain" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:binding name="LrcFinderSoap12" type="tns:LrcFinderSoap"> + <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="FindLRC"> + <soap12:operation soapAction="http://tempuri.org/FindLRC" style="document" /> + <wsdl:input> + <soap12:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap12:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="FindLRCs"> + <soap12:operation soapAction="http://tempuri.org/FindLRCs" style="document" /> + <wsdl:input> + <soap12:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap12:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="SaveLRC"> + <soap12:operation soapAction="http://tempuri.org/SaveLRC" style="document" /> + <wsdl:input> + <soap12:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap12:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="SaveLRCWithGuid"> + <soap12:operation soapAction="http://tempuri.org/SaveLRCWithGuid" style="document" /> + <wsdl:input> + <soap12:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap12:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="NewDomain"> + <soap12:operation soapAction="http://tempuri.org/NewDomain" style="document" /> + <wsdl:input> + <soap12:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap12:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="LrcFinder"> + <wsdl:port name="LrcFinderSoap" binding="tns:LrcFinderSoap"> + <soap:address location="http://lrcfinder.profiler.nl/LrcFinder.asmx" /> + </wsdl:port> + <wsdl:port name="LrcFinderSoap12" binding="tns:LrcFinderSoap12"> + <soap12:address location="http://lrcfinder.profiler.nl/LrcFinder.asmx" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> \ No newline at end of file Added: trunk/plugins/MyLyrics/LyricsEngine/Web References/lrcfinder/Reference.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/Web References/lrcfinder/Reference.cs (rev 0) +++ trunk/plugins/MyLyrics/LyricsEngine/Web References/lrcfinder/Reference.cs 2009-05-28 13:10:24 UTC (rev 2872) @@ -0,0 +1,395 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:2.0.50727.3053 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +// +// This source code was auto-generated by Microsoft.VSDesigner, Version 2.0.50727.3053. +// +#pragma warning disable 1591 + +namespace LyricsEngine.lrcfinder { + using System.Diagnostics; + using System.Web.Services; + using System.ComponentModel; + using System.Web.Services.Protocols; + using System; + using System.Xml.Serialization; + using System.Data; + + + /// <remarks/> + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.3053")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name="LrcFinderSoap", Namespace="http://tempuri.org/")] + public partial class LrcFinder : System.Web.Services.Protocols.SoapHttpClientProtocol { + + private System.Threading.SendOrPostCallback FindLRCOperationCompleted; + + private System.Threading.SendOrPostCallback FindLRCsOperationCompleted; + + private System.Threading.SendOrPostCallback SaveLRCOperationCompleted; + + private System.Threading.SendOrPostCallback SaveLRCWithGuidOperationCompleted; + + private System.Threading.SendOrPostCallback NewDomainOperationCompleted; + + private bool useDefaultCredentialsSetExplicitly; + + /// <remarks/> + public LrcFinder() { + this.Url = global::LyricsEngine.Properties.Settings.Default.LyricsEngine_lrcfinder_LrcFinder; + if ((this.IsLocalFileSystemWebService(this.Url) == true)) { + this.UseDefaultCredentials = true; + this.useDefaultCredentialsSetExplicitly = false; + } + else { + this.useDefaultCredentialsSetExplicitly = true; + } + } + + public new string Url { + get { + return base.Url; + } + set { + if ((((this.IsLocalFileSystemWebService(base.Url) == true) + && (this.useDefaultCredentialsSetExplicitly == false)) + && (this.IsLocalFileSystemWebService(value) == false))) { + base.UseDefaultCredentials = false; + } + base.Url = value; + } + } + + public new bool UseDefaultCredentials { + get { + return base.UseDefaultCredentials; + } + set { + base.UseDefaultCredentials = value; + this.useDefaultCredentialsSetExplicitly = true; + } + } + + /// <remarks/> + public event FindLRCCompletedEventHandler FindLRCCompleted; + + /// <remarks/> + public event FindLRCsCompletedEventHandler FindLRCsCompleted; + + /// <remarks/> + public event SaveLRCCompletedEventHandler SaveLRCCompleted; + + /// <remarks/> + public event SaveLRCWithGuidCompletedEventHandler SaveLRCWithGuidCompleted; + + /// <remarks/> + public event NewDomainCompletedEventHandler NewDomainCompleted; + + /// <remarks/> + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/FindLRC", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string FindLRC(string artist, string title) { + object[] results = this.Invoke("FindLRC", new object[] { + artist, + title}); + return ((string)(results[0])); + } + + /// <remarks/> + public void FindLRCAsync(string artist, string title) { + this.FindLRCAsync(artist, title, null); + } + + /// <remarks/> + public void FindLRCAsync(string artist, string title, object userState) { + if ((this.FindLRCOperationCompleted == null)) { + this.FindLRCOperationCompleted = new System.Threading.SendOrPostCallback(this.OnFindLRCOperationCompleted); + } + this.InvokeAsync("FindLRC", new object[] { + artist, + title}, this.FindLRCOperationCompleted, userState); + } + + private void OnFindLRCOperationCompleted(object arg) { + if ((this.FindLRCCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.FindLRCCompleted(this, new FindLRCCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// <remarks/> + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/FindLRCs", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public System.Data.DataTable FindLRCs(string artist, string title) { + object[] results = this.Invoke("FindLRCs", new object[] { + artist, + title}); + return ((System.Data.DataTable)(results[0])); + } + + /// <remarks/> + public void FindLRCsAsync(string artist, string title) { + this.FindLRCsAsync(artist, title, null); + } + + /// <remarks/> + public void FindLRCsAsync(string artist, string title, object userState) { + if ((this.FindLRCsOperationCompleted == null)) { + this.FindLRCsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnFindLRCsOperationCompleted); + } + this.InvokeAsync("FindLRCs", new object[] { + artist, + title}, this.FindLRCsOperationCompleted, userState); + } + + private void OnFindLRCsOperationCompleted(object arg) { + if ((this.FindLRCsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.FindLRCsCompleted(this, new FindLRCsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// <remarks/> + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SaveLRC", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string SaveLRC(string lrcFileString) { + object[] results = this.Invoke("SaveLRC", new object[] { + lrcFileString}); + return ((string)(results[0])); + } + + /// <remarks/> + public void SaveLRCAsync(string lrcFileString) { + this.SaveLRCAsync(lrcFileString, null); + } + + /// <remarks/> + public void SaveLRCAsync(string lrcFileString, object userState) { + if ((this.SaveLRCOperationCompleted == null)) { + this.SaveLRCOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSaveLRCOperationCompleted); + } + this.InvokeAsync("SaveLRC", new object[] { + lrcFileString}, this.SaveLRCOperationCompleted, userState); + } + + private void OnSaveLRCOperationCompleted(object arg) { + if ((this.SaveLRCCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SaveLRCCompleted(this, new SaveLRCCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// <remarks/> + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SaveLRCWithGuid", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string SaveLRCWithGuid(string lrcFileString, System.Guid guid) { + object[] results = this.Invoke("SaveLRCWithGuid", new object[] { + lrcFileString, + guid}); + return ((string)(results[0])); + } + + /// <remarks/> + public void SaveLRCWithGuidAsync(string lrcFileString, System.Guid guid) { + this.SaveLRCWithGuidAsync(lrcFileString, guid, null); + } + + /// <remarks/> + public void SaveLRCWithGuidAsync(string lrcFileString, System.Guid guid, object userState) { + if ((this.SaveLRCWithGuidOperationCompleted == null)) { + this.SaveLRCWithGuidOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSaveLRCWithGuidOperationCompleted); + } + this.InvokeAsync("SaveLRCWithGuid", new object[] { + lrcFileString, + guid}, this.SaveLRCWithGuidOperationCompleted, userState); + } + + private void OnSaveLRCWithGuidOperationCompleted(object arg) { + if ((this.SaveLRCWithGuidCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SaveLRCWithGuidCompleted(this, new SaveLRCWithGuidCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// <remarks/> + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/NewDomain", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string[] NewDomain() { + object[] results = this.Invoke("NewDomain", new object[0]); + return ((string[])(results[0])); + } + + /// <remarks/> + public void NewDomainAsync() { + this.NewDomainAsync(null); + } + + /// <remarks/> + public void NewDomainAsync(object userState) { + if ((this.NewDomainOperationCompleted == null)) { + this.NewDomainOperationCompleted = new System.Threading.SendOrPostCallback(this.OnNewDomainOperationCompleted); + } + this.InvokeAsync("NewDomain", new object[0], this.NewDomainOperationCompleted, userState); + } + + private void OnNewDomainOperationCompleted(object arg) { + if ((this.NewDomainCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.NewDomainCompleted(this, new NewDomainCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// <remarks/> + public new void CancelAsync(object userState) { + base.CancelAsync(userState); + } + + private bool IsLocalFileSystemWebService(string url) { + if (((url == null) + || (url == string.Empty))) { + return false; + } + System.Uri wsUri = new System.Uri(url); + if (((wsUri.Port >= 1024) + && (string.Compare(wsUri.Host, "localHost", System.StringComparison.OrdinalIgnoreCase) == 0))) { + return true; + } + return false; + } + } + + /// <remarks/> + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.3053")] + public delegate void FindLRCCompletedEventHandler(object sender, FindLRCCompletedEventArgs e); + + /// <remarks/> + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.3053")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class FindLRCCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal FindLRCCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// <remarks/> + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// <remarks/> + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.3053")] + public delegate void FindLRCsCompletedEventHandler(object sender, FindLRCsCompletedEventArgs e); + + /// <remarks/> + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.3053")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class FindLRCsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal FindLRCsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// <remarks/> + public System.Data.DataTable Result { + get { + this.RaiseExceptionIfNecessary(); + return ((System.Data.DataTable)(this.results[0])); + } + } + } + + /// <remarks/> + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.3053")] + public delegate void SaveLRCCompletedEventHandler(object sender, SaveLRCCompletedEventArgs e); + + /// <remarks/> + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.3053")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SaveLRCCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal SaveLRCCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// <remarks/> + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// <remarks/> + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.3053")] + public delegate void SaveLRCWithGuidCompletedEventHandler(object sender, SaveLRCWithGuidCompletedEventArgs e); + + /// <remarks/> + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.3053")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SaveLRCWithGuidCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal SaveLRCWithGuidCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// <remarks/> + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// <remarks/> + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.3053")] + public delegate void NewDomainCompletedEventHandler(object sender, NewDomainCompletedEventArgs e); + + /// <remarks/> + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.3053")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class NewDomainCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal NewDomainCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// <remarks/> + public string[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string[])(this.results[0])); + } + } + } +} + +#pragma warning restore 1591 \ No newline at end of file Added: trunk/plugins/MyLyrics/LyricsEngine/Web References/lrcfinder/Reference.map =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/Web References/lrcfinder/Reference.map (rev 0) +++ trunk/plugins/MyLyrics/LyricsEngine/Web References/lrcfinder/Reference.map 2009-05-28 13:10:24 UTC (rev 2872) @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8"?> +<DiscoveryClientResultsFile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <Results> + <DiscoveryClientResult referenceType="System.Web.Services.Discovery.DiscoveryDocumentReference" url="http://lrcfinder.profiler.nl/LrcFinder.asmx?disco" filename="LrcFinder.disco" /> + <DiscoveryClientResult referenceType="System.Web.Services.Discovery.ContractReference" url="http://lrcfinder.profiler.nl/LrcFinder.asmx?wsdl" filename="LrcFinder.wsdl" /> + </Results> +</DiscoveryClientResultsFile> \ No newline at end of file Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs 2009-05-28 04:26:06 UTC (rev 2871) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs 2009-05-28 13:10:24 UTC (rev 2872) @@ -350,7 +350,7 @@ this.btCancel.Name = "btCancel"; this.btCancel.Size = new System.Drawing.Size(78, 23); this.btCancel.TabIndex = 33; - this.btCancel.Text = "Cancel"; + this.btCancel.Text = "Stop"; this.btCancel.UseVisualStyleBackColor = true; this.btCancel.Click += new System.EventHandler(this.btCancel_Click); // @@ -362,7 +362,7 @@ this.mpLabel3.Size = new System.Drawing.Size(304, 26); this.mpLabel3.TabIndex = 12; this.mpLabel3.Text = "Press \'Start\' to fetch lyrics matching content of music database.\r\nPress \'Stop\' t" + - "o stop a running batch search."; + "o end a running batch search."; // // gbMessages // Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.cs 2009-05-28 04:26:06 UTC (rev 2871) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.cs 2009-05-28 13:10:24 UTC (rev 2872) @@ -154,82 +154,32 @@ GetSettingsFromConfigurationXml(); #region Serialzie/deserialize lyricsdatabases - string lyricsXMLpath = MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Base, MyLyricsSettings.LyricsXMLName); - FileInfo lyricsXMLfileInfo = new FileInfo(lyricsXMLpath); + string path = MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Database, MyLyricsSettings.LyricsDBName); + FileInfo fileInfo = new FileInfo(path); - // If lyrics.xml present, then convert database to new format... - if (lyricsXMLfileInfo.Exists) + // .. but only if the databases hasn't been created + if (fileInfo.Exists == false) { + path = MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Database, MyLyricsSettings.LyricsDBName); - string path = MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Database, MyLyricsSettings.LyricsDBName); - FileInfo fileInfo = new FileInfo(path); + // Serialize empty LyricsDatabase if no lyrics.xml present + FileStream fs = new FileStream(path, FileMode.Create); + BinaryFormatter bf = new BinaryFormatter(); + MyLyricsSettings.LyricsDB = new LyricsDatabase(); + bf.Serialize(fs, MyLyricsSettings.LyricsDB); + fs.Close(); - // .. but only if it hasn't already been converted - if (fileInfo.Exists == false) - { - if (MessageBox.Show(this, "Your database will have to be upgraded to work with this version\r\nUpgrade now?", "Upgrade lyricsdatabase", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) - { - ConvertFromXMLtoLyricsDatabase convertFromXMLtoLyricsDatabase = new ConvertFromXMLtoLyricsDatabase(); - MyLyricsSettings.LyricsDB = convertFromXMLtoLyricsDatabase.Convert(lyricsXMLpath); - - // Create file to save the database to - FileStream fs = new FileStream(path, FileMode.Create); - - // Create a BinaryFormatter object to perform the serialization - BinaryFormatter bf = new BinaryFormatter(); - - // Use the BinaryFormatter object to serialize the database to the file - bf.Serialize(fs, MyLyricsSettings.LyricsDB); - fs.Close(); - - // Create likewise a database for the remainingLyrics - path = MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Database, MyLyricsSettings.LyricsMarkedDBName); - fs = new FileStream(path, FileMode.Create); - MyLyricsSettings.LyricsMarkedDB = new LyricsDatabase(); - bf.Serialize(fs, MyLyricsSettings.LyricsMarkedDB); - - // Close the file - fs.Close(); - } - } - - // ... else deserialize the databases and save reference in LyricsDB and LyricsMarkedDB - else - { - DeserializeBothDB(); - } + // Serialize empty LyricsMarkedDatabase + path = MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Database, MyLyricsSettings.LyricsMarkedDBName); + fs = new FileStream(path, FileMode.Create); + MyLyricsSettings.LyricsMarkedDB = new LyricsDatabase(); + bf.Serialize(fs, MyLyricsSettings.LyricsMarkedDB); + fs.Close(); } - - // If no Lyrics.xml present in base, then create new serialized databases else { - string path = MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Database, MyLyricsSettings.LyricsDBName); - FileInfo fileInfo = new FileInfo(path); - - // .. but only if the databases hasn't been created - if (fileInfo.Exists == false) - { - path = MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Database, MyLyricsSettings.LyricsDBName); - - // Serialize empty LyricsDatabase if no lyrics.xml present - FileStream fs = new FileStream(path, FileMode.Create); - BinaryFormatter bf = new BinaryFormatter(); - MyLyricsSettings.LyricsDB = new LyricsDatabase(); - bf.Serialize(fs, MyLyricsSettings.LyricsDB); - fs.Close(); - - // Serialize empty LyricsMarkedDatabase - path = MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Database, MyLyricsSettings.LyricsMarkedDBName); - fs = new FileStream(path, FileMode.Create); - MyLyricsSettings.LyricsMarkedDB = new LyricsDatabase(); - bf.Serialize(fs, MyLyricsSettings.LyricsMarkedDB); - fs.Close(); - } - else - { - DeserializeBothDB(); - } + DeserializeBothDB(); } LyricsLibrary.CurrentDB = MyLyricsSettings.LyricsDB; @@ -939,14 +889,14 @@ if (lc != null) { - lc.FinishThread(m_artist, m_track, "The search has been cancelled by the user.", "none"); + lc.FinishThread(m_artist, m_track, "The search has been stopped by the user.", "none"); lc.Dispose(); lc = null; } else { m_EventStopThread.Set(); - ThreadFinishedMethod(m_artist, m_track, "The search has been cancelled by the user.", "none"); + ThreadFinishedMethod(m_artist, m_track, "The search has been stopped by the user.", "none"); } bgWorkerSearch.CancelAsync(); Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.resx =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.resx 2009-05-28 04:26:06 UTC (rev 2871) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.resx 2009-05-28 13:10:24 UTC (rev 2872) @@ -123,12 +123,6 @@ <metadata name="Replace.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> - <metadata name="Find.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="Replace.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> <metadata name="bgWorkerSearch.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>6, 4</value> </metadata> Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyricsSettings.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyricsSettings.cs 2009-05-28 04:26:06 UTC (rev 2871) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyricsSettings.cs 2009-05-28 13:10:24 UTC (rev 2872) @@ -23,7 +23,6 @@ internal static LyricsDatabase LyricsMarkedDB = null; internal static string LyricsDBName = "LyricsDatabaseV2.db"; internal static string LyricsMarkedDBName = "LyricsMarkedDatabaseV2.db"; - internal static string LyricsXMLName = "Lyrics.xml"; // log information internal static string LogName = "MyLyrics.log"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2009-06-26 19:24:47
|
Revision: 2965 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2965&view=rev Author: saamand Date: 2009-06-26 19:24:43 +0000 (Fri, 26 Jun 2009) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LrcFinder.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 Configuration/MyLyricsSetup.resx trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs trunk/plugins/MyLyrics/My Lyrics/MyLyricsExternCode.cs trunk/plugins/MyLyrics/My Lyrics/change log.txt Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LrcFinder.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LrcFinder.cs 2009-06-26 16:01:48 UTC (rev 2964) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LrcFinder.cs 2009-06-26 19:24:43 UTC (rev 2965) @@ -86,7 +86,7 @@ private bool LrcReturned(string lrc) { - if (!lrc.Equals("Not found") && !lrc.Equals("NOT FOUND") && lrc.Length != 0) + if (lrc != null && !lrc.Equals("Not found") && !lrc.Equals("NOT FOUND") && lrc.Length != 0) { return true; } Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs 2009-06-26 16:01:48 UTC (rev 2964) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs 2009-06-26 19:24:43 UTC (rev 2965) @@ -121,6 +121,7 @@ this.tabPageAbout = new System.Windows.Forms.TabPage(); this.btClose = new MediaPortal.UserInterface.Controls.MPButton(); this.bgWorkerSearch = new System.ComponentModel.BackgroundWorker(); + this.cbEnableLogging = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.tabControl.SuspendLayout(); this.tabPageDatabase.SuspendLayout(); this.gbGenerel.SuspendLayout(); @@ -829,9 +830,9 @@ this.cbMoveSongFrom.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.cbMoveSongFrom.Location = new System.Drawing.Point(16, 46); this.cbMoveSongFrom.Name = "cbMoveSongFrom"; - this.cbMoveSongFrom.Size = new System.Drawing.Size(341, 17); + this.cbMoveSongFrom.Size = new System.Drawing.Size(294, 17); this.cbMoveSongFrom.TabIndex = 7; - this.cbMoveSongFrom.Text = "Move lyrics from marked database to lyrics database when updated"; + this.cbMoveSongFrom.Text = "Move lyrics from marked to lyrics database when updated"; this.cbMoveSongFrom.UseVisualStyleBackColor = true; this.cbMoveSongFrom.Leave += new System.EventHandler(this.WriteMediaPortalXML); // @@ -851,6 +852,7 @@ // // mpGroupBox2 // + this.mpGroupBox2.Controls.Add(this.cbEnableLogging); this.mpGroupBox2.Controls.Add(this.tbPluginName); this.mpGroupBox2.Controls.Add(this.lbPluginName); this.mpGroupBox2.FlatStyle = System.Windows.Forms.FlatStyle.Popup; @@ -867,7 +869,7 @@ this.tbPluginName.Location = new System.Drawing.Point(94, 19); this.tbPluginName.MaxLength = 30; this.tbPluginName.Name = "tbPluginName"; - this.tbPluginName.Size = new System.Drawing.Size(144, 20); + this.tbPluginName.Size = new System.Drawing.Size(129, 20); this.tbPluginName.TabIndex = 13; this.tbPluginName.Text = "My Lyrics"; this.tbPluginName.Leave += new System.EventHandler(this.WriteMediaPortalXML); @@ -1191,6 +1193,18 @@ this.bgWorkerSearch.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.bgWorkerSearch_RunWorkerCompleted); this.bgWorkerSearch.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.bgWorkerSearch_ProgressChanged); // + // cbEnableLogging + // + this.cbEnableLogging.AutoSize = true; + this.cbEnableLogging.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.cbEnableLogging.Location = new System.Drawing.Point(360, 20); + this.cbEnableLogging.Name = "cbEnableLogging"; + this.cbEnableLogging.Size = new System.Drawing.Size(94, 17); + this.cbEnableLogging.TabIndex = 11; + this.cbEnableLogging.Text = "Enable logging"; + this.cbEnableLogging.UseVisualStyleBackColor = true; + this.cbEnableLogging.Leave += new System.EventHandler(this.WriteMediaPortalXML); + // // MyLyricsSetup // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -1338,5 +1352,6 @@ private MediaPortal.UserInterface.Controls.MPTextBox tbLrcTaggingName; private MediaPortal.UserInterface.Controls.MPLabel lbLrcTaggingName; public MediaPortal.UserInterface.Controls.MPTabControl tabControl; + internal MediaPortal.UserInterface.Controls.MPCheckBox cbEnableLogging; } } \ 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 2009-06-26 16:01:48 UTC (rev 2964) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.cs 2009-06-26 19:24:43 UTC (rev 2965) @@ -36,6 +36,10 @@ MusicDatabaseBrowse musicDatabaseBrowseUC; Information informationUC; + private string log; + private string logFileName = "MyLyrics_Batch.log"; + private string logFullFileName = ""; + // events used to stop worker thread ManualResetEvent m_EventStopThread; @@ -79,6 +83,7 @@ bool m_DisregardVariousArtist = true; bool m_SearchOnlyMarkedSongs = false; + bool m_enableLogging = false; bool m_automaticWriteToMusicTag = true; bool m_automaticReadFromToMusicTag = true; @@ -205,6 +210,15 @@ else if (sitesMode.Equals(rbUserSelectMode.Tag)) { rbUserSelectMode.Checked = true; + + cbLrcFinder.Checked = xmlreader.GetValue("myLyrics", "useLrcFinder").Equals("True"); + cbLyricWiki.Checked = xmlreader.GetValue("myLyrics", "useLyricWiki").Equals("True"); + cbActionext.Checked = xmlreader.GetValue("myLyrics", "useActionext").Equals("True"); + cbLyrDB.Checked = xmlreader.GetValue("myLyrics", "useLyrDB").Equals("True"); + cbLyrics007.Checked = xmlreader.GetValue("myLyrics", "useLyrics007").Equals("True"); + cbLyricsOnDemand.Checked = xmlreader.GetValue("myLyrics", "useLyricsOnDemand").Equals("True"); + cbSeekLyrics.Checked = xmlreader.GetValue("myLyrics", "useSeekLyrics").Equals("True"); + cbHotLyrics.Checked = xmlreader.GetValue("myLyrics", "useHotLyrics").Equals("True"); } else { @@ -215,6 +229,8 @@ tbLimit.Text = xmlreader.GetValueAsString("myLyrics", "limit", m_TotalTitles.ToString()); tbPluginName.Text = xmlreader.GetValueAsString("myLyrics", "pluginsName", "My Lyrics"); + m_enableLogging = xmlreader.GetValue("myLyrics", "loggingEnabled").Equals("True"); + cbEnableLogging.Checked = m_enableLogging; cbAutoFetch.Checked = xmlreader.GetValue("myLyrics", "automaticFetch").Equals("yes"); cbAutomaticUpdate.Checked = xmlreader.GetValue("myLyrics", "automaticUpdateWhenFirstFound").Equals("yes"); @@ -363,6 +379,7 @@ private void btStartBatchSearch_Click(object sender, System.EventArgs e) { + if (bgWorkerSearch.IsBusy) { Thread.Sleep(2000); @@ -372,6 +389,49 @@ MyLyricsSetup.UpdateLibraryUI = true; + m_Limit = int.Parse(tbLimit.Text); + + if (m_Limit == 0) + { + ThreadFinished = new string[] { "", "", "You must select a number of songs to search", "error" }; + return; + } + + if (m_enableLogging) + { + + logFullFileName = Config.GetFile(Config.Dir.Log, logFileName); + + FileStream file = null; + StreamReader sr = null; + System.IO.StreamWriter writerLog = null; + + //if file is not found, create a new xml file + if (!System.IO.File.Exists(logFullFileName)) + { + file = new FileStream(logFullFileName, FileMode.OpenOrCreate, FileAccess.Write); + file.Close(); + sr = File.OpenText(logFullFileName); + log = sr.ReadToEnd(); + sr.Close(); + log += DateTime.Now.ToString() + " The log has been created.\r\n"; + writerLog = new System.IO.StreamWriter(logFullFileName); + writerLog.Write(log); + writerLog.Close(); + } + + file = new FileStream(logFullFileName, FileMode.OpenOrCreate, FileAccess.Write); + file.Close(); + sr = File.OpenText(logFullFileName); + log = sr.ReadToEnd(); + sr.Close(); + log += "\r\n"; + log += DateTime.Now.ToString() + string.Format(" ***** New batch search for {0} lyrics started *****.\r\n", m_Limit); + writerLog = new System.IO.StreamWriter(logFullFileName); + writerLog.Write(log); + writerLog.Close(); + } + stopwatch.StartZero(); lbTimer.Text = "00:00.00"; timer = new System.Windows.Forms.Timer(); @@ -396,15 +456,6 @@ btStartBatchSearch.Enabled = false; - 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 = cbDontSearchSongsInLyricDB.Enabled && cbDontSearchSongsInLyricDB.Checked; m_MarkSongsWhenNoLyricFound = cbMarkSongsWithNoLyrics.Enabled && cbMarkSongsWithNoLyrics.Checked; m_DisregardMarkedLyric = cbDisregardSongsWithNoLyric.Enabled && cbDisregardSongsWithNoLyric.Checked; @@ -506,6 +557,19 @@ lbLastActivity2.Text = capArtist + " - " + capTitle + " has a match at " + site + ".\r\n"; + if (m_enableLogging) + { + StreamReader sr = File.OpenText(logFullFileName); + log = sr.ReadToEnd(); + sr.Close(); + string logText = capArtist + " - " + capTitle + " has a match at " + site + ".\r\n"; + log += DateTime.Now.ToString() + " " + logText; + lbLastActivity2.Text = logText; + System.IO.StreamWriter writerLog = new System.IO.StreamWriter(logFullFileName); + writerLog.Write(log); + writerLog.Close(); + } + progressBar.PerformStep(); this.Update(); } @@ -531,6 +595,19 @@ lbLastActivity2.Text = "No match for \"" + capArtist + " - " + capTitle + "\".\r\n"; + if (m_enableLogging) + { + StreamReader sr = File.OpenText(logFullFileName); + log = sr.ReadToEnd(); + sr.Close(); + string logText = "No match found to " + capArtist + " - " + capTitle + ".\r\n"; + log += DateTime.Now.ToString() + " " + logText; + lbLastActivity2.Text = logText; + System.IO.StreamWriter writerLog = new System.IO.StreamWriter(logFullFileName); + writerLog.Write(log); + writerLog.Close(); + } + progressBar.PerformStep(); this.Update(); } @@ -574,6 +651,20 @@ btStartBatchSearch.Enabled = true; btCancel.Enabled = false; isSearching(false); + + if (m_enableLogging) + { + StreamReader sr = File.OpenText(logFullFileName); + log = sr.ReadToEnd(); + sr.Close(); + string logText = string.Format("The batch has ended with {0} found and {1} missed .\r\n", m_LyricsFound, m_LyricsNotFound); + log += DateTime.Now.ToString() + " " + logText; + log += DateTime.Now.ToString() + " ***** Batch search ended *****\r\n\r\n"; + lbLastActivity2.Text = logText; + System.IO.StreamWriter writerLog = new System.IO.StreamWriter(logFullFileName); + writerLog.Write(log); + writerLog.Close(); + } } // Called from worker thread using delegate and Control.Invoke @@ -1143,10 +1234,11 @@ sitesMode = rbLrcMode.Tag as string; } + xmlwriter.SetValue("myLyrics", "pluginsName", tbPluginName.Text); + xmlwriter.SetValue("myLyrics", "loggingEnabled", cbEnableLogging.Checked.ToString()); xmlwriter.SetValue("myLyrics", "sitesMode", sitesMode); xmlwriter.SetValue("myLyrics", "defaultSitesModeValue", trackBar.Value); xmlwriter.SetValue("myLyrics", "limit", tbLimit.Text); - xmlwriter.SetValue("myLyrics", "pluginsName", tbPluginName.Text); xmlwriter.SetValue("myLyrics", "useLrcFinder", cbLrcFinder.Checked.ToString()); xmlwriter.SetValue("myLyrics", "useLyricWiki", cbLyricWiki.Checked.ToString()); xmlwriter.SetValue("myLyrics", "useActionext", cbActionext.Checked.ToString()); Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.resx =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.resx 2009-06-26 16:01:48 UTC (rev 2964) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.resx 2009-06-26 19:24:43 UTC (rev 2965) @@ -123,6 +123,12 @@ <metadata name="Replace.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> + <metadata name="Find.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </metadata> + <metadata name="Replace.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </metadata> <metadata name="bgWorkerSearch.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>6, 4</value> </metadata> Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2009-06-26 16:01:48 UTC (rev 2964) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2009-06-26 19:24:43 UTC (rev 2965) @@ -88,6 +88,8 @@ string m_LastLyricText = ""; string m_LastFileName = ""; + string m_LastStreamFile = string.Empty; + int m_crossfade = 0; int m_SearchingState = 0; @@ -245,40 +247,52 @@ public override void Process() { - if (m_newTrack || m_SearchingState != (int)SEARCH_STATE.NOT_SEARCHING) + if ((m_newTrack || m_SearchingState != (int)SEARCH_STATE.NOT_SEARCHING) + && (!g_Player.IsRadio || !string.IsNullOrEmpty(m_artist))) { if (m_newTrack) { m_alreadyValidLRC = false; + m_lyricsFound = false; + StopThread(); + m_newTrack = false; + MusicDatabase mDB = MusicDatabase.Instance; - m_CurrentTrackTag = mDB.GetTag(g_Player.CurrentFile); GUIControl.SetControlLabel(GetID, (int)GUI_LRC_Controls.CONTROL_LRCPICK_STATUS, ""); - m_lyricsFound = false; - StopThread(); - m_newTrack = false; - - if (m_CurrentTrackTag != null) + if (g_Player.IsRadio == false) { - m_artist = m_CurrentTrackTag.Artist.Trim(); - m_artist = m_artist.Replace("| ", ""); - m_artist = m_artist.Replace(" |", ""); - m_artist = m_artist.Replace("''", "'"); - m_title = m_CurrentTrackTag.Title.Trim(); - m_title = m_title.Replace("''", "'"); + m_CurrentTrackTag = mDB.GetTag(g_Player.CurrentFile); - getAlbumArt(); + if (m_CurrentTrackTag != null) + { + m_artist = m_CurrentTrackTag.Artist.Trim(); + m_artist = m_artist.Replace("| ", ""); + m_artist = m_artist.Replace(" |", ""); + m_artist = m_artist.Replace("''", "'"); + m_title = m_CurrentTrackTag.Title.Trim(); + m_title = m_title.Replace("''", "'"); + + getAlbumArt(); + } } + else + { + getAlbumArt(m_artist); + } } - if (m_CurrentTrackTag != null) + if (m_CurrentTrackTag != null || g_Player.IsRadio) { - m_CurrentTrackTag.Artist = LyricUtil.CapatalizeString(GUIPropertyManager.GetProperty("#Play.Current.Artist")); - m_CurrentTrackTag.Title = LyricUtil.CapatalizeString(GUIPropertyManager.GetProperty("#Play.Current.Title")); - m_CurrentTrackTag.Lyrics = LyricUtil.FixLyrics(m_CurrentTrackTag.Lyrics); + if (!g_Player.IsRadio) + { + m_CurrentTrackTag.Artist = LyricUtil.CapatalizeString(GUIPropertyManager.GetProperty("#Play.Current.Artist")); + m_CurrentTrackTag.Title = LyricUtil.CapatalizeString(GUIPropertyManager.GetProperty("#Play.Current.Title")); + m_CurrentTrackTag.Lyrics = LyricUtil.FixLyrics(m_CurrentTrackTag.Lyrics); + } if (m_selectedScreen == (int)MyLyricsSettings.Screen.LYRICS_AUTO || m_selectedScreen == (int)MyLyricsSettings.Screen.LYRICS_BASIC @@ -375,7 +389,7 @@ m_lyricsFound = false; StopThread(); - if (m_CurrentTrackTag.Artist.Length != 0) + if (!string.IsNullOrEmpty(m_artist)) { FindLyric(); } @@ -605,6 +619,7 @@ { StopThread(); resetAll(); + resetGUI((int)MyLyricsSettings.Screen.LYRICS_BASIC); GUIGraphicsContext.ScrollSpeedVertical = m_startingScrollSpeedVertical; @@ -646,8 +661,14 @@ { TagLine(); } - else if (action.m_key.KeyChar.Equals(40) || action.m_key.KeyChar.Equals(101)) + else if (action.m_key.KeyChar.Equals(40) || action.m_key.KeyChar.Equals(101)) // 'E' { + // Don't use a stream to create a LRC + if (g_Player.IsRadio) + { + return; + } + m_lyricsFound = false; if (m_selectedScreen != (int)MyLyricsSettings.Screen.LRC_EDITOR) { @@ -811,11 +832,14 @@ StartShowingLrc(m_LyricText, true); } } - else if (action.m_key.KeyChar.Equals(8)) // 'Backslash' { RemoveLatestTagLine(); } + else if (action.m_key.KeyChar.Equals(98)) // 'B' (stop playing media) + { + resetGUI(m_selectedScreen); + } break; } case Action.ActionType.ACTION_REWIND: @@ -843,19 +867,6 @@ { if (tag2.Equals("#Play.Current.Track")) // track has changed { - //if (!m_LyricText.Equals(string.Empty) - // && (string.IsNullOrEmpty(m_CurrentTrackTag.Lyrics) || m_ValidLrcLyric)) - //{ - // m_ValidLrcLyric = false; - // m_LastLyricText = m_LyricText; - // m_LastFileName = m_CurrentTrackTag.FileName; - - // if (m_AutomaticWriteToMusicTag) - // { - // TagReaderUtil.WriteLyrics(m_LastFileName, m_LastLyricText); ; - // } - //} - if (value.Length != 0) // additional check { m_basicScreenSelected = null; @@ -881,6 +892,40 @@ GUIControl.SetControlLabel(GetID, (int)GUI_General_Controls.CONTROL_LBStatus, m_StatusText); } } + else if (g_Player.IsRadio) + { + string newArtist = LyricUtil.CapatalizeString(GUIPropertyManager.GetProperty("#Play.Current.Artist")); + string newTitle = LyricUtil.CapatalizeString(GUIPropertyManager.GetProperty("#Play.Current.Title")); + + if (string.IsNullOrEmpty(GUIPropertyManager.GetProperty("#Play.Current.Artist")) + || string.IsNullOrEmpty(GUIPropertyManager.GetProperty("#Play.Current.Title"))) + { + m_StatusText = "Stream info not complete"; + GUIControl.SetControlLabel(GetID, (int)GUI_General_Controls.CONTROL_LBStatus, m_StatusText); + } + else if(!g_Player.CurrentFile.Equals(m_LastStreamFile) + || !newArtist.Equals(m_artist) || !newTitle.Equals(m_title)) + { + resetGUI(m_selectedScreen); + StopThread(); + resetAll(); + + m_basicScreenSelected = null; + + m_SearchType = (int)SEARCH_TYPES.BOTH_LRCS_AND_LYRICS; + m_SearchingState = (int)SEARCH_STATE.NOT_SEARCHING; + + m_LastStreamFile = g_Player.CurrentFile; + + m_LastFileName = g_Player.CurrentFile; + m_artist = newArtist; + m_title = newTitle; + + m_newTrack = true; + + Process(); + } + } else if (m_selectedScreen == (int)MyLyricsSettings.Screen.LYRICS_BASIC || m_selectedScreen == (int)MyLyricsSettings.Screen.LRC_BASIC || m_selectedScreen == (int)MyLyricsSettings.Screen.LRC_EDITOR) @@ -922,7 +967,7 @@ resetGUI((int)MyLyricsSettings.Screen.LRC_BASIC); - if (m_CurrentTrackTag != null && m_CurrentTrackTag.Artist != "") + if ((m_CurrentTrackTag != null && m_CurrentTrackTag.Artist != "") || g_Player.IsRadio) { m_TrackText = m_artist + " - " + m_title; @@ -942,7 +987,8 @@ #region 1) LRC in music tag - if (m_AutomaticReadFromMusicTag && ((m_CurrentTrackTag.Lyrics.Length != 0 + if (m_AutomaticReadFromMusicTag && g_Player.IsRadio == false + && m_CurrentTrackTag != null &&((m_CurrentTrackTag.Lyrics.Length != 0 && (m_SimpleLrc = new SimpleLRC(m_artist, m_title, m_CurrentTrackTag.Lyrics)).IsValid))) { if (m_SimpleLrc.IsValid) @@ -1020,7 +1066,7 @@ private bool FindLyric() { - if (m_CurrentTrackTag != null && m_CurrentTrackTag.Artist != "") + if ((m_CurrentTrackTag != null && m_CurrentTrackTag.Artist != "") || g_Player.IsRadio) { string lyricText = string.Empty; @@ -1034,7 +1080,8 @@ { #region 4) Lyric in music tag - if (m_AutomaticReadFromMusicTag && m_CurrentTrackTag.Lyrics.Length != 0 + if (m_AutomaticReadFromMusicTag && g_Player.IsRadio == false + && m_CurrentTrackTag != null && m_CurrentTrackTag.Lyrics.Length != 0 && !((m_SearchType == (int)SEARCH_TYPES.ONLY_LYRICS) && new SimpleLRC(m_artist, m_title, m_CurrentTrackTag.Lyrics).IsValid)) { string lyric = LyricUtil.FixLyrics(m_CurrentTrackTag.Lyrics); @@ -1047,7 +1094,7 @@ #region 5) Lyric in music database if (lyricText.Length != 0 && - !((m_SearchType == (int)SEARCH_TYPES.ONLY_LYRICS) && new SimpleLRC(m_artist, m_title, m_CurrentTrackTag.Lyrics).IsValid)) + !((m_SearchType == (int)SEARCH_TYPES.ONLY_LYRICS) && m_CurrentTrackTag != null && new SimpleLRC(m_artist, m_title, m_CurrentTrackTag.Lyrics).IsValid)) { LyricFound = new Object[] { lyricText, m_artist, m_title, "lyrics database" }; return true; Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyricsExternCode.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyricsExternCode.cs 2009-06-26 16:01:48 UTC (rev 2964) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyricsExternCode.cs 2009-06-26 19:24:43 UTC (rev 2965) @@ -43,7 +43,19 @@ AddImageToImagePathContainer(m_CurrentThumbFileName); } - m_CurrentThumbFileName = GUIMusicFiles.GetArtistCoverArtName(m_CurrentTrackTag.Artist); + UpdateImagePathContainer(); + } + + public void getAlbumArt(string artist) + { + m_ImagePathContainer.Clear(); + + m_PreviousTrackTag = null; + m_CurrentTrackTag = null; + m_NextTrackTag = null; + + m_CurrentThumbFileName = MediaPortal.Util.Utils.GetCoverArtName(Thumbs.MusicArtists, artist); + if (m_CurrentThumbFileName.Length > 0) { // let us test if there is a larger cover art image Modified: trunk/plugins/MyLyrics/My Lyrics/change log.txt =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/change log.txt 2009-06-26 16:01:48 UTC (rev 2964) +++ trunk/plugins/MyLyrics/My Lyrics/change log.txt 2009-06-26 19:24:43 UTC (rev 2965) @@ -1,4 +1,4 @@ -Release notes to MyLyrics 1.30 +Release notes to MyLyrics 1.31 MyLyrics enables the display of lyrics for the currently played music file inside MediaPortal. The plugin is able show LRC and plain lyrics, and uses both musictags and online searches to find lyrics. @@ -36,16 +36,9 @@ Installation: Simple copy the content of the zip-file into your MP library (typical C:\Program Files\Team MediaPortal\MediaPortal). -Noteworthy changes since version 1.23: -* Add: Support for LRCFinder webservice (a big, BIG thank you to BennieBoy!). -* Add: New screen "LRC pick" added (enter and leave by pressing 'P'). -* Add: Option to upload manual created LRC file to LRCFinder and share it with the community (default disabled). -* Add: Toggle between LRC and lyric mode with hotkey 'F'. -* Add: LRC mode added to the configuration (search only for LRC-files). -* Add: In LRC editor mode 'backslash' can be used to erase the latest tagged line. -* Add: LRC editor mode screen extended to include coverart. -* Add: New GUI item "LRC pick status" added to skin (ID 1011). -* Fix: Blue3 skin modified. -* Fix: Deleted entries in "Find & replace" dialogue were not removed correctly. -* Fix: Performance improvement when deleting entry in lyrics database. +Noteworthy changes since version 1.30: +* Add: Support for Last.fm streams +* Add: Support for ShoutCast streams +* Add: Logging has been reintroduced for better support (has to be enabled in configuration). +* Fix: Too high thread level introduced memory when searching for 5000+ songs in batch. * and a lot of minor fixes! \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2009-06-27 18:09:59
|
Revision: 2966 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2966&view=rev Author: saamand Date: 2009-06-27 18:09:56 +0000 (Sat, 27 Jun 2009) Log Message: ----------- MyLyrics version 1.31 Modified Paths: -------------- trunk/plugins/MyLyrics/LyricsEngine/LyricDiagnostics.cs trunk/plugins/MyLyrics/LyricsEngine/Properties/AssemblyInfo.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.resx trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs trunk/plugins/MyLyrics/My Lyrics/change log.txt Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricDiagnostics.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricDiagnostics.cs 2009-06-26 19:24:43 UTC (rev 2965) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricDiagnostics.cs 2009-06-27 18:09:56 UTC (rev 2966) @@ -17,28 +17,34 @@ public static void OpenLog(string url) { - logFileName = url; + try + { - if (ts == null) - { - if (File.Exists(logFileName)) + logFileName = url; + + if (ts == null) { - FileInfo file = new FileInfo(logFileName); - try + if (File.Exists(logFileName)) { - file.Delete(); + FileInfo file = new FileInfo(logFileName); + try + { + file.Delete(); + } + catch { }; } - catch { }; + + ts = new TraceSource("MyLyrics"); + ts.Switch = new SourceSwitch("sw1", "All"); + objStream = new FileStream(logFileName, FileMode.OpenOrCreate); + objTraceListener = new TextWriterTraceListener(objStream); + objTraceListener.Filter = new EventTypeFilter(SourceLevels.All); + ts.Listeners.Add(objTraceListener); + StartTimer(); } - - ts = new TraceSource("MyLyrics"); - ts.Switch = new SourceSwitch("sw1", "All"); - objStream = new FileStream(logFileName, FileMode.OpenOrCreate); - objTraceListener = new TextWriterTraceListener(objStream); - objTraceListener.Filter = new EventTypeFilter(SourceLevels.All); - ts.Listeners.Add(objTraceListener); - StartTimer(); } + catch (Exception e) + { ;} } public static void Dispose() @@ -86,19 +92,29 @@ private static void StopTimer() { - stopWatch.Stop(); + if (stopWatch != null) + { + stopWatch.Stop(); + } } public static string ElapsedTimeString() { - long time = stopWatch.ElapsedMilliseconds; - long sec = time / 1000; - long ms = (time / 100) - (sec * 10); - string str = ""; - str += (sec < 100) ? "0" : ""; - str += (sec < 10) ? "0" : ""; - str += sec.ToString() + "." + ms.ToString(); - return str + ": "; + if (stopWatch != null) + { + long time = stopWatch.ElapsedMilliseconds; + long sec = time / 1000; + long ms = (time / 100) - (sec * 10); + string str = ""; + str += (sec < 100) ? "0" : ""; + str += (sec < 10) ? "0" : ""; + str += sec.ToString() + "." + ms.ToString(); + return str + ": "; + } + else + { + return string.Empty; + } } } } Modified: trunk/plugins/MyLyrics/LyricsEngine/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/Properties/AssemblyInfo.cs 2009-06-26 19:24:43 UTC (rev 2965) +++ trunk/plugins/MyLyrics/LyricsEngine/Properties/AssemblyInfo.cs 2009-06-27 18:09:56 UTC (rev 2966) @@ -26,7 +26,7 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.30")] +[assembly: AssemblyVersion("1.31")] // // In order to sign your assembly you must specify a key to use. Refer to the Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs 2009-06-26 19:24:43 UTC (rev 2965) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs 2009-06-27 18:09:56 UTC (rev 2966) @@ -80,7 +80,7 @@ this.lbInfo1.Name = "lbInfo1"; this.lbInfo1.Size = new System.Drawing.Size(197, 18); this.lbInfo1.TabIndex = 3; - this.lbInfo1.Text = "MyLyrics plugin, version 1.30"; + this.lbInfo1.Text = "MyLyrics plugin, version 1.31"; // // label2 // Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs 2009-06-26 19:24:43 UTC (rev 2965) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs 2009-06-27 18:09:56 UTC (rev 2966) @@ -93,6 +93,7 @@ this.cbMoveSongFrom = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.cbAutoFetch = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.mpGroupBox2 = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.cbEnableLogging = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.tbPluginName = new MediaPortal.UserInterface.Controls.MPTextBox(); this.lbPluginName = new MediaPortal.UserInterface.Controls.MPLabel(); this.gbLyricSites = new MediaPortal.UserInterface.Controls.MPGroupBox(); @@ -121,7 +122,6 @@ this.tabPageAbout = new System.Windows.Forms.TabPage(); this.btClose = new MediaPortal.UserInterface.Controls.MPButton(); this.bgWorkerSearch = new System.ComponentModel.BackgroundWorker(); - this.cbEnableLogging = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.tabControl.SuspendLayout(); this.tabPageDatabase.SuspendLayout(); this.gbGenerel.SuspendLayout(); @@ -863,6 +863,18 @@ this.mpGroupBox2.TabStop = false; this.mpGroupBox2.Text = "Basic settings"; // + // cbEnableLogging + // + this.cbEnableLogging.AutoSize = true; + this.cbEnableLogging.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.cbEnableLogging.Location = new System.Drawing.Point(360, 20); + this.cbEnableLogging.Name = "cbEnableLogging"; + this.cbEnableLogging.Size = new System.Drawing.Size(94, 17); + this.cbEnableLogging.TabIndex = 11; + this.cbEnableLogging.Text = "Enable logging"; + this.cbEnableLogging.UseVisualStyleBackColor = true; + this.cbEnableLogging.Leave += new System.EventHandler(this.WriteMediaPortalXML); + // // tbPluginName // this.tbPluginName.BorderColor = System.Drawing.Color.Empty; @@ -1193,18 +1205,6 @@ this.bgWorkerSearch.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.bgWorkerSearch_RunWorkerCompleted); this.bgWorkerSearch.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.bgWorkerSearch_ProgressChanged); // - // cbEnableLogging - // - this.cbEnableLogging.AutoSize = true; - this.cbEnableLogging.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.cbEnableLogging.Location = new System.Drawing.Point(360, 20); - this.cbEnableLogging.Name = "cbEnableLogging"; - this.cbEnableLogging.Size = new System.Drawing.Size(94, 17); - this.cbEnableLogging.TabIndex = 11; - this.cbEnableLogging.Text = "Enable logging"; - this.cbEnableLogging.UseVisualStyleBackColor = true; - this.cbEnableLogging.Leave += new System.EventHandler(this.WriteMediaPortalXML); - // // MyLyricsSetup // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.resx =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.resx 2009-06-26 19:24:43 UTC (rev 2965) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.resx 2009-06-27 18:09:56 UTC (rev 2966) @@ -123,12 +123,6 @@ <metadata name="Replace.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> - <metadata name="Find.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="Replace.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> <metadata name="bgWorkerSearch.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>6, 4</value> </metadata> Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2009-06-26 19:24:43 UTC (rev 2965) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2009-06-27 18:09:56 UTC (rev 2966) @@ -55,6 +55,10 @@ bool m_useLyricWiki, m_useLrcFinder, m_useLyrics007, m_useLyricsOnDemand, m_useSeekLyrics, m_useHotLyrics, m_useActionext, m_useLyrDB; + bool m_enableLogging = false; + private string logFullFileName = ""; + private string logFileName = "MyLyrics.log"; + private string m_CurrentThumbFileName = string.Empty; private MusicTag m_PreviousTrackTag = null; private MusicTag m_CurrentTrackTag = null; @@ -479,6 +483,8 @@ m_useActionext = ((string)xmlreader.GetValueAsString("myLyrics", "useActionext", "True")).ToString().Equals("True") ? true : false; m_useLyrDB = ((string)xmlreader.GetValueAsString("myLyrics", "useLyrDB", "True")).ToString().Equals("True") ? true : false; + m_enableLogging = xmlreader.GetValue("myLyrics", "loggingEnabled").Equals("True"); + m_AutomaticWriteToMusicTag = xmlreader.GetValue("myLyrics", "automaticWriteToMusicTag").Equals("yes"); m_AutomaticReadFromMusicTag = xmlreader.GetValue("myLyrics", "automaticReadFromMusicTag").Equals("yes"); @@ -613,6 +619,13 @@ m_ImageChangeTimer.Elapsed += new ElapsedEventHandler(OnImageTimerTickEvent); m_ImageChangeTimer.Start(); } + + if (m_enableLogging) + { + logFullFileName = MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Log, logFileName); + LyricDiagnostics.OpenLog(logFullFileName); + LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Start, 0, LyricDiagnostics.ElapsedTimeString() + "MyLyrics opens"); + } } protected override void OnPageDestroy(int new_windowId) @@ -639,6 +652,12 @@ } } + if (m_enableLogging) + { + LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Stop, 0, LyricDiagnostics.ElapsedTimeString() + "MyLyrics closes"); + LyricDiagnostics.Dispose(); + } + //deregister the handler! GUIPropertyManager.OnPropertyChanged -= new GUIPropertyManager.OnPropertyChangedHandler(trackChangeHandler); } @@ -971,6 +990,11 @@ { m_TrackText = m_artist + " - " + m_title; + if (m_enableLogging) + { + LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Information, 0, LyricDiagnostics.ElapsedTimeString() + "FindLrc(" + m_artist + ", " + m_title + ")"); + } + /* The prioritized search order is: 1) LRC in music tag 2) LRC in database @@ -1068,6 +1092,10 @@ { if ((m_CurrentTrackTag != null && m_CurrentTrackTag.Artist != "") || g_Player.IsRadio) { + if (m_enableLogging) + { + LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Information, 0, LyricDiagnostics.ElapsedTimeString() + "FindLyric(" + m_artist + ", " + m_title + ")"); + } string lyricText = string.Empty; @@ -1156,6 +1184,11 @@ m_LrcTimeCollection = m_SimpleLrc.SimpleLRCTimeAndLineCollectionWithOffset; m_lines = m_LrcTimeCollection.Copy(); + if (m_enableLogging) + { + LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Information, 0, LyricDiagnostics.ElapsedTimeString() + "LRC found: " + m_artist + " - " + m_title + "."); + } + //Let's see if the basic or wide version of the LRC-screen should be shown bool aLongLinePresent = false; if (m_useAutoOnLyricLength && !showLrcPickScreen) @@ -1496,6 +1529,11 @@ m_lyricsFound = true; m_LyricText = lyricText; + if (m_enableLogging) + { + LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Information, 0, LyricDiagnostics.ElapsedTimeString() + "Lyric found: " + m_artist + " - " + m_title + ". Place: " + source); + } + m_StatusText = ""; GUIControl.SetControlLabel(GetID, (int)GUI_General_Controls.CONTROL_LBStatus, m_StatusText); @@ -2002,10 +2040,20 @@ if (site.Equals("LrcFinder")) { m_StatusText = "No matching LRC found"; + + if (m_enableLogging) + { + LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Information, 0, LyricDiagnostics.ElapsedTimeString() + "No matching LRC found for " + artist + " - " + title + ". Place: " + site); + } } else { m_StatusText = "No matching lyric found"; + + if (m_enableLogging) + { + LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Information, 0, LyricDiagnostics.ElapsedTimeString() + "No matching lyric found for " + artist + " - " + title + ". Place: " + site); + } } GUIControl.SetControlLabel(GetID, (int)GUI_General_Controls.CONTROL_LBStatus, m_StatusText); } @@ -2082,7 +2130,7 @@ /// </summary> public string Description() { - return "Showing the lyrics to your music!"; + return "Plugin used to manage and show lyrics"; } /// <summary> Modified: trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs 2009-06-26 19:24:43 UTC (rev 2965) +++ trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs 2009-06-27 18:09:56 UTC (rev 2966) @@ -31,5 +31,5 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.30")] -[assembly: AssemblyFileVersion("1.30")] +[assembly: AssemblyVersion("1.31")] +[assembly: AssemblyFileVersion("1.31")] Modified: trunk/plugins/MyLyrics/My Lyrics/change log.txt =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/change log.txt 2009-06-26 19:24:43 UTC (rev 2965) +++ trunk/plugins/MyLyrics/My Lyrics/change log.txt 2009-06-27 18:09:56 UTC (rev 2966) @@ -31,7 +31,7 @@ - LRC pick: uses BennieBoy's LRCFinder to select among different matching LRC entries. - LRC editor: enables the creation of lrc lyric from a plain lyric. -Compatible with MediaPortal 1.0.2. +Compatible with MediaPortal 1.0.2 and MediaPortal 1.1.0 Alpha Installation: Simple copy the content of the zip-file into your MP library (typical C:\Program Files\Team MediaPortal\MediaPortal). @@ -41,4 +41,5 @@ * Add: Support for ShoutCast streams * Add: Logging has been reintroduced for better support (has to be enabled in configuration). * Fix: Too high thread level introduced memory when searching for 5000+ songs in batch. +* Fix: StreamedMP skin fixed with correct colours for control id's 2xx and 3xx. * and a lot of minor fixes! \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2009-07-01 21:15:33
|
Revision: 2974 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2974&view=rev Author: saamand Date: 2009-07-01 21:15:19 +0000 (Wed, 01 Jul 2009) Log Message: ----------- Version 1.32 Modified Paths: -------------- trunk/plugins/MyLyrics/LyricsEngine/LyricsController.cs trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Actionext.cs trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/HotLyrics.cs trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LrcFinder.cs trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyrDB.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/LyricsEngine/LyricsSites/Wiki.cs trunk/plugins/MyLyrics/LyricsEngine/Properties/AssemblyInfo.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.cs trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs trunk/plugins/MyLyrics/My Lyrics/change log.txt Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsController.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsController.cs 2009-07-01 19:42:17 UTC (rev 2973) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsController.cs 2009-07-01 21:15:19 UTC (rev 2974) @@ -151,10 +151,10 @@ public void AddNewLyricSearch(string artist, string title, string strippedArtistName) { - ++m_noOfCurrentSearches; + if (lyricsSites.Length > 0 && !string.IsNullOrEmpty(artist) && !string.IsNullOrEmpty(title)) + { + ++m_noOfCurrentSearches; - if (lyricsSites.Length > 0) - { // create worker thread instance ThreadStart threadInstance = delegate { @@ -168,6 +168,10 @@ lyricSearchThread.Start(); threadList.Add(lyricSearchThread); } + else + { + return; + } } Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Actionext.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Actionext.cs 2009-07-01 19:42:17 UTC (rev 2973) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Actionext.cs 2009-07-01 21:15:19 UTC (rev 2974) @@ -27,11 +27,15 @@ timer = new System.Timers.Timer(); artist = LyricUtil.RemoveFeatComment(artist); - artist = LyricUtil.TrimForParenthesis(artist); artist = artist.Replace(" ", "_"); - title = LyricUtil.RemoveFeatComment(title); title = LyricUtil.TrimForParenthesis(title); title = title.Replace(" ", "_"); + + if (string.IsNullOrEmpty(artist) || string.IsNullOrEmpty(title)) + { + return; + } + string urlString = "http://www.actionext.com/names_" + artist[0] + "/" + artist + "_lyrics/" + title + ".html"; urlString = urlString.ToLower(); Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/HotLyrics.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/HotLyrics.cs 2009-07-01 19:42:17 UTC (rev 2973) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/HotLyrics.cs 2009-07-01 21:15:19 UTC (rev 2974) @@ -27,7 +27,6 @@ timer = new System.Timers.Timer(); artist = LyricUtil.RemoveFeatComment(artist); - artist = LyricUtil.TrimForParenthesis(artist); artist = LyricUtil.CapatalizeString(artist); artist = artist.Replace(" ", "_"); @@ -46,7 +45,6 @@ // French letters artist = artist.Replace("\xE9", "%E9"); - title = LyricUtil.RemoveFeatComment(title); title = LyricUtil.TrimForParenthesis(title); title = LyricUtil.CapatalizeString(title); @@ -83,10 +81,13 @@ // French letters title = title.Replace("\xE9", "%E9"); - string firstLetter = ""; - if (artist.Length > 0) - firstLetter = artist[0].ToString(); + if (string.IsNullOrEmpty(artist) || string.IsNullOrEmpty(title)) + { + return; + } + string firstLetter = artist[0].ToString(); + string urlString = "http://www.hotlyrics.net/lyrics/" + firstLetter + "/" + artist + "/" + title + ".html"; LyricsWebClient client = new LyricsWebClient(); Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LrcFinder.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LrcFinder.cs 2009-07-01 19:42:17 UTC (rev 2973) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LrcFinder.cs 2009-07-01 21:15:19 UTC (rev 2974) @@ -6,6 +6,7 @@ using LyricsEngine; using System.Data; using System.Diagnostics; +using System.Net; namespace LyricsEngine.LyricSites { @@ -17,7 +18,9 @@ public static bool Abort; public static string Domain = null; + public static bool WebExceptionOccured = false; + public LrcFinder() { @@ -36,9 +39,18 @@ try { - lrcFinder.Url = GetUrl(); + string url = GetUrl(); - lrc = lrcFinder.FindLRC(this.artist, this.title); + if (url == null) + { + lrc = null; + } + else + { + lrcFinder.Url = GetUrl(); + + lrc = lrcFinder.FindLRC(this.artist, this.title); + } } catch (Exception e) { @@ -71,9 +83,18 @@ try { - lrcFinder.Url = GetUrl(); + string url = GetUrl(); - lrcs = lrcFinder.FindLRCs(this.artist, this.title); + if (url == null) + { + lrcs = null; + } + else + { + lrcFinder.Url = GetUrl(); + + lrcs = lrcFinder.FindLRCs(this.artist, this.title); + } } catch { @@ -102,10 +123,20 @@ try { - lrcFinder.Url = GetUrl(); - string result = lrcFinder.SaveLRC(lrcFile); - return result.Equals("DONE"); + string url = GetUrl(); + + if (url == null) + { + return false; + } + else + { + lrcFinder.Url = GetUrl(); + + string result = lrcFinder.SaveLRC(lrcFile); + return result.Equals("DONE"); + } } catch { @@ -119,10 +150,19 @@ try { - lrcFinder.Url = GetUrl(); + string url = GetUrl(); - string result = lrcFinder.SaveLRCWithGuid(lrcFile, guid); - return result.Equals("DONE"); + if (url == null) + { + return false; + } + else + { + lrcFinder.Url = GetUrl(); + + string result = lrcFinder.SaveLRCWithGuid(lrcFile, guid); + return result.Equals("DONE"); + } } catch { @@ -134,14 +174,28 @@ { //Domain = "http://testLRCFinder.profiler.nl"; - if (string.IsNullOrEmpty(Domain)) + if (WebExceptionOccured) { - string[] domains = lrcFinder.NewDomain(); - Random r = new Random(); - Domain = domains[r.Next(domains.Length)] as string; + return null; } - return Domain + @"/LrcFinder.asmx"; + try + { + + if (string.IsNullOrEmpty(Domain)) + { + string[] domains = lrcFinder.NewDomain(); + Random r = new Random(); + Domain = domains[r.Next(domains.Length)] as string; + } + + return Domain + @"/LrcFinder.asmx"; + } + catch (WebException e) + { + WebExceptionOccured = true; + return null; + } } } Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyrDB.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyrDB.cs 2009-07-01 19:42:17 UTC (rev 2973) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyrDB.cs 2009-07-01 21:15:19 UTC (rev 2974) @@ -30,8 +30,6 @@ m_EventStop_SiteSearches = eventStop_SiteSearches; artist = LyricUtil.RemoveFeatComment(artist); - artist = LyricUtil.TrimForParenthesis(artist); - title = LyricUtil.RemoveFeatComment(title); title = LyricUtil.TrimForParenthesis(title); //string urlString = string.Format("http://www.lyrdb.com/lookup.php?q={0}|{1}&for=match", artist, title); string urlString = string.Format("http://webservices.lyrdb.com/lookup.php?q={0}%7c{1}&for=match", artist, title); Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Lyrics007.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Lyrics007.cs 2009-07-01 19:42:17 UTC (rev 2973) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Lyrics007.cs 2009-07-01 21:15:19 UTC (rev 2974) @@ -28,9 +28,7 @@ timer = new System.Timers.Timer(); artist = LyricUtil.RemoveFeatComment(artist); - artist = LyricUtil.TrimForParenthesis(artist); artist = artist.Replace("#", ""); - title = LyricUtil.RemoveFeatComment(title); title = LyricUtil.TrimForParenthesis(title); title = title.Replace("#", ""); Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyricsOnDemand.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyricsOnDemand.cs 2009-07-01 19:42:17 UTC (rev 2973) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyricsOnDemand.cs 2009-07-01 21:15:19 UTC (rev 2974) @@ -27,7 +27,6 @@ timer = new System.Timers.Timer(); artist = LyricUtil.RemoveFeatComment(artist); - artist = LyricUtil.TrimForParenthesis(artist); artist = LyricUtil.DeleteSpecificChars(artist); artist = artist.Replace(" ", ""); artist = artist.Replace("The ", ""); @@ -38,7 +37,6 @@ // Cannot find lyrics contaning non-English letters! - title = LyricUtil.RemoveFeatComment(title); title = LyricUtil.TrimForParenthesis(title); title = LyricUtil.DeleteSpecificChars(title); title = title.Replace(" ", ""); @@ -57,10 +55,13 @@ title = title.ToLower(); - string firstLetter = ""; - if (artist.Length > 0) - firstLetter = artist[0].ToString(); + if (string.IsNullOrEmpty(artist) || string.IsNullOrEmpty(title)) + { + return; + } + string firstLetter = artist[0].ToString(); + int firstNumber = 0; if (int.TryParse(firstLetter, out firstNumber)) { Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/SeekLyrics.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/SeekLyrics.cs 2009-07-01 19:42:17 UTC (rev 2973) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/SeekLyrics.cs 2009-07-01 21:15:19 UTC (rev 2974) @@ -28,7 +28,6 @@ timer = new System.Timers.Timer(); artist = LyricUtil.RemoveFeatComment(artist); - artist = LyricUtil.TrimForParenthesis(artist); artist = artist.Replace(" ", "-"); artist = artist.Replace("'", "-"); artist = artist.Replace("(", ""); @@ -48,7 +47,6 @@ // French letters artist = artist.Replace("\xE9", "%E9"); - title = LyricUtil.RemoveFeatComment(title); title = LyricUtil.TrimForParenthesis(title); title = title.Replace(" ", "-"); title = title.Replace("'", "-"); Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Wiki.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Wiki.cs 2009-07-01 19:42:17 UTC (rev 2973) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Wiki.cs 2009-07-01 21:15:19 UTC (rev 2974) @@ -101,7 +101,6 @@ private void OptimizeString(ref string artist, ref string title) { - artist = LyricUtil.TrimForParenthesis(artist); title = LyricUtil.TrimForParenthesis(title); } Modified: trunk/plugins/MyLyrics/LyricsEngine/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/Properties/AssemblyInfo.cs 2009-07-01 19:42:17 UTC (rev 2973) +++ trunk/plugins/MyLyrics/LyricsEngine/Properties/AssemblyInfo.cs 2009-07-01 21:15:19 UTC (rev 2974) @@ -26,7 +26,7 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.31")] +[assembly: AssemblyVersion("1.32")] // // In order to sign your assembly you must specify a key to use. Refer to the Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs 2009-07-01 19:42:17 UTC (rev 2973) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs 2009-07-01 21:15:19 UTC (rev 2974) @@ -80,7 +80,7 @@ this.lbInfo1.Name = "lbInfo1"; this.lbInfo1.Size = new System.Drawing.Size(197, 18); this.lbInfo1.TabIndex = 3; - this.lbInfo1.Text = "MyLyrics plugin, version 1.31"; + this.lbInfo1.Text = "MyLyrics plugin, version 1.32"; // // label2 // Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.cs 2009-07-01 19:42:17 UTC (rev 2973) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.cs 2009-07-01 21:15:19 UTC (rev 2974) @@ -23,6 +23,7 @@ using MediaPortal.Profile; using LyricsEngine; +using System.Diagnostics; namespace MyLyrics { @@ -40,6 +41,11 @@ private string logFileName = "MyLyrics_Batch.log"; private string logFullFileName = ""; + private static int logIdCounter = 0; + + string latestArtistBeforeCrash = null; + string latestTitleBeforeCrash = null; + // events used to stop worker thread ManualResetEvent m_EventStopThread; @@ -92,7 +98,7 @@ string[] m_strippedPrefixStrings; - const int m_NoOfCurrentSearchesAllowed = 8; + int m_NoOfCurrentSearchesAllowed = 6; int m_Limit = 100; // Collections and arrays @@ -396,40 +402,19 @@ ThreadFinished = new string[] { "", "", "You must select a number of songs to search", "error" }; return; } + else if (m_Limit > m_TotalTitles) + { + tbLimit.Text = m_TotalTitles.ToString(); + m_Limit = m_TotalTitles; + } + logIdCounter = 0; + if (m_enableLogging) { - - logFullFileName = Config.GetFile(Config.Dir.Log, logFileName); - - FileStream file = null; - StreamReader sr = null; - System.IO.StreamWriter writerLog = null; - - //if file is not found, create a new xml file - if (!System.IO.File.Exists(logFullFileName)) - { - file = new FileStream(logFullFileName, FileMode.OpenOrCreate, FileAccess.Write); - file.Close(); - sr = File.OpenText(logFullFileName); - log = sr.ReadToEnd(); - sr.Close(); - log += DateTime.Now.ToString() + " The log has been created.\r\n"; - writerLog = new System.IO.StreamWriter(logFullFileName); - writerLog.Write(log); - writerLog.Close(); - } - - file = new FileStream(logFullFileName, FileMode.OpenOrCreate, FileAccess.Write); - file.Close(); - sr = File.OpenText(logFullFileName); - log = sr.ReadToEnd(); - sr.Close(); - log += "\r\n"; - log += DateTime.Now.ToString() + string.Format(" ***** New batch search for {0} lyrics started *****.\r\n", m_Limit); - writerLog = new System.IO.StreamWriter(logFullFileName); - writerLog.Write(log); - writerLog.Close(); + logFullFileName = MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Log, logFileName); + LyricDiagnostics.OpenLog(logFullFileName); + LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Start, ++logIdCounter, LyricDiagnostics.ElapsedTimeString() + string.Format(" ***** New batch search for {0} lyrics started *****.", m_Limit)); } stopwatch.StartZero(); @@ -559,15 +544,10 @@ if (m_enableLogging) { - StreamReader sr = File.OpenText(logFullFileName); - log = sr.ReadToEnd(); - sr.Close(); - string logText = capArtist + " - " + capTitle + " has a match at " + site + ".\r\n"; - log += DateTime.Now.ToString() + " " + logText; + string logText = capArtist + " - " + capTitle + " has a match at " + site; lbLastActivity2.Text = logText; - System.IO.StreamWriter writerLog = new System.IO.StreamWriter(logFullFileName); - writerLog.Write(log); - writerLog.Close(); + + LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Information, ++logIdCounter, LyricDiagnostics.ElapsedTimeString() + "HIT!: " + logText); } progressBar.PerformStep(); @@ -593,19 +573,12 @@ m_SongsWithMark += 1; lbSongsWithMark2.Text = m_SongsWithMark.ToString(); - lbLastActivity2.Text = "No match for \"" + capArtist + " - " + capTitle + "\".\r\n"; - if (m_enableLogging) { - StreamReader sr = File.OpenText(logFullFileName); - log = sr.ReadToEnd(); - sr.Close(); - string logText = "No match found to " + capArtist + " - " + capTitle + ".\r\n"; - log += DateTime.Now.ToString() + " " + logText; + string logText = "No match found to " + capArtist + " - " + capTitle; lbLastActivity2.Text = logText; - System.IO.StreamWriter writerLog = new System.IO.StreamWriter(logFullFileName); - writerLog.Write(log); - writerLog.Close(); + + LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Information, ++logIdCounter, LyricDiagnostics.ElapsedTimeString() + "Miss: " + logText); } progressBar.PerformStep(); @@ -654,16 +627,13 @@ if (m_enableLogging) { - StreamReader sr = File.OpenText(logFullFileName); - log = sr.ReadToEnd(); - sr.Close(); - string logText = string.Format("The batch has ended with {0} found and {1} missed .\r\n", m_LyricsFound, m_LyricsNotFound); - log += DateTime.Now.ToString() + " " + logText; - log += DateTime.Now.ToString() + " ***** Batch search ended *****\r\n\r\n"; + string logText = string.Format("The search has ended with {0} found and {1} missed.\r\n", m_LyricsFound, m_LyricsNotFound); lbLastActivity2.Text = logText; - System.IO.StreamWriter writerLog = new System.IO.StreamWriter(logFullFileName); - writerLog.Write(log); - writerLog.Close(); + + logText += DateTime.Now.ToString() + " " + logText; + logText += DateTime.Now.ToString() + " ***** Batch search ended *****\r\n\r\n"; + + LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Stop, ++logIdCounter, LyricDiagnostics.ElapsedTimeString() + logText); } } @@ -728,6 +698,9 @@ { // Thread.CurrentThread.Name = "bgWorker - Search"; + //try + //{ + #region 1. Sorting song lyricConfigInfosQueue = new Queue(); @@ -763,14 +736,15 @@ Song song = (Song)songs[i]; /* Don't include song if one of the following is true - * 1. The artist isn't known (MP issue - should be deleted?) - * 2. Various artister should not be considered and the artist is "various artist" - * 3. Song with a lyric in the tag should not be considered, but instead include the file to the database right away */ + * 1. The artist is unknown or empty + * 2. The title is empty + * 3. Various artister should not be considered and the artist is "various artist" + * 4. Song with a lyric in the tag should not be considered, but instead include the file to the database right away */ MusicTag tag = null; - if (song.Artist.Equals("unknown") - || (m_DisregardVariousArtist && (song.Artist.ToLower().Equals("various artists") || song.Artist.ToLower().Equals("diverse kunstnere")))) + if (song.Artist.Equals("unknown") || string.IsNullOrEmpty(song.Artist) || string.IsNullOrEmpty(song.Title) + || (m_DisregardVariousArtist && (song.Artist.ToLower().Equals("various artists")))) { m_DisregardedSongs += 1; } @@ -827,6 +801,8 @@ bgWorkerSearch.ReportProgress(songNotKnown); } } + + bgWorkerSearch.ReportProgress(0); } else { @@ -920,6 +896,15 @@ string artist = lyricID[0]; string title = lyricID[1]; + latestArtistBeforeCrash = artist; + latestTitleBeforeCrash = title; + + if (m_enableLogging) + { + string logText = string.Format("New!: Looking for {0} - {1}.", artist, title); + LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Information, ++logIdCounter, LyricDiagnostics.ElapsedTimeString() + logText); + } + lc.AddNewLyricSearch(artist, title, MediaPortalUtil.GetStrippedPrefixArtist(artist, m_strippedPrefixStrings)); } @@ -931,13 +916,39 @@ ThreadFinished = new string[] { "", "", "No titles left for online search", "" }; } #endregion + + //} + //catch (Exception ex) + //{ + // StreamReader sr = File.OpenText(logFullFileName); + // log = sr.ReadToEnd(); + // sr.Close(); + // string logText = "Message:" + ex.Message + "\r\n"; + // logText += "StackTrace:" + ex.StackTrace + "\r\n"; + // logText += "Source:" + ex.Source + "\r\n"; + // logText += "latestArtistBeforeCrash:" + latestArtistBeforeCrash + "\r\n"; + // logText += "latestTitleBeforeCrash:" + latestTitleBeforeCrash + "\r\n"; + + // if (ex.InnerException != null) + // { + // logText = "InnerException.Message:" + ex.InnerException.Message + "\r\n"; + // logText += "InnerException.StackTrace:" + ex.InnerException.StackTrace + "\r\n"; + // logText += "InnerException.Source:" + ex.InnerException.Source + "\r\n"; + // } + + // log += DateTime.Now.ToString() + " " + logText; + // lbLastActivity2.Text = logText; + // System.IO.StreamWriter writerLog = new System.IO.StreamWriter(logFullFileName); + // writerLog.Write(log); + // writerLog.Close(); + //} } private void bgWorkerSearch_ProgressChanged(object sender, ProgressChangedEventArgs e) { lbSongsWithMark2.Text = m_SongsWithMark.ToString(); lbSongsWithLyric2.Text = m_SongsWithLyric.ToString(); - lbDisregardedSongs2.Text = m_DisregardedSongs.ToString(); + //lbDisregardedSongs2.Text = m_DisregardedSongs.ToString(); lbSongsToSearch2.Text = m_SongsToSearch.ToString(); if (e.ProgressPercentage == -1) @@ -948,6 +959,8 @@ { lbStep1a.Text = "Completed"; lbStep2a.Text = "The search for lyrics has started."; + int disregardedSongs = m_TotalTitles - m_SongsWithLyric - m_SongsWithMark - m_SongsToSearch; + lbDisregardedSongs2.Text = disregardedSongs.ToString(); } } Modified: trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs 2009-07-01 19:42:17 UTC (rev 2973) +++ trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs 2009-07-01 21:15:19 UTC (rev 2974) @@ -31,5 +31,5 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.31")] -[assembly: AssemblyFileVersion("1.31")] +[assembly: AssemblyVersion("1.32")] +[assembly: AssemblyFileVersion("1.32")] Modified: trunk/plugins/MyLyrics/My Lyrics/change log.txt =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/change log.txt 2009-07-01 19:42:17 UTC (rev 2973) +++ trunk/plugins/MyLyrics/My Lyrics/change log.txt 2009-07-01 21:15:19 UTC (rev 2974) @@ -1,17 +1,17 @@ -Release notes to MyLyrics 1.31 +Release notes to MyLyrics 1.32 MyLyrics enables the display of lyrics for the currently played music file inside MediaPortal. The plugin is able show LRC and plain lyrics, and uses both musictags and online searches to find lyrics. Basic features: -* Dynamic search for the lyrics (both LRC's and plain lyrics) to the currently played music file. -* Browse your music database and select the songs to which you want to find lyrics. -* Batch search for lyrics matching songs in music database. -* Search single title and select amoung lyrics from various lyrics sites. -* Add/delete/edit lyrics and save changes in lyrics databases. -* Import/export lyrics to/from music tags. -* Include lyrics from the Internet, musictags, text- and lrc-files. -* Create a LRC from a basic lyric on the fly and share it with the community. +- Dynamic search for the lyrics (both LRC's and plain lyrics) to the currently played music file. +- Browse your music database and select the songs to which you want to find lyrics. +- Batch search for lyrics matching songs in music database. +- Search single title and select amoung lyrics from various lyrics sites. +- Add/delete/edit lyrics and save changes in lyrics databases. +- Import/export lyrics to/from music tags. +- Include lyrics from the Internet, musictags, text- and lrc-files. +- Create a LRC from a basic lyric on the fly and share it with the community. Keys: - W key (or '#' button on remote): Toggle between basic and wide screen. @@ -36,10 +36,8 @@ Installation: Simple copy the content of the zip-file into your MP library (typical C:\Program Files\Team MediaPortal\MediaPortal). -Noteworthy changes since version 1.30: -* Add: Support for Last.fm streams -* Add: Support for ShoutCast streams -* Add: Logging has been reintroduced for better support (has to be enabled in configuration). -* Fix: Too high thread level introduced memory when searching for 5000+ songs in batch. -* Fix: StreamedMP skin fixed with correct colours for control id's 2xx and 3xx. -* and a lot of minor fixes! \ No newline at end of file +Noteworthy changes since version 1.31: +- Add: Improved logging system. +- Fix: The plugin could crash and pull down MP Configuration when the artist string in the tag starting with a special char. +- Fix: When the LRCFinder server was down not all calls to the server were terminated correcly. +- Fix: When logging was enabled multiple threads could try to access batch file simultaneously. \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2009-07-26 11:48:22
|
Revision: 3031 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3031&view=rev Author: saamand Date: 2009-07-26 11:48:12 +0000 (Sun, 26 Jul 2009) Log Message: ----------- Version 1.33 Modified Paths: -------------- trunk/plugins/MyLyrics/LyricsEngine/LyricSearch.cs trunk/plugins/MyLyrics/LyricsEngine/LyricsEngine.csproj trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyricsOnDemand.cs trunk/plugins/MyLyrics/LyricsEngine/Properties/AssemblyInfo.cs 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 Configuration/MyLyricsSetup.resx trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs trunk/plugins/MyLyrics/My Lyrics/change log.txt Added Paths: ----------- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyricsPluginSite.cs Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricSearch.cs =================================================================== (Binary files differ) Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsEngine.csproj =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsEngine.csproj 2009-07-26 10:50:11 UTC (rev 3030) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsEngine.csproj 2009-07-26 11:48:12 UTC (rev 3031) @@ -59,7 +59,7 @@ <Compile Include="LyricsSites\HotLyrics.cs" /> <Compile Include="LyricsSites\Lyrics007.cs" /> <Compile Include="LyricsSites\LyricsOnDemand.cs" /> - <Compile Include="LyricsSites\SeekLyrics.cs" /> + <Compile Include="LyricsSites\LyricsPluginSite.cs" /> <Compile Include="LyricsWebClient.cs"> <SubType>Component</SubType> </Compile> Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyricsOnDemand.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyricsOnDemand.cs 2009-07-26 10:50:11 UTC (rev 3030) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyricsOnDemand.cs 2009-07-26 11:48:12 UTC (rev 3031) @@ -129,7 +129,7 @@ lyricTemp = new StringBuilder(); line = sr.ReadLine().Trim(); - while (line.IndexOf("<BR><BR>") == -1) + while (line.Contains("<p>") == false) { lyricTemp.Append(line); if (sr.EndOfStream || ++noOfLinesCount > 300) Added: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyricsPluginSite.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyricsPluginSite.cs (rev 0) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyricsPluginSite.cs 2009-07-26 11:48:12 UTC (rev 3031) @@ -0,0 +1,243 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using System.Diagnostics; +using System.Net; +using System.Threading; +using System.Timers; +using System.Text.RegularExpressions; + +namespace LyricsEngine.LyricSites +{ + class LyricsPluginSite + { + string lyric = ""; + bool complete; + System.Timers.Timer timer; + int timeLimit; + + public string Lyric + { + get { return lyric; } + } + + public LyricsPluginSite(string artist, string title, ManualResetEvent m_EventStop_SiteSearches, int timeLimit) + { + this.timeLimit = timeLimit; + timer = new System.Timers.Timer(); + + artist = LyricUtil.RemoveFeatComment(artist); + title = LyricUtil.TrimForParenthesis(title); + + // Escape characters + artist = fixEscapeCharacters(artist); + title = fixEscapeCharacters(title); + + // Hebrew letters + artist = fixHebrew(artist); + title = fixHebrew(title); + + string urlString = "http://www.lyricsplugin.com/winamp03/plugin/?" + "artist=" + artist + "&title=" + title; + + timer.Enabled = true; + timer.Interval = timeLimit; + timer.Elapsed += new ElapsedEventHandler(timer_Elapsed); + timer.Start(); + + Uri uri = new Uri(urlString); + LyricsWebClient client = new LyricsWebClient(); + client.OpenReadCompleted += new System.Net.OpenReadCompletedEventHandler(callbackMethod); + client.OpenReadAsync(uri); + + while (complete == false) + { + if (m_EventStop_SiteSearches.WaitOne(1, true)) + { + complete = true; + } + else + { + System.Threading.Thread.Sleep(100); + } + } + } + + private static string fixEscapeCharacters(string text) + { + text = text.Replace("(", ""); + text = text.Replace(")", ""); + text = text.Replace("#", ""); + text = text.Replace("/", ""); + + text = text.Replace("%", "%25"); + + text = text.Replace(" ", "%20"); + text = text.Replace("$", "%24"); + text = text.Replace("&", "%26"); + text = text.Replace("+", "%2B"); + text = text.Replace(",", "%2C"); + text = text.Replace(":", "%3A"); + text = text.Replace(";", "%3B"); + text = text.Replace("=", "%3D"); + text = text.Replace("?", "%3F"); + text = text.Replace("@", "%40"); + + return text; + } + + private static string fixHebrew(string text) + { + text = text.Replace("?", "%d7%90"); + text = text.Replace("?", "%D7%91"); + text = text.Replace("?", "%D7%92"); + text = text.Replace("?", "%D7%93"); + text = text.Replace("?", "%D7%94"); + text = text.Replace("?", "%D7%95"); + text = text.Replace("?", "%D7%96"); + text = text.Replace("?", "%D7%97"); + text = text.Replace("?", "%D7%98"); + text = text.Replace("?", "%D7%99"); + text = text.Replace("?", "%D7%9A"); + text = text.Replace("?", "%D7%9B"); + text = text.Replace("?", "%D7%9C"); + text = text.Replace("?", "%D7%9D"); + text = text.Replace("?", "%D7%9E"); + text = text.Replace("?", "%D7%9F"); + text = text.Replace("?", "%D7%A0"); + text = text.Replace("?", "%D7%A1"); + text = text.Replace("?", "%D7%A2"); + text = text.Replace("?", "%D7%A3"); + text = text.Replace("?", "%D7%A4"); + text = text.Replace("?", "%D7%A5"); + text = text.Replace("?", "%D7%A6"); + text = text.Replace("?", "%D7%A7"); + text = text.Replace("?", "%D7%A8"); + text = text.Replace("?", "%D7%A9"); + text = text.Replace("?", "%D7%AA"); + + text = text.Replace("\xE0", "%d7%90"); + text = text.Replace("\xE1", "%D7%91"); + text = text.Replace("\xE2", "%D7%92"); + text = text.Replace("\xE3", "%D7%93"); + text = text.Replace("\xE4", "%D7%94"); + text = text.Replace("\xE5", "%D7%95"); + text = text.Replace("\xE6", "%D7%96"); + text = text.Replace("\xE7", "%D7%97"); + text = text.Replace("\xE8", "%D7%98"); + text = text.Replace("\xE9", "%D7%99"); + text = text.Replace("\xEA", "%D7%9A"); + text = text.Replace("\xEB", "%D7%9B"); + text = text.Replace("\xEC", "%D7%9C"); + text = text.Replace("\xED", "%D7%9D"); + text = text.Replace("\xEE", "%D7%9E"); + text = text.Replace("\xEF", "%D7%9F"); + text = text.Replace("\xF0", "%D7%A0"); + text = text.Replace("\xF1", "%D7%A1"); + text = text.Replace("\xF2", "%D7%A2"); + text = text.Replace("\xF3", "%D7%A3"); + text = text.Replace("\xF4", "%D7%A4"); + text = text.Replace("\xF5", "%D7%A5"); + text = text.Replace("\xF6", "%D7%A6"); + text = text.Replace("\xF7", "%D7%A7"); + text = text.Replace("\xF8", "%D7%A8"); + text = text.Replace("\xF9", "%D7%A9"); + text = text.Replace("\xFA", "%D7%AA"); + + return text; + } + + private void callbackMethod(object sender, OpenReadCompletedEventArgs e) + { + bool thisMayBeTheCorrectLyric = true; + StringBuilder lyricTemp = new StringBuilder(); + + LyricsWebClient client = (LyricsWebClient)sender; + Stream reply = null; + StreamReader sr = null; + + try + { + reply = (Stream)e.Result; + sr = new StreamReader(reply, Encoding.UTF8); + + string line = ""; + int noOfLinesCount = 0; + + while (line.IndexOf(@"<div id=""lyrics"">") == -1) + { + if (sr.EndOfStream || ++noOfLinesCount > 300) + { + thisMayBeTheCorrectLyric = false; + break; + } + else + { + line = sr.ReadLine(); + } + } + + + if (thisMayBeTheCorrectLyric) + { + lyricTemp = new StringBuilder(); + line = sr.ReadLine(); + + while (line.IndexOf("</div>") == -1) + { + lyricTemp.Append(line); + + if (sr.EndOfStream) + { + thisMayBeTheCorrectLyric = false; + break; + } + else + { + line = sr.ReadLine(); + } + } + + lyricTemp.Replace("<br>", Environment.NewLine); + lyricTemp.Replace("<br />", Environment.NewLine); + lyricTemp.Replace(""", "\""); + + lyric = lyricTemp.ToString().Trim(); + + if (lyric.Length == 0) + { + lyric = "Not found"; + } + } + } + catch + { + lyric = "Not found"; + } + finally + { + if (sr != null) + { + sr.Close(); + } + + if (reply != null) + { + reply.Close(); + } + complete = true; + } + } + + 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/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/Properties/AssemblyInfo.cs 2009-07-26 10:50:11 UTC (rev 3030) +++ trunk/plugins/MyLyrics/LyricsEngine/Properties/AssemblyInfo.cs 2009-07-26 11:48:12 UTC (rev 3031) @@ -26,7 +26,7 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.32")] +[assembly: AssemblyVersion("1.33")] // // In order to sign your assembly you must specify a key to use. Refer to the Modified: trunk/plugins/MyLyrics/LyricsEngine/Setup.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/Setup.cs 2009-07-26 10:50:11 UTC (rev 3030) +++ trunk/plugins/MyLyrics/LyricsEngine/Setup.cs 2009-07-26 11:48:12 UTC (rev 3031) @@ -15,7 +15,7 @@ "HotLyrics", "Actionext", "LyrDB", - "SeekLyrics" + "LyricsPluginSite" }; Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs 2009-07-26 10:50:11 UTC (rev 3030) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs 2009-07-26 11:48:12 UTC (rev 3031) @@ -80,7 +80,7 @@ this.lbInfo1.Name = "lbInfo1"; this.lbInfo1.Size = new System.Drawing.Size(197, 18); this.lbInfo1.TabIndex = 3; - this.lbInfo1.Text = "MyLyrics plugin, version 1.32"; + this.lbInfo1.Text = "MyLyrics plugin, version 1.33"; // // label2 // Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/FindLyric.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/FindLyric.Designer.cs 2009-07-26 10:50:11 UTC (rev 3030) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/FindLyric.Designer.cs 2009-07-26 11:48:12 UTC (rev 3031) @@ -32,6 +32,7 @@ this.tbTitle = new System.Windows.Forms.TextBox(); this.lbTitle = new System.Windows.Forms.Label(); this.tbArtist = new System.Windows.Forms.TextBox(); + this.btCancel = new System.Windows.Forms.Button(); this.lbArtist = new System.Windows.Forms.Label(); this.btFind = new System.Windows.Forms.Button(); this.groupBox1 = new System.Windows.Forms.GroupBox(); @@ -42,17 +43,16 @@ this.groupBox2 = new System.Windows.Forms.GroupBox(); this.tbLyrics = new System.Windows.Forms.TextBox(); this.gbLyricSites = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.cbLrcFinder = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.cbLyrDB = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.cbActionext = new MediaPortal.UserInterface.Controls.MPCheckBox(); - this.btCancel = new System.Windows.Forms.Button(); this.cbHotLyrics = new MediaPortal.UserInterface.Controls.MPCheckBox(); - this.cbSeekLyrics = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.cbLyricsOnDemand = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.cbLyrics007 = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.cbLyricWiki = new MediaPortal.UserInterface.Controls.MPCheckBox(); + this.cbLyricsPluginSite = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.btClose = new System.Windows.Forms.Button(); this.btUpdate = new System.Windows.Forms.Button(); - this.cbLrcFinder = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.gbSearchInfo.SuspendLayout(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); @@ -64,17 +64,19 @@ this.gbSearchInfo.Controls.Add(this.tbTitle); this.gbSearchInfo.Controls.Add(this.lbTitle); this.gbSearchInfo.Controls.Add(this.tbArtist); + this.gbSearchInfo.Controls.Add(this.btCancel); this.gbSearchInfo.Controls.Add(this.lbArtist); - this.gbSearchInfo.Location = new System.Drawing.Point(12, 12); + this.gbSearchInfo.Controls.Add(this.btFind); + this.gbSearchInfo.Location = new System.Drawing.Point(9, 12); this.gbSearchInfo.Name = "gbSearchInfo"; - this.gbSearchInfo.Size = new System.Drawing.Size(432, 85); + this.gbSearchInfo.Size = new System.Drawing.Size(432, 97); this.gbSearchInfo.TabIndex = 0; this.gbSearchInfo.TabStop = false; - this.gbSearchInfo.Text = "Search information"; + this.gbSearchInfo.Text = "Song information"; // // tbTitle // - this.tbTitle.Location = new System.Drawing.Point(73, 53); + this.tbTitle.Location = new System.Drawing.Point(73, 42); this.tbTitle.Name = "tbTitle"; this.tbTitle.Size = new System.Drawing.Size(344, 20); this.tbTitle.TabIndex = 2; @@ -82,7 +84,7 @@ // lbTitle // this.lbTitle.AutoSize = true; - this.lbTitle.Location = new System.Drawing.Point(15, 56); + this.lbTitle.Location = new System.Drawing.Point(15, 45); this.lbTitle.Name = "lbTitle"; this.lbTitle.Size = new System.Drawing.Size(30, 13); this.lbTitle.TabIndex = 2; @@ -90,15 +92,25 @@ // // tbArtist // - this.tbArtist.Location = new System.Drawing.Point(73, 26); + this.tbArtist.Location = new System.Drawing.Point(73, 19); this.tbArtist.Name = "tbArtist"; this.tbArtist.Size = new System.Drawing.Size(344, 20); this.tbArtist.TabIndex = 1; // + // btCancel + // + this.btCancel.Location = new System.Drawing.Point(354, 68); + this.btCancel.Name = "btCancel"; + this.btCancel.Size = new System.Drawing.Size(65, 23); + this.btCancel.TabIndex = 4; + this.btCancel.Text = "&Cancel"; + this.btCancel.UseVisualStyleBackColor = true; + this.btCancel.Click += new System.EventHandler(this.btCancel_Click); + // // lbArtist // this.lbArtist.AutoSize = true; - this.lbArtist.Location = new System.Drawing.Point(15, 29); + this.lbArtist.Location = new System.Drawing.Point(15, 22); this.lbArtist.Name = "lbArtist"; this.lbArtist.Size = new System.Drawing.Size(33, 13); this.lbArtist.TabIndex = 0; @@ -106,7 +118,7 @@ // // btFind // - this.btFind.Location = new System.Drawing.Point(283, 67); + this.btFind.Location = new System.Drawing.Point(283, 68); this.btFind.Name = "btFind"; this.btFind.Size = new System.Drawing.Size(65, 23); this.btFind.TabIndex = 3; @@ -117,9 +129,9 @@ // groupBox1 // this.groupBox1.Controls.Add(this.lvSearchResults); - this.groupBox1.Location = new System.Drawing.Point(13, 207); + this.groupBox1.Location = new System.Drawing.Point(9, 196); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(431, 147); + this.groupBox1.Size = new System.Drawing.Size(432, 182); this.groupBox1.TabIndex = 1; this.groupBox1.TabStop = false; this.groupBox1.Text = "Search results"; @@ -134,7 +146,7 @@ this.lvSearchResults.Location = new System.Drawing.Point(17, 21); this.lvSearchResults.MultiSelect = false; this.lvSearchResults.Name = "lvSearchResults"; - this.lvSearchResults.Size = new System.Drawing.Size(399, 111); + this.lvSearchResults.Size = new System.Drawing.Size(399, 146); this.lvSearchResults.TabIndex = 10; this.lvSearchResults.UseCompatibleStateImageBehavior = false; this.lvSearchResults.View = System.Windows.Forms.View.Details; @@ -159,9 +171,9 @@ // groupBox2 // this.groupBox2.Controls.Add(this.tbLyrics); - this.groupBox2.Location = new System.Drawing.Point(13, 360); + this.groupBox2.Location = new System.Drawing.Point(9, 384); this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(431, 183); + this.groupBox2.Size = new System.Drawing.Size(432, 156); this.groupBox2.TabIndex = 2; this.groupBox2.TabStop = false; this.groupBox2.Text = "Lyric"; @@ -172,7 +184,7 @@ this.tbLyrics.Multiline = true; this.tbLyrics.Name = "tbLyrics"; this.tbLyrics.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; - this.tbLyrics.Size = new System.Drawing.Size(399, 153); + this.tbLyrics.Size = new System.Drawing.Size(399, 131); this.tbLyrics.TabIndex = 0; // // gbLyricSites @@ -180,28 +192,39 @@ this.gbLyricSites.Controls.Add(this.cbLrcFinder); this.gbLyricSites.Controls.Add(this.cbLyrDB); this.gbLyricSites.Controls.Add(this.cbActionext); - this.gbLyricSites.Controls.Add(this.btCancel); - this.gbLyricSites.Controls.Add(this.btFind); this.gbLyricSites.Controls.Add(this.cbHotLyrics); - this.gbLyricSites.Controls.Add(this.cbSeekLyrics); this.gbLyricSites.Controls.Add(this.cbLyricsOnDemand); this.gbLyricSites.Controls.Add(this.cbLyrics007); this.gbLyricSites.Controls.Add(this.cbLyricWiki); + this.gbLyricSites.Controls.Add(this.cbLyricsPluginSite); this.gbLyricSites.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.gbLyricSites.Location = new System.Drawing.Point(12, 103); + this.gbLyricSites.Location = new System.Drawing.Point(9, 115); this.gbLyricSites.Name = "gbLyricSites"; - this.gbLyricSites.Size = new System.Drawing.Size(432, 98); + this.gbLyricSites.Size = new System.Drawing.Size(432, 75); this.gbLyricSites.TabIndex = 29; this.gbLyricSites.TabStop = false; this.gbLyricSites.Text = "Lyric sites to search"; // + // cbLrcFinder + // + this.cbLrcFinder.AutoSize = true; + this.cbLrcFinder.Checked = true; + this.cbLrcFinder.CheckState = System.Windows.Forms.CheckState.Checked; + this.cbLrcFinder.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.cbLrcFinder.Location = new System.Drawing.Point(338, 21); + this.cbLrcFinder.Name = "cbLrcFinder"; + this.cbLrcFinder.Size = new System.Drawing.Size(68, 17); + this.cbLrcFinder.TabIndex = 19; + this.cbLrcFinder.Text = "LrcFinder"; + this.cbLrcFinder.UseVisualStyleBackColor = true; + // // 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(237, 21); + this.cbLyrDB.Location = new System.Drawing.Point(338, 44); this.cbLyrDB.Name = "cbLyrDB"; this.cbLyrDB.Size = new System.Drawing.Size(53, 17); this.cbLyrDB.TabIndex = 18; @@ -214,56 +237,33 @@ 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(110, 21); + this.cbActionext.Location = new System.Drawing.Point(131, 44); this.cbActionext.Name = "cbActionext"; this.cbActionext.Size = new System.Drawing.Size(68, 17); this.cbActionext.TabIndex = 17; this.cbActionext.Text = "Actionext"; this.cbActionext.UseVisualStyleBackColor = true; // - // btCancel - // - this.btCancel.Location = new System.Drawing.Point(352, 67); - this.btCancel.Name = "btCancel"; - this.btCancel.Size = new System.Drawing.Size(65, 23); - this.btCancel.TabIndex = 4; - this.btCancel.Text = "&Cancel"; - this.btCancel.UseVisualStyleBackColor = true; - this.btCancel.Click += new System.EventHandler(this.btCancel_Click); - // // cbHotLyrics // this.cbHotLyrics.AutoSize = true; 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(338, 44); + this.cbHotLyrics.Location = new System.Drawing.Point(237, 44); this.cbHotLyrics.Name = "cbHotLyrics"; this.cbHotLyrics.Size = new System.Drawing.Size(71, 17); this.cbHotLyrics.TabIndex = 14; this.cbHotLyrics.Text = "Hot Lyrics"; this.cbHotLyrics.UseVisualStyleBackColor = true; // - // cbSeekLyrics - // - this.cbSeekLyrics.AutoSize = true; - 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(338, 21); - this.cbSeekLyrics.Name = "cbSeekLyrics"; - this.cbSeekLyrics.Size = new System.Drawing.Size(79, 17); - this.cbSeekLyrics.TabIndex = 15; - this.cbSeekLyrics.Text = "Seek Lyrics"; - this.cbSeekLyrics.UseVisualStyleBackColor = true; - // // cbLyricsOnDemand // this.cbLyricsOnDemand.AutoSize = true; 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(110, 44); + this.cbLyricsOnDemand.Location = new System.Drawing.Point(17, 21); this.cbLyricsOnDemand.Name = "cbLyricsOnDemand"; this.cbLyricsOnDemand.Size = new System.Drawing.Size(108, 17); this.cbLyricsOnDemand.TabIndex = 12; @@ -276,7 +276,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(237, 44); + this.cbLyrics007.Location = new System.Drawing.Point(237, 21); this.cbLyrics007.Name = "cbLyrics007"; this.cbLyrics007.Size = new System.Drawing.Size(72, 17); this.cbLyrics007.TabIndex = 13; @@ -296,9 +296,22 @@ this.cbLyricWiki.Text = "LyricWiki"; this.cbLyricWiki.UseVisualStyleBackColor = true; // + // cbLyricsPluginSite + // + this.cbLyricsPluginSite.AutoSize = true; + this.cbLyricsPluginSite.Checked = true; + this.cbLyricsPluginSite.CheckState = System.Windows.Forms.CheckState.Checked; + this.cbLyricsPluginSite.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.cbLyricsPluginSite.Location = new System.Drawing.Point(131, 21); + this.cbLyricsPluginSite.Name = "cbLyricsPluginSite"; + this.cbLyricsPluginSite.Size = new System.Drawing.Size(80, 17); + this.cbLyricsPluginSite.TabIndex = 15; + this.cbLyricsPluginSite.Text = "LyricsPlugin"; + this.cbLyricsPluginSite.UseVisualStyleBackColor = true; + // // btClose // - this.btClose.Location = new System.Drawing.Point(364, 549); + this.btClose.Location = new System.Drawing.Point(361, 546); this.btClose.Name = "btClose"; this.btClose.Size = new System.Drawing.Size(65, 23); this.btClose.TabIndex = 30; @@ -309,7 +322,7 @@ // btUpdate // this.btUpdate.Enabled = false; - this.btUpdate.Location = new System.Drawing.Point(295, 549); + this.btUpdate.Location = new System.Drawing.Point(292, 546); this.btUpdate.Name = "btUpdate"; this.btUpdate.Size = new System.Drawing.Size(65, 23); this.btUpdate.TabIndex = 11; @@ -317,19 +330,6 @@ this.btUpdate.UseVisualStyleBackColor = true; this.btUpdate.Click += new System.EventHandler(this.btUpdate_Click); // - // cbLrcFinder - // - this.cbLrcFinder.AutoSize = true; - this.cbLrcFinder.Checked = true; - this.cbLrcFinder.CheckState = System.Windows.Forms.CheckState.Checked; - this.cbLrcFinder.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.cbLrcFinder.Location = new System.Drawing.Point(18, 21); - this.cbLrcFinder.Name = "cbLrcFinder"; - this.cbLrcFinder.Size = new System.Drawing.Size(68, 17); - this.cbLrcFinder.TabIndex = 19; - this.cbLrcFinder.Text = "LrcFinder"; - this.cbLrcFinder.UseVisualStyleBackColor = true; - // // FindLyric // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -373,10 +373,10 @@ private System.Windows.Forms.TextBox tbLyrics; private MediaPortal.UserInterface.Controls.MPGroupBox gbLyricSites; internal MediaPortal.UserInterface.Controls.MPCheckBox cbHotLyrics; - internal MediaPortal.UserInterface.Controls.MPCheckBox cbSeekLyrics; internal MediaPortal.UserInterface.Controls.MPCheckBox cbLyricsOnDemand; internal MediaPortal.UserInterface.Controls.MPCheckBox cbLyrics007; internal MediaPortal.UserInterface.Controls.MPCheckBox cbLyricWiki; + internal MediaPortal.UserInterface.Controls.MPCheckBox cbLyricsPluginSite; private System.Windows.Forms.ListView lvSearchResults; private System.Windows.Forms.ColumnHeader cbSite; private System.Windows.Forms.ColumnHeader cbResult; Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/FindLyric.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/FindLyric.cs 2009-07-26 10:50:11 UTC (rev 3030) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/FindLyric.cs 2009-07-26 11:48:12 UTC (rev 3031) @@ -88,7 +88,7 @@ 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; + cbLyricsPluginSite.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useLyricsPluginSite", "True")).ToString().Equals("True") ? true : false; cbHotLyrics.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useHotLyrics", "True")).ToString().Equals("True") ? true : false; m_automaticFetch = xmlreader.GetValueAsBool("myLyrics", "automaticFetch", true); m_automaticUpdate = xmlreader.GetValueAsBool("myLyrics", "automaticUpdateWhenFirstFound", false); @@ -181,9 +181,9 @@ { sitesToSearch.Add("LyricsOnDemand"); } - if (cbSeekLyrics.Checked) + if (cbLyricsPluginSite.Checked) { - sitesToSearch.Add("SeekLyrics"); + sitesToSearch.Add("LyricsPluginSite"); } // If automaticUpdate is set then return after the first positive search Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.cs 2009-07-26 10:50:11 UTC (rev 3030) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.cs 2009-07-26 11:48:12 UTC (rev 3031) @@ -318,10 +318,10 @@ sitesToSearch.Add("Lyrics007"); if (((string)xmlreader.GetValueAsString("myLyrics", "useLyricsOnDemand", "True")).ToString().Equals("True")) sitesToSearch.Add("LyricsOnDemand"); - if (((string)xmlreader.GetValueAsString("myLyrics", "useSeekLyrics", "True")).ToString().Equals("True")) - sitesToSearch.Add("SeekLyrics"); if (((string)xmlreader.GetValueAsString("myLyrics", "useHotLyrics", "True")).ToString().Equals("True")) sitesToSearch.Add("HotLyrics"); + if (((string)xmlreader.GetValueAsString("myLyrics", "useLyricsPluginSite", "True")).ToString().Equals("True")) + sitesToSearch.Add("LyricsPluginSite"); m_find = xmlreader.GetValueAsString("myLyrics", "find", ""); m_replace = xmlreader.GetValueAsString("myLyrics", "replace", ""); @@ -788,6 +788,8 @@ // If all found in music tags, then no need for online search if (m_noOfSearchesCompleted == m_noOfSearchesToComplete) { + m_Searching = false; + ChangeButtonsEnableState(); return; } Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs 2009-07-26 10:50:11 UTC (rev 3030) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs 2009-07-26 11:48:12 UTC (rev 3031) @@ -106,7 +106,7 @@ this.cbLyricWiki = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.cbLyricsOnDemand = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.cbHotLyrics = new MediaPortal.UserInterface.Controls.MPCheckBox(); - this.cbSeekLyrics = new MediaPortal.UserInterface.Controls.MPCheckBox(); + this.cbLyricsPluginSite = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.mpLabel2 = new MediaPortal.UserInterface.Controls.MPLabel(); this.trackBar = new System.Windows.Forms.TrackBar(); @@ -156,7 +156,7 @@ this.tabControl.Location = new System.Drawing.Point(0, 0); this.tabControl.Name = "tabControl"; this.tabControl.SelectedIndex = 0; - this.tabControl.Size = new System.Drawing.Size(558, 530); + this.tabControl.Size = new System.Drawing.Size(558, 538); this.tabControl.TabIndex = 1; this.tabControl.SelectedIndexChanged += new System.EventHandler(this.tabControl_SelectedIndexChanged); // @@ -165,7 +165,7 @@ this.tabPageLyricsDatabase.Location = new System.Drawing.Point(4, 22); this.tabPageLyricsDatabase.Name = "tabPageLyricsDatabase"; this.tabPageLyricsDatabase.Padding = new System.Windows.Forms.Padding(3); - this.tabPageLyricsDatabase.Size = new System.Drawing.Size(550, 504); + this.tabPageLyricsDatabase.Size = new System.Drawing.Size(550, 512); this.tabPageLyricsDatabase.TabIndex = 1; this.tabPageLyricsDatabase.Text = "Lyrics database"; this.tabPageLyricsDatabase.UseVisualStyleBackColor = true; @@ -622,7 +622,7 @@ this.tabPageSetup.Location = new System.Drawing.Point(4, 22); this.tabPageSetup.Name = "tabPageSetup"; this.tabPageSetup.Padding = new System.Windows.Forms.Padding(3); - this.tabPageSetup.Size = new System.Drawing.Size(550, 504); + this.tabPageSetup.Size = new System.Drawing.Size(550, 512); this.tabPageSetup.TabIndex = 2; this.tabPageSetup.Text = "Settings"; this.tabPageSetup.UseVisualStyleBackColor = true; @@ -867,7 +867,7 @@ // this.cbEnableLogging.AutoSize = true; this.cbEnableLogging.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.cbEnableLogging.Location = new System.Drawing.Point(360, 20); + this.cbEnableLogging.Location = new System.Drawing.Point(359, 20); this.cbEnableLogging.Name = "cbEnableLogging"; this.cbEnableLogging.Size = new System.Drawing.Size(94, 17); this.cbEnableLogging.TabIndex = 11; @@ -929,10 +929,10 @@ this.groupBox2.Controls.Add(this.cbLyrDB); this.groupBox2.Controls.Add(this.cbActionext); this.groupBox2.Controls.Add(this.cbLyrics007); + this.groupBox2.Controls.Add(this.cbLyricsOnDemand); this.groupBox2.Controls.Add(this.cbLyricWiki); - this.groupBox2.Controls.Add(this.cbLyricsOnDemand); this.groupBox2.Controls.Add(this.cbHotLyrics); - this.groupBox2.Controls.Add(this.cbSeekLyrics); + this.groupBox2.Controls.Add(this.cbLyricsPluginSite); this.groupBox2.Location = new System.Drawing.Point(229, 48); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(301, 90); @@ -946,7 +946,7 @@ this.cbLrcFinder.Checked = true; this.cbLrcFinder.CheckState = System.Windows.Forms.CheckState.Checked; this.cbLrcFinder.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.cbLrcFinder.Location = new System.Drawing.Point(20, 61); + this.cbLrcFinder.Location = new System.Drawing.Point(130, 19); this.cbLrcFinder.Name = "cbLrcFinder"; this.cbLrcFinder.Size = new System.Drawing.Size(68, 17); this.cbLrcFinder.TabIndex = 10; @@ -959,7 +959,7 @@ 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(216, 17); + this.cbLyrDB.Location = new System.Drawing.Point(216, 40); this.cbLyrDB.Name = "cbLyrDB"; this.cbLyrDB.Size = new System.Drawing.Size(53, 17); this.cbLyrDB.TabIndex = 9; @@ -973,7 +973,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, 61); + this.cbActionext.Location = new System.Drawing.Point(216, 19); this.cbActionext.Name = "cbActionext"; this.cbActionext.Size = new System.Drawing.Size(68, 17); this.cbActionext.TabIndex = 8; @@ -987,7 +987,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(20, 40); + this.cbLyrics007.Location = new System.Drawing.Point(20, 61); this.cbLyrics007.Name = "cbLyrics007"; this.cbLyrics007.Size = new System.Drawing.Size(72, 17); this.cbLyrics007.TabIndex = 4; @@ -1001,7 +1001,7 @@ this.cbLyricWiki.Checked = true; this.cbLyricWiki.CheckState = System.Windows.Forms.CheckState.Checked; this.cbLyricWiki.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.cbLyricWiki.Location = new System.Drawing.Point(131, 17); + this.cbLyricWiki.Location = new System.Drawing.Point(130, 40); this.cbLyricWiki.Name = "cbLyricWiki"; this.cbLyricWiki.Size = new System.Drawing.Size(67, 17); this.cbLyricWiki.TabIndex = 2; @@ -1029,7 +1029,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, 39); + this.cbHotLyrics.Location = new System.Drawing.Point(130, 61); this.cbHotLyrics.Name = "cbHotLyrics"; this.cbHotLyrics.Size = new System.Drawing.Size(71, 17); this.cbHotLyrics.TabIndex = 7; @@ -1037,19 +1037,19 @@ this.cbHotLyrics.UseVisualStyleBackColor = true; this.cbHotLyrics.Leave += new System.EventHandler(this.WriteMediaPortalXML); // - // cbSeekLyrics + // cbLyricsPluginSite // - this.cbSeekLyrics.AutoSize = true; - 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(216, 40); - this.cbSeekLyrics.Name = "cbSeekLyrics"; - this.cbSeekLyrics.Size = new System.Drawing.Size(79, 17); - this.cbSeekLyrics.TabIndex = 6; - this.cbSeekLyrics.Text = "Seek Lyrics"; - this.cbSeekLyrics.UseVisualStyleBackColor = true; - this.cbSeekLyrics.Leave += new System.EventHandler(this.WriteMediaPortalXML); + this.cbLyricsPluginSite.AutoSize = true; + this.cbLyricsPluginSite.Checked = true; + this.cbLyricsPluginSite.CheckState = System.Windows.Forms.CheckState.Checked; + this.cbLyricsPluginSite.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.cbLyricsPluginSite.Location = new System.Drawing.Point(20, 40); + this.cbLyricsPluginSite.Name = "cbLyricsPluginSite"; + this.cbLyricsPluginSite.Size = new System.Drawing.Size(80, 17); + this.cbLyricsPluginSite.TabIndex = 9; + this.cbLyricsPluginSite.Text = "LyricsPlugin"; + this.cbLyricsPluginSite.UseVisualStyleBackColor = true; + this.cbLyricsPluginSite.Leave += new System.EventHandler(this.WriteMediaPortalXML); // // groupBox1 // @@ -1189,7 +1189,7 @@ // // btClose // - this.btClose.Location = new System.Drawing.Point(468, 502); + this.btClose.Location = new System.Drawing.Point(468, 507); this.btClose.Name = "btClose"; this.btClose.Size = new System.Drawing.Size(78, 23); this.btClose.TabIndex = 99; @@ -1209,15 +1209,15 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(558, 530); + this.ClientSize = new System.Drawing.Size(558, 538); this.ControlBox = false; this.Controls.Add(this.btClose); this.Controls.Add(this.tabControl); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D; this.MaximizeBox = false; - this.MaximumSize = new System.Drawing.Size(568, 560); + this.MaximumSize = new System.Drawing.Size(568, 568); this.MinimizeBox = false; - this.MinimumSize = new System.Drawing.Size(568, 560); + this.MinimumSize = new System.Drawing.Size(568, 568); this.Name = "MyLyricsSetup"; this.ShowIcon = false; this.Text = "MyLyrics Configuration"; @@ -1299,7 +1299,7 @@ private MediaPortal.UserInterface.Controls.MPLabel lbPluginName; private MediaPortal.UserInterface.Controls.MPGroupBox gbLyricSites; internal MediaPortal.UserInterface.Controls.MPCheckBox cbHotLyrics; - internal MediaPortal.UserInterface.Controls.MPCheckBox cbSeekLyrics; + internal MediaPortal.UserInterface.Controls.MPCheckBox cbLyricsPluginSite; internal MediaPortal.UserInterface.Controls.MPCheckBox cbLyricsOnDemand; internal MediaPortal.UserInterface.Controls.MPCheckBox cbLyrics007; internal MediaPortal.UserInterface.Controls.MPCheckBox cbLyricWiki; Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.cs 2009-07-26 10:50:11 UTC (rev 3030) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.cs 2009-07-26 11:48:12 UTC (rev 3031) @@ -223,8 +223,8 @@ cbLyrDB.Checked = xmlreader.GetValue("myLyrics", "useLyrDB").Equals("True"); cbLyrics007.Checked = xmlreader.GetValue("myLyrics", "useLyrics007").Equals("True"); cbLyricsOnDemand.Checked = xmlreader.GetValue("myLyrics", "useLyricsOnDemand").Equals("True"); - cbSeekLyrics.Checked = xmlreader.GetValue("myLyrics", "useSeekLyrics").Equals("True"); cbHotLyrics.Checked = xmlreader.GetValue("myLyrics", "useHotLyrics").Equals("True"); + cbLyricsPluginSite.Checked = xmlreader.GetValue("myLyrics", "useLyricsPluginSite").Equals("True"); } else { @@ -490,10 +490,10 @@ sitesToSearch.Add("Lyrics007"); if (cbLyricsOnDemand.Checked) sitesToSearch.Add("LyricsOnDemand"); - if (cbSeekLyrics.Checked) - sitesToSearch.Add("SeekLyrics"); if (cbHotLyrics.Checked) sitesToSearch.Add("HotLyrics"); + if (cbLyricsPluginSite.Checked) + sitesToSearch.Add("LyricsPluginSite"); if (sitesToSearch.Count == 0) { @@ -1101,11 +1101,11 @@ if (trackBar.Value == 0) { cbLyricsOnDemand.Checked = true; + cbLyricsPluginSite.Checked = false; cbLyrics007.Checked = false; cbLrcFinder.Checked = false; cbLyricWiki.Checked = false; cbHotLyrics.Checked = false; - cbSeekLyrics.Checked = false; cbActionext.Checked = false; cbLyrDB.Checked = false; } @@ -1113,23 +1113,23 @@ { cbLyricsOnDemand.Checked = true; cbLyrics007.Checked = true; + cbLyricsPluginSite.Checked = true; cbLrcFinder.Checked = false; cbLyricWiki.Checked = false; cbHotLyrics.Checked = false; - cbSeekLyrics.Checked = false; cbActionext.Checked = false; cbLyrDB.Checked = false; } else if (trackBar.Value == 2) { cbLyricsOnDemand.Checked = true; + cbLyricsPluginSite.Checked = true; cbLyrics007.Checked = true; cbLrcFinder.Checked = true; cbLyricWiki.Checked = true; cbHotLyrics.Checked = true; - cbActionext.Checked = true; - cbLyrDB.Checked = true; - cbSeekLyrics.Checked = false; + cbActionext.Checked = false; + cbLyrDB.Checked = false; } else if (trackBar.Value == 3) { @@ -1138,9 +1138,9 @@ cbLrcFinder.Checked = true; cbLyricWiki.Checked = true; cbHotLyrics.Checked = true; - cbSeekLyrics.Checked = true; cbLyrDB.Checked = true; cbActionext.Checked = true; + cbLyricsPluginSite.Checked = true; } if (sender != null) @@ -1159,7 +1159,7 @@ cbLrcFinder.Checked = true; cbLyricWiki.Checked = true; cbHotLyrics.Checked = true; - cbSeekLyrics.Checked = false; + cbLyricsPluginSite.Checked = true; trackBar.Value = 2; } @@ -1174,8 +1174,8 @@ cbLyrics007.Enabled = false; cbLrcFinder.Enabled = false; cbLyricWiki.Enabled = false; + cbLyricsPluginSite.Enabled = false; cbHotLyrics.Enabled = false; - cbSeekLyrics.Enabled = false; cbActionext.Enabled = false; cbLyrDB.Enabled = false; trackBar_Scroll(null, null); @@ -1194,8 +1194,8 @@ cbLyrics007.Enabled = true; cbLrcFinder.Enabled = true; cbLyricWiki.Enabled = true; + cbLyricsPluginSite.Enabled = true; cbHotLyrics.Enabled = true; - cbSeekLyrics.Enabled = true; cbActionext.Enabled = true; cbLyrDB.Enabled = true; } @@ -1208,18 +1208,18 @@ cbLrcFinder.Enabled = false; cbLyricWiki.Enabled = false; cbHotLyrics.Enabled = false; - cbSeekLyrics.Enabled = false; cbActionext.Enabled = false; cbLyrDB.Enabled = false; + cbLyricsPluginSite.Enabled = false; cbLyricsOnDemand.Checked = false; cbLyrics007.Checked = false; cbLrcFinder.Checked = true; cbLyricWiki.Checked = false; cbHotLyrics.Checked = false; - cbSeekLyrics.Checked = false; cbActionext.Checked = false; cbLyrDB.Checked = false; + cbLyricsPluginSite.Checked = false; cbMusicTagAlwaysCheck.Checked = false; cbMusicTagWrite.Checked = true; @@ -1258,8 +1258,8 @@ 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()); xmlwriter.SetValue("myLyrics", "useHotLyrics", cbHotLyrics.Checked.ToString()); + xmlwriter.SetValue("myLyrics", "useLyricsPluginSite", cbLyricsPluginSite.Checked.ToString()); xmlwriter.SetValueAsBool("myLyrics", "useAutoscroll", cbUseAutoScrollAsDefault.Checked); xmlwriter.SetValueAsBool("myLyrics", "useAutoOnLyricLength", cbAutoChangeToLineLimit.Checked); xmlwriter.SetValue("myLyrics", "AutoLyricLength", tbLyricsLimit.Text); Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.resx =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.resx 2009-07-26 10:50:11 UTC (rev 3030) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.resx 2009-07-26 11:48:12 UTC (rev 3031) @@ -123,6 +123,12 @@ <metadata name="Replace.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> + <metadata name="Find.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </metadata> + <metadata name="Replace.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </metadata> <metadata name="bgWorkerSearch.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>6, 4</value> </metadata> Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2009-07-26 10:50:11 UTC (rev 3030) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2009-07-26 11:48:12 UTC (rev 3031) @@ -53,7 +53,7 @@ bool m_alreadyValidLRC = false; bool m_ValidLrcLyric = false; // A valid LRC-lyric always overwrites a normal lyric in both Lyrics db and music tag (if allowed) - bool m_useLyricWiki, m_useLrcFinder, m_useLyrics007, m_useLyricsOnDemand, m_useSeekLyrics, m_useHotLyrics, m_useActionext, m_useLyrDB; + bool m_useLyricWiki, m_useLrcFinder, m_useLyrics007, m_useLyricsOnDemand, m_useLyricsPluginSite, m_useHotLyrics, m_useActionext, m_useLyrDB; bool m_enableLogging = false; private string logFullFileName = ""; @@ -478,7 +478,7 @@ m_useLyricWiki = ((string)xmlreader.GetValueAsString("myLyrics", "useLyricWiki", "True")).ToString().Equals("True") ? true : false; m_useLyrics007 = ((string)xmlreader.GetValueAsString("myLyrics", "useLyrics007", "True")).ToString().Equals("True") ? true : false; m_useLyricsOnDemand = ((string)xmlreader.GetValueAsString("myLyrics", "useLyricsOnDemand", "True")).ToString().Equals("True") ? true : false; - m_useSeekLyrics = ((string)xmlreader.GetValueAsString("myLyrics", "useSeekLyrics", "True")).ToString().Equals("True") ? true : false; + m_useLyricsPluginSite = ((string)xmlreader.GetValueAsString("myLyrics", "useLyricsPluginSite", "True")).ToString().Equals("True") ? true : false; m_useHotLyrics = ((string)xmlreader.GetValueAsString("myLyrics", "useHotLyrics", "True")).ToString().Equals("True") ? true : false; m_useActionext = ((string)xmlreader.GetValueAsString("myLyrics", "useActionext", "True")).ToString().Equals("True") ? true : false; m_useLyrDB = ((string)xmlreader.GetValueAsString("myLyrics", "useLyrDB", "True")).ToString().Equals("True") ? true : false; @@ -567,14 +567,14 @@ { sitesToSearch.Add("LyricsOnDemand"); } - if (m_useSeekLyrics && Setup.IsMember("SeekLyrics")) - { - sitesToSearch.Add("SeekLyrics"); - } if (m_useHotLyrics && Setup.IsMember("HotLyrics")) { sitesToSearch.Add("HotLyrics"); } + if (m_useLyricsPluginSite && Setup.IsMember("LyricsPluginSite")) + { + sitesToSearch.Add("LyricsPluginSite"); + } m_LyricSitesTosearch = (string[])sitesToSearch.ToArray(typeof(string)); Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj 2009-07-26 10:50:11 UTC (rev 3030) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj 2009-07-26 11:48:12 UTC (rev 3031) @@ -5,7 +5,7 @@ <ProductVersion>9.0.21022</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{BBB2DAE2-0D83-4B4B-85B6-D1B5A7E10039}</ProjectGuid> - <OutputType>Library</OutputType> + <OutputType>WinExe</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>MyLyrics</RootNamespace> <AssemblyName>MyLyrics</AssemblyName> Modified: trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs 2009-07-26 10:50:11 UTC (rev 3030) +++ trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs 2009-07-26 11:48:12 UTC (rev 3031) @@ -10,7 +10,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("My Lyrics")] -[assembly: AssemblyCopyright("Copyright © 2006")] +[assembly: AssemblyCopyright("Copyright © 2009")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -31,5 +31,5 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.32")] -[assembly: AssemblyFileVersion("1.32")] +[assembly: AssemblyVersion("1.33")] +[assembly: AssemblyFileVersion("1.33")] Modified: trunk/plugins/MyLyrics/My Lyrics/change log.txt =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/change log.txt 2009-07-26 10:50:11 UTC (rev 3030) +++ trunk/plugins/MyLyrics/My Lyrics/change log.txt 2009-07-26 11:48:12 UTC (rev 3031) @@ -1,4 +1,4 @@ -Release notes to MyLyrics 1.32 +Release notes to MyLyrics 1.33 MyLyrics enables the display of lyrics for the currently played music file inside MediaPortal. The plugin is able show LRC and plain lyrics, and uses both musictags and online searches to find lyrics. @@ -36,8 +36,8 @@ Installation: Simple copy the content of the zip-file into your MP library (typical C:\Program Files\Team MediaPortal\MediaPortal). -Noteworthy changes since version 1.31: -- Add: Improved logging system. -- Fix: The plugin could crash and pull down MP Configuration when the artist string in the tag starting with a special char. -- Fix: When the LRCFinder server was down not all calls to the server were terminated correcly. -- Fix: When logging was enabled multiple threads could try to access batch file simultaneously. \ No newline at end of file +Noteworthy changes since version 1.32: +- Add: Support for www.lyricsplugin.com added +- Fix: Support for LyricsOnDemand fixed +- Rem: Support for SeekLyrics removed +- Fix: Various minor fixes in the configuration \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2009-07-27 09:38:00
|
Revision: 3032 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3032&view=rev Author: saamand Date: 2009-07-27 09:37:52 +0000 (Mon, 27 Jul 2009) Log Message: ----------- Version 1.34 Modified Paths: -------------- trunk/plugins/MyLyrics/LyricsEngine/Properties/AssemblyInfo.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.resx trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs trunk/plugins/MyLyrics/My Lyrics/change log.txt Modified: trunk/plugins/MyLyrics/LyricsEngine/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/Properties/AssemblyInfo.cs 2009-07-26 11:48:12 UTC (rev 3031) +++ trunk/plugins/MyLyrics/LyricsEngine/Properties/AssemblyInfo.cs 2009-07-27 09:37:52 UTC (rev 3032) @@ -26,7 +26,7 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.33")] +[assembly: AssemblyVersion("1.34")] // // In order to sign your assembly you must specify a key to use. Refer to the Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs 2009-07-26 11:48:12 UTC (rev 3031) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs 2009-07-27 09:37:52 UTC (rev 3032) @@ -80,7 +80,7 @@ this.lbInfo1.Name = "lbInfo1"; this.lbInfo1.Size = new System.Drawing.Size(197, 18); this.lbInfo1.TabIndex = 3; - this.lbInfo1.Text = "MyLyrics plugin, version 1.33"; + this.lbInfo1.Text = "MyLyrics plugin, version 1.34"; // // label2 // Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs 2009-07-26 11:48:12 UTC (rev 3031) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs 2009-07-27 09:37:52 UTC (rev 3032) @@ -103,8 +103,8 @@ this.cbLyrDB = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.cbActionext = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.cbLyrics007 = new MediaPortal.UserInterface.Controls.MPCheckBox(); + this.cbLyricsOnDemand = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.cbLyricWiki = new MediaPortal.UserInterface.Controls.MPCheckBox(); - this.cbLyricsOnDemand = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.cbHotLyrics = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.cbLyricsPluginSite = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.groupBox1 = new System.Windows.Forms.GroupBox(); @@ -175,7 +175,7 @@ this.tabPageMusicDatabaseBrowse.Location = new System.Drawing.Point(4, 22); this.tabPageMusicDatabaseBrowse.Name = "tabPageMusicDatabaseBrowse"; this.tabPageMusicDatabaseBrowse.Padding = new System.Windows.Forms.Padding(3); - this.tabPageMusicDatabaseBrowse.Size = new System.Drawing.Size(550, 504); + this.tabPageMusicDatabaseBrowse.Size = new System.Drawing.Size(550, 512); this.tabPageMusicDatabaseBrowse.TabIndex = 3; this.tabPageMusicDatabaseBrowse.Text = "Music database browse"; this.tabPageMusicDatabaseBrowse.UseVisualStyleBackColor = true; @@ -190,7 +190,7 @@ this.tabPageDatabase.Location = new System.Drawing.Point(4, 22); this.tabPageDatabase.Name = "tabPageDatabase"; this.tabPageDatabase.Padding = new System.Windows.Forms.Padding(3); - this.tabPageDatabase.Size = new System.Drawing.Size(550, 504); + this.tabPageDatabase.Size = new System.Drawing.Size(550, 512); this.tabPageDatabase.TabIndex = 2; this.tabPageDatabase.Text = "Music database batch search"; this.tabPageDatabase.UseVisualStyleBackColor = true; @@ -952,6 +952,7 @@ this.cbLrcFinder.TabIndex = 10; this.cbLrcFinder.Text = "LrcFinder"; this.cbLrcFinder.UseVisualStyleBackColor = true; + this.cbLrcFinder.Leave += new System.EventHandler(this.WriteMediaPortalXML); // // cbLyrDB // @@ -995,6 +996,20 @@ this.cbLyrics007.UseVisualStyleBackColor = true; this.cbLyrics007.Leave += new System.EventHandler(this.WriteMediaPortalXML); // + // cbLyricsOnDemand + // + this.cbLyricsOnDemand.AutoSize = true; + 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(20, 17); + this.cbLyricsOnDemand.Name = "cbLyricsOnDemand"; + this.cbLyricsOnDemand.Size = new System.Drawing.Size(108, 17); + this.cbLyricsOnDemand.TabIndex = 5; + this.cbLyricsOnDemand.Text = "Lyrics OnDemand"; + this.cbLyricsOnDemand.UseVisualStyleBackColor = true; + this.cbLyricsOnDemand.Leave += new System.EventHandler(this.WriteMediaPortalXML); + // // cbLyricWiki // this.cbLyricWiki.AutoSize = true; @@ -1009,20 +1024,6 @@ this.cbLyricWiki.UseVisualStyleBackColor = true; this.cbLyricWiki.Leave += new System.EventHandler(this.WriteMediaPortalXML); // - // cbLyricsOnDemand - // - this.cbLyricsOnDemand.AutoSize = true; - 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(20, 17); - this.cbLyricsOnDemand.Name = "cbLyricsOnDemand"; - this.cbLyricsOnDemand.Size = new System.Drawing.Size(108, 17); - this.cbLyricsOnDemand.TabIndex = 5; - this.cbLyricsOnDemand.Text = "Lyrics OnDemand"; - this.cbLyricsOnDemand.UseVisualStyleBackColor = true; - this.cbLyricsOnDemand.Leave += new System.EventHandler(this.WriteMediaPortalXML); - // // cbHotLyrics // this.cbHotLyrics.AutoSize = true; @@ -1129,7 +1130,7 @@ this.tabPageReplace.Location = new System.Drawing.Point(4, 22); this.tabPageReplace.Name = "tabPageReplace"; this.tabPageReplace.Padding = new System.Windows.Forms.Padding(3); - this.tabPageReplace.Size = new System.Drawing.Size(550, 504); + this.tabPageReplace.Size = new System.Drawing.Size(550, 512); this.tabPageReplace.TabIndex = 5; this.tabPageReplace.Text = "Find & Replace"; this.tabPageReplace.UseVisualStyleBackColor = true; @@ -1182,7 +1183,7 @@ this.tabPageAbout.Location = new System.Drawing.Point(4, 22); this.tabPageAbout.Name = "tabPageAbout"; this.tabPageAbout.Padding = new System.Windows.Forms.Padding(3); - this.tabPageAbout.Size = new System.Drawing.Size(550, 504); + this.tabPageAbout.Size = new System.Drawing.Size(550, 512); this.tabPageAbout.TabIndex = 4; this.tabPageAbout.Text = "About"; this.tabPageAbout.UseVisualStyleBackColor = true; Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.resx =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.resx 2009-07-26 11:48:12 UTC (rev 3031) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.resx 2009-07-27 09:37:52 UTC (rev 3032) @@ -123,12 +123,6 @@ <metadata name="Replace.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> - <metadata name="Find.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="Replace.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> <metadata name="bgWorkerSearch.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>6, 4</value> </metadata> Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2009-07-26 11:48:12 UTC (rev 3031) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2009-07-27 09:37:52 UTC (rev 3032) @@ -277,8 +277,10 @@ m_artist = m_artist.Replace("| ", ""); m_artist = m_artist.Replace(" |", ""); m_artist = m_artist.Replace("''", "'"); + m_artist = LyricUtil.CapatalizeString(m_artist); m_title = m_CurrentTrackTag.Title.Trim(); m_title = m_title.Replace("''", "'"); + m_title = LyricUtil.CapatalizeString(m_title); getAlbumArt(); } @@ -1114,7 +1116,7 @@ { string lyric = LyricUtil.FixLyrics(m_CurrentTrackTag.Lyrics); m_CurrentTrackTag.Lyrics = lyric; - ShowLyricOnScreen(lyric, m_CurrentTrackTag.FileName); + ShowLyricOnScreen(lyric, "music tag"); SaveLyricToDatabase(m_CurrentTrackTag.Artist, m_CurrentTrackTag.Title, lyric, "music tag", false); return true; } Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj 2009-07-26 11:48:12 UTC (rev 3031) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj 2009-07-27 09:37:52 UTC (rev 3032) @@ -5,7 +5,7 @@ <ProductVersion>9.0.21022</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{BBB2DAE2-0D83-4B4B-85B6-D1B5A7E10039}</ProjectGuid> - <OutputType>WinExe</OutputType> + <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>MyLyrics</RootNamespace> <AssemblyName>MyLyrics</AssemblyName> Modified: trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs 2009-07-26 11:48:12 UTC (rev 3031) +++ trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs 2009-07-27 09:37:52 UTC (rev 3032) @@ -31,5 +31,5 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.33")] -[assembly: AssemblyFileVersion("1.33")] +[assembly: AssemblyVersion("1.34")] +[assembly: AssemblyFileVersion("1.34")] Modified: trunk/plugins/MyLyrics/My Lyrics/change log.txt =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/change log.txt 2009-07-26 11:48:12 UTC (rev 3031) +++ trunk/plugins/MyLyrics/My Lyrics/change log.txt 2009-07-27 09:37:52 UTC (rev 3032) @@ -1,4 +1,4 @@ -Release notes to MyLyrics 1.33 +Release notes to MyLyrics 1.34 MyLyrics enables the display of lyrics for the currently played music file inside MediaPortal. The plugin is able show LRC and plain lyrics, and uses both musictags and online searches to find lyrics. @@ -36,8 +36,6 @@ Installation: Simple copy the content of the zip-file into your MP library (typical C:\Program Files\Team MediaPortal\MediaPortal). -Noteworthy changes since version 1.32: -- Add: Support for www.lyricsplugin.com added -- Fix: Support for LyricsOnDemand fixed -- Rem: Support for SeekLyrics removed -- Fix: Various minor fixes in the configuration \ No newline at end of file +Noteworthy changes since version 1.33: +- Fix: Within MyLyrics entries in the lyrics database were often not recognized due to inproper capitalizing of title string. +- Fix: Logging messages now writes correct source when lyric found in music tag. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2009-08-26 13:17:16
|
Revision: 3070 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3070&view=rev Author: saamand Date: 2009-08-26 13:17:00 +0000 (Wed, 26 Aug 2009) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MyLyrics/LyricsEngine/LyricsEngine.csproj trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyricWiki.cs trunk/plugins/MyLyrics/LyricsEngine/Properties/AssemblyInfo.cs trunk/plugins/MyLyrics/LyricsEngine/Properties/Settings.Designer.cs trunk/plugins/MyLyrics/LyricsEngine/Properties/Settings.settings trunk/plugins/MyLyrics/LyricsEngine/app.config trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs trunk/plugins/MyLyrics/My Lyrics/change log.txt Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsEngine.csproj =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsEngine.csproj 2009-08-26 12:17:58 UTC (rev 3069) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsEngine.csproj 2009-08-26 13:17:00 UTC (rev 3070) @@ -83,20 +83,6 @@ <Generator>SettingsSingleFileGenerator</Generator> <LastGenOutput>Settings.Designer.cs</LastGenOutput> </None> - <None Include="Web References\org.lyricwiki\LyricsResult.datasource"> - <DependentUpon>Reference.map</DependentUpon> - </None> - <None Include="Web References\org.lyricwiki\Reference.map"> - <Generator>MSDiscoCodeGenerator</Generator> - <LastGenOutput>Reference.cs</LastGenOutput> - </None> - <None Include="Web References\org.lyricwiki\server.wsdl" /> - <None Include="Web References\org.lyricwiki\SongResult.datasource"> - <DependentUpon>Reference.map</DependentUpon> - </None> - <None Include="Web References\org.lyricwiki\SOTDResult.datasource"> - <DependentUpon>Reference.map</DependentUpon> - </None> <Compile Include="Properties\Settings.Designer.cs"> <AutoGen>True</AutoGen> <DependentUpon>Settings.settings</DependentUpon> @@ -108,11 +94,6 @@ <DesignTime>True</DesignTime> <DependentUpon>Reference.map</DependentUpon> </Compile> - <Compile Include="Web References\org.lyricwiki\Reference.cs"> - <AutoGen>True</AutoGen> - <DesignTime>True</DesignTime> - <DependentUpon>Reference.map</DependentUpon> - </Compile> <Compile Include="LyricsSites\LyricWiki.cs" /> </ItemGroup> <ItemGroup> @@ -130,17 +111,6 @@ <CachedAppSettingsObjectName>Settings</CachedAppSettingsObjectName> <CachedSettingsPropName>LyricsEngine_lrcfinder_LrcFinder</CachedSettingsPropName> </WebReferenceUrl> - <WebReferenceUrl Include="http://lyricwiki.org/server.php%3fwsdl"> - <UrlBehavior>Dynamic</UrlBehavior> - <RelPath>Web References\org.lyricwiki\</RelPath> - <UpdateFromURL>http://lyricwiki.org/server.php%3fwsdl</UpdateFromURL> - <ServiceLocationURL> - </ServiceLocationURL> - <CachedDynamicPropName> - </CachedDynamicPropName> - <CachedAppSettingsObjectName>Settings</CachedAppSettingsObjectName> - <CachedSettingsPropName>LyricsEngine_org_lyricwiki_LyricWiki</CachedSettingsPropName> - </WebReferenceUrl> </ItemGroup> <ItemGroup> <None Include="Web References\lrcfinder\LrcFinder.disco" /> Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyricWiki.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyricWiki.cs 2009-08-26 12:17:58 UTC (rev 3069) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/LyricWiki.cs 2009-08-26 13:17:00 UTC (rev 3070) @@ -28,47 +28,13 @@ artist = LyricUtil.RemoveFeatComment(artist); artist = LyricUtil.CapatalizeString(artist); - artist = artist.Replace(" ", "_"); title = LyricUtil.TrimForParenthesis(title); title = LyricUtil.CapatalizeString(title); - title = title.Replace(" ", "_"); + title = title.Replace("?", "%3F"); - // German letters - artist = artist.Replace("ü", ""); - artist = artist.Replace("Ü", ""); - artist = artist.Replace("ä", ""); - artist = artist.Replace("Ä", ""); - artist = artist.Replace("ö", ""); - artist = artist.Replace("Ö", ""); - artist = artist.Replace("ß", ""); - title = title.Replace("ü", ""); - title = title.Replace("Ü", ""); - title = title.Replace("ä", ""); - title = title.Replace("Ä", ""); - title = title.Replace("ö", ""); - title = title.Replace("Ö", ""); - title = title.Replace("ß", ""); - - // Danish letters - artist = artist.Replace("æ", "%C3%A6"); - artist = artist.Replace("ø", ""); - artist = artist.Replace("Ø", "%C3%98"); - artist = artist.Replace("å", ""); - artist = artist.Replace("Å", ""); - title = title.Replace("æ", "%C3%A6"); - title = title.Replace("ø", ""); - title = title.Replace("Ø", "%C3%98"); - title = title.Replace("å", ""); - title = title.Replace("Å", ""); - - // French letters - artist = artist.Replace("é", ""); - title = title.Replace("é", ""); - - if (string.IsNullOrEmpty(artist) || string.IsNullOrEmpty(title)) { return; @@ -146,10 +112,14 @@ lyric = Encoding.UTF8.GetString(iso8859.GetBytes(lyric)); lyric = lyric.Replace("<br />", "\r\n"); + lyric = lyric.Replace("<i>", ""); + lyric = lyric.Replace("</i>", ""); + lyric = lyric.Replace("<b>", ""); + lyric = lyric.Replace("</b>", ""); lyric = lyric.Trim(); - if (lyric.Contains("<td")) + if (lyric.Contains("<")) { lyric = "Not found"; } Modified: trunk/plugins/MyLyrics/LyricsEngine/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/Properties/AssemblyInfo.cs 2009-08-26 12:17:58 UTC (rev 3069) +++ trunk/plugins/MyLyrics/LyricsEngine/Properties/AssemblyInfo.cs 2009-08-26 13:17:00 UTC (rev 3070) @@ -26,7 +26,7 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.34")] +[assembly: AssemblyVersion("1.35")] // // In order to sign your assembly you must specify a key to use. Refer to the Modified: trunk/plugins/MyLyrics/LyricsEngine/Properties/Settings.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/Properties/Settings.Designer.cs 2009-08-26 12:17:58 UTC (rev 3069) +++ trunk/plugins/MyLyrics/LyricsEngine/Properties/Settings.Designer.cs 2009-08-26 13:17:00 UTC (rev 3070) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. -// Runtime Version:2.0.50727.1434 +// Runtime Version:2.0.50727.3074 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -25,16 +25,6 @@ [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.WebServiceUrl)] - [global::System.Configuration.DefaultSettingValueAttribute("http://lyricwiki.org/server.php")] - public string LyricsEngine_org_lyricwiki_LyricWiki { - get { - return ((string)(this["LyricsEngine_org_lyricwiki_LyricWiki"])); - } - } - - [global::System.Configuration.ApplicationScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("http://api.google.com/search/beta2")] public string Google_GoogleSearchService { get { Modified: trunk/plugins/MyLyrics/LyricsEngine/Properties/Settings.settings =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/Properties/Settings.settings 2009-08-26 12:17:58 UTC (rev 3069) +++ trunk/plugins/MyLyrics/LyricsEngine/Properties/Settings.settings 2009-08-26 13:17:00 UTC (rev 3070) @@ -2,9 +2,6 @@ <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="LyricsEngine.Properties" GeneratedClassName="Settings"> <Profiles /> <Settings> - <Setting Name="LyricsEngine_org_lyricwiki_LyricWiki" Type="(Web Service URL)" Scope="Application"> - <Value Profile="(Default)">http://lyricwiki.org/server.php</Value> - </Setting> <Setting Name="Google_GoogleSearchService" Type="System.String" Scope="Application"> <Value Profile="(Default)">http://api.google.com/search/beta2</Value> </Setting> Modified: trunk/plugins/MyLyrics/LyricsEngine/app.config =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/app.config 2009-08-26 12:17:58 UTC (rev 3069) +++ trunk/plugins/MyLyrics/LyricsEngine/app.config 2009-08-26 13:17:00 UTC (rev 3070) @@ -7,9 +7,12 @@ </configSections> <applicationSettings> <LyricsEngine.Properties.Settings> - <setting name="LyricsEngine_org_lyricwiki_LyricWiki" serializeAs="String"> - <value>http://lyricwiki.org/server.php</value> + <setting name="Google_GoogleSearchService" serializeAs="String"> + <value>http://api.google.com/search/beta2</value> </setting> + <setting name="MyLyrics_Google_GoogleSearchService" serializeAs="String"> + <value>http://api.google.com/search/beta2</value> + </setting> <setting name="LyricsEngine_lrcfinder_LrcFinder" serializeAs="String"> <value>http://lrcfinder.profiler.nl/LrcFinder.asmx</value> </setting> Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs 2009-08-26 12:17:58 UTC (rev 3069) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs 2009-08-26 13:17:00 UTC (rev 3070) @@ -80,7 +80,7 @@ this.lbInfo1.Name = "lbInfo1"; this.lbInfo1.Size = new System.Drawing.Size(197, 18); this.lbInfo1.TabIndex = 3; - this.lbInfo1.Text = "MyLyrics plugin, version 1.34"; + this.lbInfo1.Text = "MyLyrics plugin, version 1.35"; // // label2 // Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj 2009-08-26 12:17:58 UTC (rev 3069) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj 2009-08-26 13:17:00 UTC (rev 3070) @@ -5,7 +5,7 @@ <ProductVersion>9.0.21022</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{BBB2DAE2-0D83-4B4B-85B6-D1B5A7E10039}</ProjectGuid> - <OutputType>WinExe</OutputType> + <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>MyLyrics</RootNamespace> <AssemblyName>MyLyrics</AssemblyName> Modified: trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs 2009-08-26 12:17:58 UTC (rev 3069) +++ trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs 2009-08-26 13:17:00 UTC (rev 3070) @@ -31,5 +31,5 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.34")] -[assembly: AssemblyFileVersion("1.34")] +[assembly: AssemblyVersion("1.35")] +[assembly: AssemblyFileVersion("1.35")] Modified: trunk/plugins/MyLyrics/My Lyrics/change log.txt =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/change log.txt 2009-08-26 12:17:58 UTC (rev 3069) +++ trunk/plugins/MyLyrics/My Lyrics/change log.txt 2009-08-26 13:17:00 UTC (rev 3070) @@ -37,6 +37,7 @@ Simple copy the content of the zip-file into your MP library (typical C:\Program Files\Team MediaPortal\MediaPortal). Noteworthy changes since version 1.34: -- Fix: The LyricWiki fixed (webservice always returned information text instead of lyric). +- Fix: The LyricWiki entry fixed (webservice always returned information text instead of lyric.). - Fix: Toogle between cover and artist art were deactivated, so artist art was never shown. - Add: Album art also shown in editor mode +- Fix: Fix LyricsPlugin unicode (thanks to yoavain!) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2009-08-26 13:22:31
|
Revision: 3067 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3067&view=rev Author: saamand Date: 2009-08-26 12:13:25 +0000 (Wed, 26 Aug 2009) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MyLyrics/LyricsEngine/LyricSearch.cs trunk/plugins/MyLyrics/LyricsEngine/LyricsController.cs trunk/plugins/MyLyrics/LyricsEngine/LyricsEngine.csproj trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj trunk/plugins/MyLyrics/My Lyrics/MyLyricsExternCode.cs trunk/plugins/MyLyrics/My Lyrics/change log.txt Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricSearch.cs =================================================================== (Binary files differ) Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsController.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsController.cs 2009-08-25 14:40:00 UTC (rev 3066) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsController.cs 2009-08-26 12:13:25 UTC (rev 3067) @@ -76,8 +76,6 @@ m_EventStop_LyricController = eventStopThread; m_EventStopped_LyricController = new ManualResetEvent(false); - LyricSearch.Abort = false; - if (!string.IsNullOrEmpty(find) && !string.IsNullOrEmpty(replace)) { if (find != "") @@ -248,13 +246,11 @@ if (value == true) { m_StopSearches = true; - LyricSearch.Abort = true; //StopTheSearchAndAbort.Invoke(this, EventArgs.Empty); } else { m_StopSearches = false; - LyricSearch.Abort = false; } } } Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsEngine.csproj =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsEngine.csproj 2009-08-25 14:40:00 UTC (rev 3066) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsEngine.csproj 2009-08-26 12:13:25 UTC (rev 3067) @@ -113,7 +113,7 @@ <DesignTime>True</DesignTime> <DependentUpon>Reference.map</DependentUpon> </Compile> - <Compile Include="LyricsSites\Wiki.cs" /> + <Compile Include="LyricsSites\LyricWiki.cs" /> </ItemGroup> <ItemGroup> <WebReferences Include="Web References\" /> Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2009-08-25 14:40:00 UTC (rev 3066) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2009-08-26 12:13:25 UTC (rev 3067) @@ -259,6 +259,8 @@ { m_alreadyValidLRC = false; + m_ImagePathContainer.Clear(); + m_lyricsFound = false; StopThread(); m_newTrack = false; @@ -283,6 +285,7 @@ m_title = LyricUtil.CapatalizeString(m_title); getAlbumArt(); + getAlbumArt(m_artist); } } else @@ -617,7 +620,7 @@ if (m_ImageChangeTimer == null) { m_ImageChangeTimer = new System.Timers.Timer(); - m_ImageChangeTimer.Interval = 3600 * 1000; + m_ImageChangeTimer.Interval = 15 * 1000; m_ImageChangeTimer.Elapsed += new ElapsedEventHandler(OnImageTimerTickEvent); m_ImageChangeTimer.Start(); } @@ -1875,7 +1878,6 @@ GUIControl.HideControl(GetID, CONTROL_LYRIC_SELECTED); GUIControl.HideControl(GetID, CONTROL_LYRICWIDE_SELECTED); - // album art only visible for basic screen GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_CURRENTLY); GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_DURATION); GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_ALBUM); @@ -1915,15 +1917,14 @@ GUIControl.HideControl(GetID, CONTROL_LYRIC_SELECTED); GUIControl.HideControl(GetID, CONTROL_LYRICWIDE_SELECTED); - // album art only visible for lyrics_basic screen - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_CURRENTLY); - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_DURATION); - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_ALBUM); - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_YEAR); - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_NOWPLAYINGBACK); - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_ALBUMART); - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_PROGRESS); - GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_PROGRESSIMAGE); + GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_CURRENTLY); + GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_DURATION); + GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_ALBUM); + GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_YEAR); + GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_NOWPLAYINGBACK); + GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_ALBUMART); + GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_PROGRESS); + GUIControl.ShowControl(GetID, (int)GUI_LRC_Controls.CONTROL_ART_PROGRESSIMAGE); // LRC controls GUIControl.HideControl(GetID, (int)GUI_LRC_Controls.CONTROL_TAGBUTTON); Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj 2009-08-25 14:40:00 UTC (rev 3066) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj 2009-08-26 12:13:25 UTC (rev 3067) @@ -5,7 +5,7 @@ <ProductVersion>9.0.21022</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{BBB2DAE2-0D83-4B4B-85B6-D1B5A7E10039}</ProjectGuid> - <OutputType>Library</OutputType> + <OutputType>WinExe</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>MyLyrics</RootNamespace> <AssemblyName>MyLyrics</AssemblyName> Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyricsExternCode.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyricsExternCode.cs 2009-08-25 14:40:00 UTC (rev 3066) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyricsExternCode.cs 2009-08-26 12:13:25 UTC (rev 3067) @@ -29,7 +29,6 @@ { public void getAlbumArt() { - m_ImagePathContainer.Clear(); m_CurrentTrackFileName = g_Player.CurrentFile; GetTrackTags(); @@ -48,12 +47,6 @@ public void getAlbumArt(string artist) { - m_ImagePathContainer.Clear(); - - m_PreviousTrackTag = null; - m_CurrentTrackTag = null; - m_NextTrackTag = null; - m_CurrentThumbFileName = MediaPortal.Util.Utils.GetCoverArtName(Thumbs.MusicArtists, artist); if (m_CurrentThumbFileName.Length > 0) Modified: trunk/plugins/MyLyrics/My Lyrics/change log.txt =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/change log.txt 2009-08-25 14:40:00 UTC (rev 3066) +++ trunk/plugins/MyLyrics/My Lyrics/change log.txt 2009-08-26 12:13:25 UTC (rev 3067) @@ -1,4 +1,4 @@ -Release notes to MyLyrics 1.34 +Release notes to MyLyrics 1.35 MyLyrics enables the display of lyrics for the currently played music file inside MediaPortal. The plugin is able show LRC and plain lyrics, and uses both musictags and online searches to find lyrics. @@ -36,6 +36,7 @@ Installation: Simple copy the content of the zip-file into your MP library (typical C:\Program Files\Team MediaPortal\MediaPortal). -Noteworthy changes since version 1.33: -- Fix: Within MyLyrics entries in the lyrics database were often not recognized due to inproper capitalizing of title string. -- Fix: Logging messages now writes correct source when lyric found in music tag. +Noteworthy changes since version 1.34: +- Fix: The LyricWiki fixed (webservice always returned information text instead of lyric). +- Fix: Toogle between cover and artist art were deactivated, so artist art was never shown. +- Add: Album art also shown in editor mode This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |