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. |