From: <sa...@us...> - 2007-03-07 16:03:36
|
Revision: 163 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=163&view=rev Author: saamand Date: 2007-03-07 08:03:32 -0800 (Wed, 07 Mar 2007) Log Message: ----------- Before new serialization structure Modified Paths: -------------- trunk/plugins/MyLyrics/My Lyrics/MyLyricsSetup.Designer.cs trunk/plugins/MyLyrics/My Lyrics/MyLyricsSetup.cs trunk/plugins/MyLyrics/My Lyrics/MyLyricsSetup_LyricsLibrary.Designer.cs trunk/plugins/MyLyrics/My Lyrics/MyLyricsSetup_LyricsLibrary.cs trunk/plugins/MyLyrics/My Lyrics/MyLyricsUtil.cs Removed Paths: ------------- trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj Deleted: trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj 2007-03-06 15:07:16 UTC (rev 162) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj 2007-03-07 16:03:32 UTC (rev 163) @@ -1,129 +0,0 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <PropertyGroup> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProductVersion>8.0.50727</ProductVersion> - <SchemaVersion>2.0</SchemaVersion> - <ProjectGuid>{BBB2DAE2-0D83-4B4B-85B6-D1B5A7E10039}</ProjectGuid> - <OutputType>WinExe</OutputType> - <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>MyLyrics</RootNamespace> - <AssemblyName>MyLyrics</AssemblyName> - <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent> - <StartupObject>MyLyrics.MyLyricsSetup_test</StartupObject> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> - <DebugSymbols>true</DebugSymbols> - <DebugType>full</DebugType> - <Optimize>false</Optimize> - <OutputPath>bin\Debug\</OutputPath> - <DefineConstants>DEBUG;TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - <NoWarn> - </NoWarn> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> - <Optimize>true</Optimize> - <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - </PropertyGroup> - <ItemGroup> - <Reference Include="Core, Version=1.0.2546.32606, Culture=neutral, processorArchitecture=x86"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\..\..\..\..\Program Files\Team Mediaportal\MediaPortal\Core.DLL</HintPath> - </Reference> - <Reference Include="Databases, Version=1.0.2546.32610, Culture=neutral, processorArchitecture=x86"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\..\..\..\..\Program Files\Team Mediaportal\MediaPortal\Databases.DLL</HintPath> - </Reference> - <Reference Include="Dialogs, Version=0.0.0.0, Culture=neutral, processorArchitecture=x86"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\..\..\..\..\Program Files\Team Mediaportal\MediaPortal\Plugins\Windows\Dialogs.DLL</HintPath> - </Reference> - <Reference Include="System" /> - <Reference Include="System.Data" /> - <Reference Include="System.Drawing" /> - <Reference Include="System.Windows.Forms" /> - <Reference Include="System.Xml" /> - <Reference Include="Utils, Version=1.0.2546.32604, Culture=neutral, processorArchitecture=x86"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\..\..\..\..\Program Files\Team Mediaportal\MediaPortal\Utils.DLL</HintPath> - </Reference> - </ItemGroup> - <ItemGroup> - <Compile Include="MyLyricsSetup_test.cs" /> - <Compile Include="MyLyricsUtil.cs" /> - <Compile Include="MyLyrics.cs" /> - <Compile Include="MyLyricsSetup.cs"> - <SubType>Form</SubType> - </Compile> - <Compile Include="MyLyricsSetup.Designer.cs"> - <DependentUpon>MyLyricsSetup.cs</DependentUpon> - </Compile> - <Compile Include="MyLyricsSetup_AddNewSong.cs"> - <SubType>Form</SubType> - </Compile> - <Compile Include="MyLyricsSetup_AddNewSong.Designer.cs"> - <DependentUpon>MyLyricsSetup_AddNewSong.cs</DependentUpon> - </Compile> - <Compile Include="Properties\AssemblyInfo.cs" /> - <Compile Include="MyLyricsSetup_LyricsLibrary.cs"> - <SubType>UserControl</SubType> - </Compile> - <Compile Include="MyLyricsSetup_LyricsLibrary.Designer.cs"> - <DependentUpon>MyLyricsSetup_LyricsLibrary.cs</DependentUpon> - </Compile> - <Compile Include="Properties\Resources.Designer.cs"> - <AutoGen>True</AutoGen> - <DesignTime>True</DesignTime> - <DependentUpon>Resources.resx</DependentUpon> - </Compile> - </ItemGroup> - <ItemGroup> - <EmbeddedResource Include="MyLyricsSetup_LyricsLibrary.resx"> - <SubType>Designer</SubType> - <DependentUpon>MyLyricsSetup_LyricsLibrary.cs</DependentUpon> - </EmbeddedResource> - <EmbeddedResource Include="MyLyricsSetup.resx"> - <SubType>Designer</SubType> - <DependentUpon>MyLyricsSetup.cs</DependentUpon> - </EmbeddedResource> - <EmbeddedResource Include="MyLyricsSetup_AddNewSong.resx"> - <SubType>Designer</SubType> - <DependentUpon>MyLyricsSetup_AddNewSong.cs</DependentUpon> - </EmbeddedResource> - <EmbeddedResource Include="Properties\Resources.resx"> - <SubType>Designer</SubType> - <Generator>ResXFileCodeGenerator</Generator> - <LastGenOutput>Resources.Designer.cs</LastGenOutput> - </EmbeddedResource> - </ItemGroup> - <ItemGroup> - <ProjectReference Include="..\LRC\LRC.csproj"> - <Project>{1555695C-1274-46BD-97CB-CAC3A393522D}</Project> - <Name>LRC</Name> - </ProjectReference> - <ProjectReference Include="..\LyricsEngine\LyricsEngine.csproj"> - <Project>{B0760CE8-086F-4301-9091-C9BE54F261FD}</Project> - <Name>LyricsEngine</Name> - </ProjectReference> - </ItemGroup> - <ItemGroup> - <Content Include="Changelog.txt" /> - </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. - <Target Name="BeforeBuild"> - </Target> - <Target Name="AfterBuild"> - </Target> - --> - <PropertyGroup> - <PostBuildEvent>copy $(TargetFileName) "C:\Program Files\Team MediaPortal\MediaPortal\plugins\windows"</PostBuildEvent> - </PropertyGroup> -</Project> \ No newline at end of file Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyricsSetup.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyricsSetup.Designer.cs 2007-03-06 15:07:16 UTC (rev 162) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyricsSetup.Designer.cs 2007-03-07 16:03:32 UTC (rev 163) @@ -31,6 +31,7 @@ this.tabControl = new MediaPortal.UserInterface.Controls.MPTabControl(); this.tabPageLyricsDatabase = new MediaPortal.UserInterface.Controls.MPTabPage(); this.tabPageSetup = new MediaPortal.UserInterface.Controls.MPTabPage(); + this.tbNote = new MediaPortal.UserInterface.Controls.MPLabel(); this.gbLyricSites = new MediaPortal.UserInterface.Controls.MPGroupBox(); this.cbHotLyrics = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.cbSeekLyrics = new MediaPortal.UserInterface.Controls.MPCheckBox(); @@ -44,6 +45,7 @@ this.btCancel = new MediaPortal.UserInterface.Controls.MPButton(); this.mpLabel3 = new MediaPortal.UserInterface.Controls.MPLabel(); this.gbGenerel = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.cbSearchOnlyForMarkedSongs = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.cbDisregardSongWithLyricInTag = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.cbDisregardVariousArtist = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.cbDisregardSongsWithNoLyric = new MediaPortal.UserInterface.Controls.MPCheckBox(); @@ -82,7 +84,6 @@ this.btSave = new MediaPortal.UserInterface.Controls.MPButton(); this.btClose = new MediaPortal.UserInterface.Controls.MPButton(); this.bgWorkerSearch = new System.ComponentModel.BackgroundWorker(); - this.tbNote = new MediaPortal.UserInterface.Controls.MPLabel(); this.tabControl.SuspendLayout(); this.tabPageSetup.SuspendLayout(); this.gbLyricSites.SuspendLayout(); @@ -127,6 +128,15 @@ this.tabPageSetup.Text = "General setup"; this.tabPageSetup.UseVisualStyleBackColor = true; // + // 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(17, 111); + this.tbNote.Name = "tbNote"; + this.tbNote.Size = new System.Drawing.Size(377, 18); + this.tbNote.TabIndex = 19; + this.tbNote.Text = "(Seek Lyrics and Evil Labs are currently disabled due to instable servers)"; + // // gbLyricSites // this.gbLyricSites.AutoSize = true; @@ -283,6 +293,7 @@ // // gbGenerel // + this.gbGenerel.Controls.Add(this.cbSearchOnlyForMarkedSongs); this.gbGenerel.Controls.Add(this.cbDisregardSongWithLyricInTag); this.gbGenerel.Controls.Add(this.cbDisregardVariousArtist); this.gbGenerel.Controls.Add(this.cbDisregardSongsWithNoLyric); @@ -299,6 +310,18 @@ this.gbGenerel.TabStop = false; this.gbGenerel.Text = "Music database search setup"; // + // cbSearchOnlyForMarkedSongs + // + this.cbSearchOnlyForMarkedSongs.AutoSize = true; + this.cbSearchOnlyForMarkedSongs.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.cbSearchOnlyForMarkedSongs.Location = new System.Drawing.Point(245, 91); + this.cbSearchOnlyForMarkedSongs.Name = "cbSearchOnlyForMarkedSongs"; + this.cbSearchOnlyForMarkedSongs.Size = new System.Drawing.Size(232, 17); + this.cbSearchOnlyForMarkedSongs.TabIndex = 19; + this.cbSearchOnlyForMarkedSongs.Text = "Search for marked songs ONLY (only batch)"; + this.cbSearchOnlyForMarkedSongs.UseVisualStyleBackColor = true; + this.cbSearchOnlyForMarkedSongs.CheckedChanged += new System.EventHandler(this.cbSearchOnlyForMarkedSongs_CheckedChanged); + // // cbDisregardSongWithLyricInTag // this.cbDisregardSongWithLyricInTag.AutoSize = true; @@ -665,20 +688,11 @@ this.bgWorkerSearch.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.bgWorkerSearch_RunWorkerCompleted); this.bgWorkerSearch.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.bgWorkerSearch_ProgressChanged); // - // 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(17, 111); - this.tbNote.Name = "tbNote"; - this.tbNote.Size = new System.Drawing.Size(377, 18); - this.tbNote.TabIndex = 19; - this.tbNote.Text = "(Seek Lyrics and Evil Labs are currently disabled due to instable servers)"; - // // MyLyricsSetup // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(541, 539); + this.ClientSize = new System.Drawing.Size(539, 542); this.ControlBox = false; this.Controls.Add(this.btClose); this.Controls.Add(this.tabControl); @@ -764,5 +778,6 @@ private MediaPortal.UserInterface.Controls.MPLabel lbTimeElapsed; internal MediaPortal.UserInterface.Controls.MPCheckBox cbHotLyrics; private MediaPortal.UserInterface.Controls.MPLabel tbNote; + private MediaPortal.UserInterface.Controls.MPCheckBox cbSearchOnlyForMarkedSongs; } } \ No newline at end of file Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyricsSetup.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyricsSetup.cs 2007-03-06 15:07:16 UTC (rev 162) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyricsSetup.cs 2007-03-07 16:03:32 UTC (rev 163) @@ -74,6 +74,9 @@ bool m_DisregardKnownLyric = true; bool m_MarkSongsWhenNoLyricFound = true; bool m_DisregardMarkedLyric = true; + bool m_DisregardSongWithLyricInTag = true; + bool m_DisregardVariousArtist = true; + bool m_SearchOnlyMarkedSongs = false; int m_noOfCurrentlySearches = 0; const int m_NoOfCurrentSearchesAllowed = 4; @@ -289,9 +292,12 @@ m_Limit = int.Parse(lbLimit.Text); - m_DisregardKnownLyric = cbDisconsiderTitlesWithLyrics.Checked; - m_MarkSongsWhenNoLyricFound = cbMarkSongsWithNoLyrics.Checked; - m_DisregardMarkedLyric = cbDisregardSongsWithNoLyric.Checked; + m_DisregardKnownLyric = cbDisconsiderTitlesWithLyrics.Enabled && cbDisconsiderTitlesWithLyrics.Checked; + m_MarkSongsWhenNoLyricFound = cbMarkSongsWithNoLyrics.Enabled && cbMarkSongsWithNoLyrics.Checked; + m_DisregardMarkedLyric = cbDisregardSongsWithNoLyric.Enabled && cbDisregardSongsWithNoLyric.Checked; + m_DisregardSongWithLyricInTag = cbDisregardSongWithLyricInTag.Enabled && cbDisregardSongWithLyricInTag.Checked; + m_DisregardVariousArtist = cbDisregardVariousArtist.Enabled && cbDisregardVariousArtist.Checked; + m_SearchOnlyMarkedSongs = cbSearchOnlyForMarkedSongs.Enabled && cbSearchOnlyForMarkedSongs.Checked; m_SongsNotKnown = 0; m_SongsWithLyric = 0; @@ -355,6 +361,14 @@ xmlwriter.SetValue(capArtist, capTitle, m_LyricText); } + if (MyLyricsUtil.isTrackInLyricsMarkedDatabase(capArtist, capTitle).Equals(MyLyricsUtil.LYRIC_MARKED)) + { + using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings("LyricsToFetch.xml", false)) + { + xmlwriter.RemoveEntry(capArtist, capTitle); + } + } + StreamReader sr = File.OpenText(logFullFileName); log = sr.ReadToEnd(); sr.Close(); @@ -380,7 +394,7 @@ string capTitle = LyricUtil.capatalizeString(title); if (m_MarkSongsWhenNoLyricFound) { - using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings("Lyrics.xml", false)) + using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings("LyricsToFetch.xml", false)) { xmlwriter.SetValue(capArtist, capTitle, MyLyricsUtil.MARK); } @@ -495,68 +509,121 @@ #region 1. Sorting song lyricConfigInfosQueue = new Queue(); - MusicDatabase dbs = new MusicDatabase(); - dbs.GetArtists(ref artists); + if (m_SearchOnlyMarkedSongs == false) + { + MusicDatabase dbs = new MusicDatabase(); - m_noOfArtistsToSearch = artists.Count; + dbs.GetArtists(ref artists); - for (int albumIndex = 0; albumIndex < artists.Count; albumIndex++) - { - string currentArtist = (string)artists[albumIndex]; - dbs.GetSongsByArtist(currentArtist, ref songs); + m_noOfArtistsToSearch = artists.Count; - for (int i = 0; i < songs.Count; i++) + for (int albumIndex = 0; albumIndex < artists.Count; albumIndex++) { - // if song isn't known in lyric database the progressbar should not be incremented - int songNotKnown = -1; - Song song = (Song)songs[i]; + string currentArtist = (string)artists[albumIndex]; + dbs.GetSongsByArtist(currentArtist, ref songs); - /* 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 and the music tag has an lyrictext included */ + for (int i = 0; i < songs.Count; i++) + { + // if song isn't known in lyric database the progressbar should not be incremented + int songNotKnown = -1; + Song song = (Song)songs[i]; - MusicTag tag = null; + /* 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 and the music tag has an lyrictext included */ - if (song.Artist.Equals("unknown") - || (cbDisregardVariousArtist.Checked && (song.Artist.ToLower().Equals("various artists") || song.Artist.ToLower().Equals("diverse kunstnere"))) - || (cbDisregardSongWithLyricInTag.Checked && ((tag = MediaPortal.TagReader.TagReader.ReadTag(song.FileName)) != null) && tag.Lyrics.Equals("") == false)) - { - m_DisregardedSongs += 1; - } - else - { - int status = MyLyricsUtil.isTrackInLyricsDatabase(song.Artist, song.Title); + MusicTag tag = null; - if (!m_DisregardKnownLyric && status.Equals(MyLyricsUtil.LYRIC_FOUND) - || !m_DisregardMarkedLyric && status.Equals(MyLyricsUtil.LYRIC_MARKED) - || status.Equals(MyLyricsUtil.LYRIC_NOT_FOUND)) + if (song.Artist.Equals("unknown") + || (m_DisregardVariousArtist && (song.Artist.ToLower().Equals("various artists") || song.Artist.ToLower().Equals("diverse kunstnere"))) + || (m_DisregardSongWithLyricInTag && ((tag = MediaPortal.TagReader.TagReader.ReadTag(song.FileName)) != null) && tag.Lyrics.Equals("") == false)) { + m_DisregardedSongs += 1; + } + else + { + int status = MyLyricsUtil.isTrackInLyricsDatabase(song.Artist, song.Title); + bool isTrackInLyricsMarkedDatabase = true; - songNotKnown = 1; - if (++m_SongsNotKnown > m_Limit) + if (!m_DisregardKnownLyric && status.Equals(MyLyricsUtil.LYRIC_FOUND) + || (!m_DisregardMarkedLyric && ((isTrackInLyricsMarkedDatabase = MyLyricsUtil.isTrackInLyricsMarkedDatabase(song.Artist, song.Title).Equals(MyLyricsUtil.LYRIC_MARKED)) || status.Equals(MyLyricsUtil.LYRIC_MARKED))) + || (status.Equals(MyLyricsUtil.LYRIC_NOT_FOUND) && !MyLyricsUtil.isTrackInLyricsMarkedDatabase(song.Artist, song.Title).Equals(MyLyricsUtil.LYRIC_MARKED))) { - songNotKnown = 0; - bgWorkerSearch.ReportProgress(songNotKnown); - goto startSearch; + + songNotKnown = 1; + if (++m_SongsNotKnown > m_Limit) + { + songNotKnown = 0; + bgWorkerSearch.ReportProgress(songNotKnown); + goto startSearch; + } + + string[] lyricId = new string[2] { song.Artist, song.Title }; + lyricConfigInfosQueue.Enqueue(lyricId); } + else if (status.Equals(MyLyricsUtil.LYRIC_FOUND)) + { + m_SongsWithLyric += 1; + } + else //if (status.Equals(MyLyricsUtil.LYRIC_MARKED)) + { + m_SongsWithMark += 1; + } + } + m_SongsToSearch = lyricConfigInfosQueue.Count; + bgWorkerSearch.ReportProgress(songNotKnown); + } + } + } + else + { + XmlTextReader tr = null; + try + { + tr = new XmlTextReader("LyricsToFetch.xml"); - string[] lyricId = new string[2] { song.Artist, song.Title }; - lyricConfigInfosQueue.Enqueue(lyricId); - } - else if (status.Equals(MyLyricsUtil.LYRIC_FOUND)) + string currentArtist = ""; + string currentTitle = ""; + while (tr.Read()) + { + switch (tr.Name) { - m_SongsWithLyric += 1; + case "section": + if (tr.AttributeCount == 1) + { + currentArtist = tr.GetAttribute(0); + } + break; + case "entry": + if (tr.AttributeCount == 1) + { + currentTitle = tr.GetAttribute(0); + string currentLyrics = tr.Value; + + if (++m_SongsNotKnown > m_Limit) + { + bgWorkerSearch.ReportProgress(-1); + goto startSearch; + } + + string[] lyricId = new string[2] { currentArtist, currentTitle }; + lyricConfigInfosQueue.Enqueue(lyricId); + } + break; } - else //if (status.Equals(MyLyricsUtil.LYRIC_MARKED)) - { - m_SongsWithMark += 1; - } + } - m_SongsToSearch = lyricConfigInfosQueue.Count; - bgWorkerSearch.ReportProgress(songNotKnown); + } + catch { ;} + finally + { + tr.Close(); + } + //m_SongsToSearch = lyricConfigInfosQueue.Count; + //bgWorkerSearch.ReportProgress(songNotKnown); } startSearch: @@ -663,5 +730,25 @@ lbTimer.Text = (hour < 10 ? "0" + hour.ToString() : hour.ToString()) + ":" + (min < 10 ? "0" + min.ToString() : min.ToString()) + "." + (sec < 10 ? "0" + sec.ToString() : sec.ToString()); } + + private void cbSearchOnlyForMarkedSongs_CheckedChanged(object sender, EventArgs e) + { + if (cbSearchOnlyForMarkedSongs.Checked) + { + cbDisconsiderTitlesWithLyrics.Enabled = false; + cbDisregardSongsWithNoLyric.Enabled = false; + cbDisregardSongWithLyricInTag.Enabled = false; + cbDisregardVariousArtist.Enabled = false; + cbMarkSongsWithNoLyrics.Enabled = false; + } + else + { + cbDisconsiderTitlesWithLyrics.Enabled = true; + cbDisregardSongsWithNoLyric.Enabled = true; + cbDisregardSongWithLyricInTag.Enabled = true; + cbDisregardVariousArtist.Enabled = true; + cbMarkSongsWithNoLyrics.Enabled = true; + } + } } } \ No newline at end of file Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyricsSetup_LyricsLibrary.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyricsSetup_LyricsLibrary.Designer.cs 2007-03-06 15:07:16 UTC (rev 162) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyricsSetup_LyricsLibrary.Designer.cs 2007-03-07 16:03:32 UTC (rev 163) @@ -20,6 +20,8 @@ this.btDelete = new System.Windows.Forms.Button(); this.btAdd = new System.Windows.Forms.Button(); this.gbLibrary = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.comboDatabase = new MediaPortal.UserInterface.Controls.MPComboBox(); + this.lbDatabase = new MediaPortal.UserInterface.Controls.MPLabel(); this.lbTestSecondsLeft = new System.Windows.Forms.Label(); this.btImportLRC = new MediaPortal.UserInterface.Controls.MPButton(); this.lbSongs2 = new MediaPortal.UserInterface.Controls.MPLabel(); @@ -30,6 +32,7 @@ this.lbArtists = new MediaPortal.UserInterface.Controls.MPLabel(); this.treeView = new System.Windows.Forms.TreeView(); this.gbResetDatabase = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.button1 = new System.Windows.Forms.Button(); this.btResetDatabase = new System.Windows.Forms.Button(); this.lbResetDatabase = new MediaPortal.UserInterface.Controls.MPLabel(); this.openFileDialog2 = new System.Windows.Forms.OpenFileDialog(); @@ -40,7 +43,7 @@ // btSave // this.btSave.Enabled = false; - this.btSave.Location = new System.Drawing.Point(218, 275); + this.btSave.Location = new System.Drawing.Point(218, 301); this.btSave.Name = "btSave"; this.btSave.Size = new System.Drawing.Size(75, 23); this.btSave.TabIndex = 6; @@ -51,7 +54,7 @@ // lbTitle // this.lbTitle.AutoSize = true; - this.lbTitle.Location = new System.Drawing.Point(215, 40); + this.lbTitle.Location = new System.Drawing.Point(215, 66); this.lbTitle.MaximumSize = new System.Drawing.Size(275, 13); this.lbTitle.MinimumSize = new System.Drawing.Size(275, 13); this.lbTitle.Name = "lbTitle"; @@ -68,7 +71,7 @@ // // btDelete // - this.btDelete.Location = new System.Drawing.Point(95, 275); + this.btDelete.Location = new System.Drawing.Point(95, 301); this.btDelete.Name = "btDelete"; this.btDelete.Size = new System.Drawing.Size(75, 23); this.btDelete.TabIndex = 3; @@ -78,7 +81,7 @@ // // btAdd // - this.btAdd.Location = new System.Drawing.Point(14, 275); + this.btAdd.Location = new System.Drawing.Point(14, 301); this.btAdd.Name = "btAdd"; this.btAdd.Size = new System.Drawing.Size(75, 23); this.btAdd.TabIndex = 2; @@ -88,6 +91,8 @@ // // gbLibrary // + this.gbLibrary.Controls.Add(this.comboDatabase); + this.gbLibrary.Controls.Add(this.lbDatabase); this.gbLibrary.Controls.Add(this.lbTestSecondsLeft); this.gbLibrary.Controls.Add(this.btImportLRC); this.gbLibrary.Controls.Add(this.lbSongs2); @@ -104,15 +109,37 @@ this.gbLibrary.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.gbLibrary.Location = new System.Drawing.Point(3, 3); this.gbLibrary.Name = "gbLibrary"; - this.gbLibrary.Size = new System.Drawing.Size(515, 336); + this.gbLibrary.Size = new System.Drawing.Size(515, 362); this.gbLibrary.TabIndex = 8; this.gbLibrary.TabStop = false; this.gbLibrary.Text = "Editor"; // + // comboDatabase + // + this.comboDatabase.BorderColor = System.Drawing.Color.Empty; + this.comboDatabase.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboDatabase.FormattingEnabled = true; + this.comboDatabase.Items.AddRange(new object[] { + "Lyrics database", + "LyricsToFetct database"}); + this.comboDatabase.Location = new System.Drawing.Point(85, 15); + this.comboDatabase.Name = "comboDatabase"; + this.comboDatabase.Size = new System.Drawing.Size(144, 21); + this.comboDatabase.TabIndex = 27; + this.comboDatabase.SelectedIndexChanged += new System.EventHandler(this.comboDatabase_SelectedIndexChanged); + // + // lbDatabase + // + this.lbDatabase.Location = new System.Drawing.Point(11, 18); + this.lbDatabase.Name = "lbDatabase"; + this.lbDatabase.Size = new System.Drawing.Size(60, 26); + this.lbDatabase.TabIndex = 26; + this.lbDatabase.Text = "Database:"; + // // lbTestSecondsLeft // this.lbTestSecondsLeft.AutoSize = true; - this.lbTestSecondsLeft.Location = new System.Drawing.Point(215, 309); + this.lbTestSecondsLeft.Location = new System.Drawing.Point(215, 335); this.lbTestSecondsLeft.Name = "lbTestSecondsLeft"; this.lbTestSecondsLeft.Size = new System.Drawing.Size(93, 13); this.lbTestSecondsLeft.TabIndex = 25; @@ -121,7 +148,7 @@ // // btImportLRC // - this.btImportLRC.Location = new System.Drawing.Point(95, 304); + this.btImportLRC.Location = new System.Drawing.Point(95, 330); this.btImportLRC.Name = "btImportLRC"; this.btImportLRC.Size = new System.Drawing.Size(75, 23); this.btImportLRC.TabIndex = 24; @@ -131,7 +158,7 @@ // // lbSongs2 // - this.lbSongs2.Location = new System.Drawing.Point(92, 33); + this.lbSongs2.Location = new System.Drawing.Point(82, 59); this.lbSongs2.Name = "lbSongs2"; this.lbSongs2.Size = new System.Drawing.Size(65, 15); this.lbSongs2.TabIndex = 23; @@ -142,7 +169,7 @@ this.tbLyrics.AllowDrop = true; this.tbLyrics.BorderColor = System.Drawing.Color.Empty; this.tbLyrics.Enabled = false; - this.tbLyrics.Location = new System.Drawing.Point(218, 55); + this.tbLyrics.Location = new System.Drawing.Point(218, 81); this.tbLyrics.Multiline = true; this.tbLyrics.Name = "tbLyrics"; this.tbLyrics.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; @@ -152,7 +179,7 @@ // // lbSongs // - this.lbSongs.Location = new System.Drawing.Point(11, 33); + this.lbSongs.Location = new System.Drawing.Point(11, 59); this.lbSongs.Name = "lbSongs"; this.lbSongs.Size = new System.Drawing.Size(60, 15); this.lbSongs.TabIndex = 22; @@ -160,7 +187,7 @@ // // btImportSingle // - this.btImportSingle.Location = new System.Drawing.Point(14, 304); + this.btImportSingle.Location = new System.Drawing.Point(14, 330); this.btImportSingle.Name = "btImportSingle"; this.btImportSingle.Size = new System.Drawing.Size(75, 23); this.btImportSingle.TabIndex = 4; @@ -170,7 +197,7 @@ // // lbArtists2 // - this.lbArtists2.Location = new System.Drawing.Point(92, 18); + this.lbArtists2.Location = new System.Drawing.Point(82, 44); this.lbArtists2.Name = "lbArtists2"; this.lbArtists2.Size = new System.Drawing.Size(65, 15); this.lbArtists2.TabIndex = 21; @@ -178,7 +205,7 @@ // // lbArtists // - this.lbArtists.Location = new System.Drawing.Point(11, 18); + this.lbArtists.Location = new System.Drawing.Point(11, 44); this.lbArtists.Name = "lbArtists"; this.lbArtists.Size = new System.Drawing.Size(60, 15); this.lbArtists.TabIndex = 20; @@ -186,7 +213,7 @@ // // treeView // - this.treeView.Location = new System.Drawing.Point(14, 55); + this.treeView.Location = new System.Drawing.Point(14, 81); this.treeView.Name = "treeView"; this.treeView.Size = new System.Drawing.Size(200, 213); this.treeView.TabIndex = 1; @@ -194,33 +221,45 @@ // // gbResetDatabase // + this.gbResetDatabase.Controls.Add(this.button1); this.gbResetDatabase.Controls.Add(this.btResetDatabase); this.gbResetDatabase.Controls.Add(this.lbResetDatabase); this.gbResetDatabase.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.gbResetDatabase.Location = new System.Drawing.Point(3, 345); + this.gbResetDatabase.Location = new System.Drawing.Point(3, 371); this.gbResetDatabase.Name = "gbResetDatabase"; - this.gbResetDatabase.Size = new System.Drawing.Size(515, 68); + this.gbResetDatabase.Size = new System.Drawing.Size(515, 76); this.gbResetDatabase.TabIndex = 11; this.gbResetDatabase.TabStop = false; this.gbResetDatabase.Text = "Reset database"; // + // button1 + // + this.button1.Location = new System.Drawing.Point(309, 45); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(181, 23); + this.button1.TabIndex = 11; + this.button1.Text = "Reset LyricsToFetch database"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // // btResetDatabase // - this.btResetDatabase.Location = new System.Drawing.Point(387, 32); + this.btResetDatabase.Location = new System.Drawing.Point(309, 16); this.btResetDatabase.Name = "btResetDatabase"; - this.btResetDatabase.Size = new System.Drawing.Size(114, 23); - this.btResetDatabase.TabIndex = 7; - this.btResetDatabase.Text = "&Reset database"; + this.btResetDatabase.Size = new System.Drawing.Size(181, 23); + this.btResetDatabase.TabIndex = 10; + this.btResetDatabase.Text = "Reset Lyrics database"; this.btResetDatabase.UseVisualStyleBackColor = true; this.btResetDatabase.Click += new System.EventHandler(this.btResetDatabase_Click); // // lbResetDatabase // - this.lbResetDatabase.Location = new System.Drawing.Point(11, 23); + this.lbResetDatabase.Location = new System.Drawing.Point(11, 22); this.lbResetDatabase.Name = "lbResetDatabase"; - this.lbResetDatabase.Size = new System.Drawing.Size(370, 32); + this.lbResetDatabase.Size = new System.Drawing.Size(282, 41); this.lbResetDatabase.TabIndex = 9; - this.lbResetDatabase.Text = "Reset the lyrics database.\r\nNOTICE: all lyrics in database will be deleted."; + this.lbResetDatabase.Text = "Reset the \"Lyrics\" and/or \"LyricsToFetch\" database.\r\n\r\nAll data in each database" + + " that is reset is lost for ever"; // // openFileDialog2 // @@ -252,7 +291,6 @@ private MediaPortal.UserInterface.Controls.MPTextBox tbLyrics; private System.Windows.Forms.TreeView treeView; private MediaPortal.UserInterface.Controls.MPGroupBox gbResetDatabase; - private MediaPortal.UserInterface.Controls.MPLabel lbResetDatabase; private MediaPortal.UserInterface.Controls.MPLabel lbSongs; private MediaPortal.UserInterface.Controls.MPLabel lbArtists; internal MediaPortal.UserInterface.Controls.MPLabel lbArtists2; @@ -261,9 +299,13 @@ internal System.Windows.Forms.Button btDelete; internal System.Windows.Forms.Button btAdd; internal MediaPortal.UserInterface.Controls.MPButton btImportSingle; - internal System.Windows.Forms.Button btResetDatabase; internal MediaPortal.UserInterface.Controls.MPButton btImportLRC; private System.Windows.Forms.OpenFileDialog openFileDialog2; private System.Windows.Forms.Label lbTestSecondsLeft; + private MediaPortal.UserInterface.Controls.MPComboBox comboDatabase; + private MediaPortal.UserInterface.Controls.MPLabel lbDatabase; + internal System.Windows.Forms.Button button1; + internal System.Windows.Forms.Button btResetDatabase; + private MediaPortal.UserInterface.Controls.MPLabel lbResetDatabase; } } Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyricsSetup_LyricsLibrary.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyricsSetup_LyricsLibrary.cs 2007-03-06 15:07:16 UTC (rev 162) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyricsSetup_LyricsLibrary.cs 2007-03-07 16:03:32 UTC (rev 163) @@ -42,11 +42,14 @@ string nextLineToShow; int lineCounter; const int SHIFT_WHEN_HIT = 15; + string currentDatabase = ""; public MyLyricsSetup_LyricsLibrary(Form form) { this.m_Form = form; InitializeComponent(); + currentDatabase = "Lyrics.xml"; + comboDatabase.SelectedIndex = 0; updateLyricsTree(); } @@ -57,6 +60,10 @@ { MyLyricsUtil.createLyricDatabase(); } + if (!System.IO.File.Exists("LyricsToFetch.xml")) + { + MyLyricsUtil.createLyricToFetchDatabase(); + } // catch error when treeView suddenly is disposed due to application shutdown try @@ -65,7 +72,7 @@ m_NoOfArtists = 0; m_NoOfTitles = 0; - XmlTextReader tr = new XmlTextReader("Lyrics.xml"); + XmlTextReader tr = new XmlTextReader(currentDatabase); string currentArtist = ""; string currentTitle = ""; @@ -84,7 +91,6 @@ if (tr.AttributeCount == 1) { currentTitle = tr.GetAttribute(0); - string currentLyrics = tr.Value; AddSong(currentArtist, currentTitle); } break; @@ -105,7 +111,7 @@ private ArrayList getTitlesByArtist(string artist) { - XmlTextReader tr = new XmlTextReader("Lyrics.xml"); + XmlTextReader tr = new XmlTextReader(currentDatabase); ArrayList titles = new ArrayList(); while (tr.Read()) @@ -176,7 +182,7 @@ /// <param name="lyric"></param> private void AddSong(string artist, string title, string lyric) { - using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings("Lyrics.xml", false)) + using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(currentDatabase, false)) { xmlwriter.SetValue(artist, title, lyric); } @@ -201,7 +207,7 @@ --m_NoOfTitles; // remove title from xml-file - using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings("Lyrics.xml", false)) + using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(currentDatabase, false)) { xmlwriter.RemoveEntry(artist, title); } @@ -228,7 +234,7 @@ m_CurrentTitle = LyricUtil.capatalizeString(title); string lyricText = ""; - using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("Lyrics.xml", false)) + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(currentDatabase, false)) { lyricText = xmlreader.GetValueAsString(m_CurrentArtist, m_CurrentTitle, ""); } @@ -268,7 +274,7 @@ m_CurrentTitle = LyricUtil.capatalizeString(title); string lyricText = ""; - using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("Lyrics.xml", false)) + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(currentDatabase, false)) { lyricText = xmlreader.GetValueAsString(m_CurrentArtist, m_CurrentTitle, ""); } @@ -321,7 +327,7 @@ private void btSave_Click(object sender, EventArgs e) { - using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings("Lyrics.xml", false)) + using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(currentDatabase, false)) { xmlwriter.SetValue(LyricUtil.capatalizeString(m_CurrentArtist), LyricUtil.capatalizeString(m_CurrentTitle), tbLyrics.Text); btSave.Enabled = false; @@ -469,15 +475,6 @@ } } - private void btResetDatabase_Click(object sender, EventArgs e) - { - if (MessageBox.Show(this, "Are you sure the lyrics database should be deleted?", "Delete lyrics database", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) - { - MyLyricsUtil.createLyricDatabase(); - updateLyricsTree(); - updateInfo(); - } - } private void btUpgradeDatabase_Click(object sender, EventArgs e) { @@ -624,5 +621,44 @@ timer.Dispose(); } } + + private void comboDatabase_SelectedIndexChanged(object sender, EventArgs e) + { + if (comboDatabase.SelectedIndex == 0) + { + currentDatabase = "Lyrics.xml"; + updateLyricsTree(); + } + else + { + currentDatabase = "LyricsToFetch.xml"; + updateLyricsTree(); + } + } + + private void btResetDatabase_Click(object sender, EventArgs e) + { + if (MessageBox.Show(this, "Are you sure the Lyrics database should be deleted?", "Delete Lyrics database", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) + { + MyLyricsUtil.createLyricDatabase(); + currentDatabase = "Lyrics.xml"; + comboDatabase.SelectedIndex = 0; + updateLyricsTree(); + updateInfo(); + } + } + + + private void button1_Click(object sender, EventArgs e) + { + if (MessageBox.Show(this, "Are you sure the LyricsToFetch database should be deleted?", "Delete LyricsToFetch database", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) + { + MyLyricsUtil.createLyricToFetchDatabase(); + currentDatabase = "LyricsToFetch.xml"; + comboDatabase.SelectedIndex = 1; + updateLyricsTree(); + updateInfo(); + } + } } } Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyricsUtil.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyricsUtil.cs 2007-03-06 15:07:16 UTC (rev 162) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyricsUtil.cs 2007-03-07 16:03:32 UTC (rev 163) @@ -42,6 +42,24 @@ return LYRIC_FOUND; } + internal static int isTrackInLyricsMarkedDatabase(string artist, string title) + { + string lyricText = ""; + try + { + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("LyricsToFetch.xml", false)) + { + string capatalizedArtist = LyricUtil.capatalizeString(artist); + string capatalizedTitle = LyricUtil.capatalizeString(title); + lyricText = xmlreader.GetValue(capatalizedArtist, capatalizedTitle); + } + } + catch{;} + if (lyricText.Equals(MyLyricsUtil.MARK)) + return LYRIC_MARKED; + return LYRIC_NOT_FOUND; + } + internal static void createLyricDatabase() { XmlTextWriter xmlWriter = new XmlTextWriter("Lyrics.xml", System.Text.Encoding.UTF8); @@ -51,6 +69,15 @@ xmlWriter.Close(); } + internal static void createLyricToFetchDatabase() + { + XmlTextWriter xmlWriter = new XmlTextWriter("LyricsToFetch.xml", System.Text.Encoding.UTF8); + xmlWriter.Formatting = Formatting.Indented; + xmlWriter.WriteProcessingInstruction("xml", "version='1.0' encoding='UTF-8'"); + xmlWriter.WriteStartElement("Lyrics"); + xmlWriter.Close(); + } + public static string LookUpLyricInDatabase(string artist, string title) { string lyricText; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2008-03-06 19:49:08
|
Revision: 1432 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1432&view=rev Author: saamand Date: 2008-03-06 11:41:52 -0800 (Thu, 06 Mar 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MyLyrics/My Lyrics/MediaPortalUtil.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/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/Properties/AssemblyInfo.cs Modified: trunk/plugins/MyLyrics/My Lyrics/MediaPortalUtil.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MediaPortalUtil.cs 2008-03-06 14:49:18 UTC (rev 1431) +++ trunk/plugins/MyLyrics/My Lyrics/MediaPortalUtil.cs 2008-03-06 19:41:52 UTC (rev 1432) @@ -28,7 +28,13 @@ { foreach (string s in strippedPrefixStringArray) { - artist = artist.Replace(s, ""); + int index = artist.IndexOf(s); + if (index != -1) + { + string prefix = artist.Substring(index + 2); + artist = prefix + " " + artist.Replace(s, ""); + break; + } } return artist; } Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs 2008-03-06 14:49:18 UTC (rev 1431) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.Designer.cs 2008-03-06 19:41:52 UTC (rev 1432) @@ -77,7 +77,7 @@ this.lbInfo1.Name = "lbInfo1"; this.lbInfo1.Size = new System.Drawing.Size(225, 17); this.lbInfo1.TabIndex = 3; - this.lbInfo1.Text = "My Lyrics plugin, version 1.00"; + this.lbInfo1.Text = "MyLyrics plugin, version 1.00"; // // label2 // Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.resx =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.resx 2008-03-06 14:49:18 UTC (rev 1431) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/About.resx 2008-03-06 19:41:52 UTC (rev 1432) @@ -129,6 +129,6 @@ <value>This is where you can browsw your music database and manually select the songs taht you would like to search the Internet for. When a lyric is found it is added to the lyrics database. If not it is added to the marked database.</value> </data> <data name="label8.Text" xml:space="preserve"> - <value>Here you can set up the plugin as you prefer. E.g. you can choose the name to be shown for the plugin inside MediaPortal or if a found lyric should be stored in the tag of the music file. You can also tweak the settings regarding the "Find Lyrics" dialog accessable from the "Lyrics database" tab, and choose which sites you want to query in your searches.</value> + <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-03-06 14:49:18 UTC (rev 1431) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/FindLyric.Designer.cs 2008-03-06 19:41:52 UTC (rev 1432) @@ -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.cbActionext = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.gbSearchInfo.SuspendLayout(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); @@ -104,7 +105,7 @@ // // btFind // - this.btFind.Location = new System.Drawing.Point(281, 67); + this.btFind.Location = new System.Drawing.Point(283, 67); this.btFind.Name = "btFind"; this.btFind.Size = new System.Drawing.Size(65, 23); this.btFind.TabIndex = 3; @@ -175,6 +176,7 @@ // // gbLyricSites // + this.gbLyricSites.Controls.Add(this.cbActionext); this.gbLyricSites.Controls.Add(this.btCancel); this.gbLyricSites.Controls.Add(this.btFind); this.gbLyricSites.Controls.Add(this.cbHotLyrics); @@ -207,7 +209,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(146, 21); + this.cbHotLyrics.Location = new System.Drawing.Point(131, 21); this.cbHotLyrics.Name = "cbHotLyrics"; this.cbHotLyrics.Size = new System.Drawing.Size(71, 17); this.cbHotLyrics.TabIndex = 14; @@ -220,7 +222,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(146, 43); + this.cbSeekLyrics.Location = new System.Drawing.Point(131, 66); this.cbSeekLyrics.Name = "cbSeekLyrics"; this.cbSeekLyrics.Size = new System.Drawing.Size(79, 17); this.cbSeekLyrics.TabIndex = 15; @@ -259,7 +261,7 @@ 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(146, 66); + 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; @@ -281,9 +283,9 @@ // // btClose // - this.btClose.Location = new System.Drawing.Point(354, 549); + this.btClose.Location = new System.Drawing.Point(364, 549); this.btClose.Name = "btClose"; - this.btClose.Size = new System.Drawing.Size(75, 23); + this.btClose.Size = new System.Drawing.Size(65, 23); this.btClose.TabIndex = 30; this.btClose.Text = "Close"; this.btClose.UseVisualStyleBackColor = true; @@ -292,16 +294,29 @@ // btUpdate // this.btUpdate.Enabled = false; - this.btUpdate.Location = new System.Drawing.Point(273, 549); + this.btUpdate.Location = new System.Drawing.Point(295, 549); this.btUpdate.Name = "btUpdate"; - this.btUpdate.Size = new System.Drawing.Size(75, 23); + this.btUpdate.Size = new System.Drawing.Size(65, 23); this.btUpdate.TabIndex = 11; this.btUpdate.Text = "Update"; this.btUpdate.UseVisualStyleBackColor = true; this.btUpdate.Click += new System.EventHandler(this.btUpdate_Click); // - // MyLyricsSetup_SearchTitleDialog + // 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); @@ -316,7 +331,7 @@ this.MaximumSize = new System.Drawing.Size(464, 611); this.MinimizeBox = false; this.MinimumSize = new System.Drawing.Size(464, 611); - this.Name = "MyLyricsSetup_SearchTitleDialog"; + this.Name = "FindLyric"; this.ShowIcon = false; this.Text = "Fetch lyric dialog"; this.gbSearchInfo.ResumeLayout(false); @@ -355,5 +370,6 @@ private System.Windows.Forms.Button btClose; private System.Windows.Forms.Button btUpdate; private System.Windows.Forms.Button btCancel; + internal MediaPortal.UserInterface.Controls.MPCheckBox cbActionext; } } \ 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-03-06 14:49:18 UTC (rev 1431) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/FindLyric.cs 2008-03-06 19:41:52 UTC (rev 1432) @@ -81,6 +81,7 @@ { 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; cbSeekLyrics.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useSeekLyrics", "True")).ToString().Equals("True") ? true : false; @@ -153,6 +154,10 @@ { sitesToSearch.Add("EvilLabs"); } + if (cbActionext.Checked) + { + sitesToSearch.Add("Actionext"); + } 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-03-06 14:49:18 UTC (rev 1431) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MusicDatabaseBrowse.cs 2008-03-06 19:41:52 UTC (rev 1432) @@ -244,6 +244,8 @@ sitesToSearch.Add("LyricWiki"); if (((string)xmlreader.GetValueAsString("myLyrics", "useEvilLabs", "True")).ToString().Equals("True")) sitesToSearch.Add("EvilLabs"); + if (((string)xmlreader.GetValueAsString("myLyrics", "useActionext", "True")).ToString().Equals("True")) + sitesToSearch.Add("Actionext"); if (((string)xmlreader.GetValueAsString("myLyrics", "useLyrics007", "True")).ToString().Equals("True")) sitesToSearch.Add("HotLyrics"); 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-03-06 14:49:18 UTC (rev 1431) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.Designer.cs 2008-03-06 19:41:52 UTC (rev 1432) @@ -85,6 +85,7 @@ this.lbPluginName = new MediaPortal.UserInterface.Controls.MPLabel(); this.gbLyricSites = new MediaPortal.UserInterface.Controls.MPGroupBox(); this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.cbActionext = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.cbLyrics007 = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.cbLyricWiki = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.cbEvilLabs = new MediaPortal.UserInterface.Controls.MPCheckBox(); @@ -725,19 +726,34 @@ // // groupBox2 // + this.groupBox2.Controls.Add(this.cbActionext); this.groupBox2.Controls.Add(this.cbLyrics007); this.groupBox2.Controls.Add(this.cbLyricWiki); this.groupBox2.Controls.Add(this.cbEvilLabs); 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(272, 72); + this.groupBox2.Location = new System.Drawing.Point(229, 72); this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(258, 100); + this.groupBox2.Size = new System.Drawing.Size(301, 100); this.groupBox2.TabIndex = 28; this.groupBox2.TabStop = false; this.groupBox2.Text = "User select mode"; // + // 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, 49); + this.cbActionext.Name = "cbActionext"; + this.cbActionext.Size = new System.Drawing.Size(68, 17); + this.cbActionext.TabIndex = 8; + this.cbActionext.Text = "Actionext"; + this.cbActionext.UseVisualStyleBackColor = true; + this.cbActionext.Leave += new System.EventHandler(this.WriteMediaPortalXML); + // // cbLyrics007 // this.cbLyrics007.AutoSize = true; @@ -772,7 +788,7 @@ 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(145, 71); + this.cbEvilLabs.Location = new System.Drawing.Point(219, 26); this.cbEvilLabs.Name = "cbEvilLabs"; this.cbEvilLabs.Size = new System.Drawing.Size(67, 17); this.cbEvilLabs.TabIndex = 3; @@ -800,7 +816,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(145, 26); + this.cbHotLyrics.Location = new System.Drawing.Point(131, 26); this.cbHotLyrics.Name = "cbHotLyrics"; this.cbHotLyrics.Size = new System.Drawing.Size(71, 17); this.cbHotLyrics.TabIndex = 7; @@ -814,7 +830,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(145, 48); + this.cbSeekLyrics.Location = new System.Drawing.Point(131, 71); this.cbSeekLyrics.Name = "cbSeekLyrics"; this.cbSeekLyrics.Size = new System.Drawing.Size(79, 17); this.cbSeekLyrics.TabIndex = 6; @@ -829,7 +845,7 @@ this.groupBox1.Controls.Add(this.lbSpeed); this.groupBox1.Location = new System.Drawing.Point(6, 72); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(260, 100); + this.groupBox1.Size = new System.Drawing.Size(217, 100); this.groupBox1.TabIndex = 27; this.groupBox1.TabStop = false; this.groupBox1.Text = "Default select mode"; @@ -838,7 +854,7 @@ // 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(187, 25); + this.mpLabel2.Location = new System.Drawing.Point(151, 25); this.mpLabel2.Name = "mpLabel2"; this.mpLabel2.Size = new System.Drawing.Size(43, 13); this.mpLabel2.TabIndex = 26; @@ -851,7 +867,7 @@ this.trackBar.Location = new System.Drawing.Point(36, 42); this.trackBar.Maximum = 3; this.trackBar.Name = "trackBar"; - this.trackBar.Size = new System.Drawing.Size(185, 42); + this.trackBar.Size = new System.Drawing.Size(158, 42); this.trackBar.TabIndex = 25; this.trackBar.TickStyle = System.Windows.Forms.TickStyle.Both; this.trackBar.Value = 2; @@ -1048,5 +1064,6 @@ private System.Windows.Forms.TabPage tabPageAbout; private MediaPortal.UserInterface.Controls.MPGroupBox gbTag; internal MediaPortal.UserInterface.Controls.MPCheckBox cbMusicTag; + internal MediaPortal.UserInterface.Controls.MPCheckBox cbActionext; } } \ 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-03-06 14:49:18 UTC (rev 1431) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.cs 2008-03-06 19:41:52 UTC (rev 1432) @@ -175,6 +175,7 @@ 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; cbSeekLyrics.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useSeekLyrics", "True")).ToString().Equals("True") ? true : false; @@ -432,6 +433,8 @@ sitesToSearch.Add("LyricWiki"); if (cbEvilLabs.Checked) sitesToSearch.Add("EvilLabs"); + if (cbActionext.Checked) + sitesToSearch.Add("Actionext"); if (cbLyrics007.Checked) sitesToSearch.Add("Lyrics007"); if (cbLyricsOnDemand.Checked) @@ -928,6 +931,7 @@ cbHotLyrics.Checked = false; cbSeekLyrics.Checked = false; cbEvilLabs.Checked = false; + cbActionext.Checked = false; } else if (trackBar.Value == 1) { @@ -937,6 +941,7 @@ cbHotLyrics.Checked = false; cbSeekLyrics.Checked = false; cbEvilLabs.Checked = false; + cbActionext.Checked = false; } else if (trackBar.Value == 2) { @@ -944,6 +949,7 @@ cbLyrics007.Checked = true; cbLyricWiki.Checked = true; cbHotLyrics.Checked = true; + cbActionext.Checked = true; cbSeekLyrics.Checked = false; cbEvilLabs.Checked = false; } @@ -955,6 +961,7 @@ cbHotLyrics.Checked = true; cbSeekLyrics.Checked = true; cbEvilLabs.Checked = true; + cbActionext.Checked = true; } WriteMediaPortalXML(null, null); @@ -986,6 +993,7 @@ cbHotLyrics.Enabled = false; cbSeekLyrics.Enabled = false; cbEvilLabs.Enabled = false; + cbActionext.Enabled = false; trackBar_Scroll(null, null); } else @@ -997,6 +1005,7 @@ cbHotLyrics.Enabled = true; cbSeekLyrics.Enabled = true; cbEvilLabs.Enabled = true; + cbActionext.Enabled = true; } } @@ -1010,6 +1019,7 @@ xmlwriter.SetValue("myLyrics", "pluginsName", tbPluginName.Text); xmlwriter.SetValue("myLyrics", "useLyricWiki", cbLyricWiki.Checked.ToString()); xmlwriter.SetValue("myLyrics", "useEvilLabs", cbEvilLabs.Checked.ToString()); + xmlwriter.SetValue("myLyrics", "useActionext", cbActionext.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-03-06 14:49:18 UTC (rev 1431) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2008-03-06 19:41:52 UTC (rev 1432) @@ -336,7 +336,7 @@ resetGUI(selectedScreen); - bool useLyricWiki, useEvilLabs, useLyrics007, useLyricsOnDemand, useSeekLyrics, useHotLyrics; + bool useLyricWiki, useEvilLabs, useLyrics007, useLyricsOnDemand, useSeekLyrics, useHotLyrics, useActionext; using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MediaPortal.xml")) { @@ -347,6 +347,7 @@ useLyricsOnDemand = ((string)xmlreader.GetValueAsString("myLyrics", "useLyricsOnDemand", "True")).ToString().Equals("True") ? true : false; 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; m_automaticWriteToMusicTag = xmlreader.GetValue("myLyrics", "automaticWriteToMusicTag").Equals("yes"); @@ -366,6 +367,10 @@ { sitesToSearch.Add("EvilLabs"); } + if (useActionext && Setup.IsMember("Actionext")) + { + sitesToSearch.Add("Actionext"); + } if (useLyrics007 && Setup.IsMember("Lyrics007")) { sitesToSearch.Add("Lyrics007"); Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj 2008-03-06 14:49:18 UTC (rev 1431) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics.csproj 2008-03-06 19:41:52 UTC (rev 1432) @@ -5,13 +5,12 @@ <ProductVersion>8.0.50727</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> <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent> - <StartupObject> - </StartupObject> + <StartupObject>MyLyrics.MyLyricsSetup_test</StartupObject> <SignAssembly>false</SignAssembly> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> @@ -164,9 +163,6 @@ </EmbeddedResource> </ItemGroup> <ItemGroup> - <Content Include="Changelog.txt" /> - </ItemGroup> - <ItemGroup> <ProjectReference Include="..\LyricsEngine\LyricsEngine.csproj"> <Project>{B0760CE8-086F-4301-9091-C9BE54F261FD}</Project> <Name>LyricsEngine</Name> Modified: trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs 2008-03-06 14:49:18 UTC (rev 1431) +++ trunk/plugins/MyLyrics/My Lyrics/Properties/AssemblyInfo.cs 2008-03-06 19:41:52 UTC (rev 1432) @@ -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("0.23")] -[assembly: AssemblyFileVersion("0.23")] +[assembly: AssemblyVersion("1.00")] +[assembly: AssemblyFileVersion("1.00")] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |