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