private void btSave_Click(object sender, EventArgs e)
        {
            var capArtist = LyricUtil.CapatalizeString(_mCurrentArtist);
            var capTitle  = LyricUtil.CapatalizeString(_mCurrentTitle);

            var lyrics = LyricUtil.FixLyrics(tbLyrics.Text);

            CurrentLyricsDatabase[DatabaseUtil.CorrectKeyFormat(capArtist, capTitle)].Lyrics = lyrics;
            DatabaseUtil.SerializeDB(CurrentLyricsDatabase);

            if (SettingManager.GetParamAsBool(SettingManager.AutomaticWriteToMusicTag, true))
            {
                TagReaderUtil.WriteLyrics(capArtist, capTitle, lyrics);
            }

            if (CurrentLyricsDatabase.Equals(MyLyricsUtils.LyricsMarkedDB))
            {
                if (SettingManager.GetParamAsBool(SettingManager.MoveLyricFromMarkedDatabase, true))
                {
                    MoveLyricToOtherDatabase();
                }
            }

            var lrc = new SimpleLRC(capArtist, capTitle, lyrics);

            if (lrc.IsValid && _parentMyLyricsSetup.cbUploadLrcAutomatically.Checked)
            {
                LrcFinder.SaveLrcWithGuid(lyrics, _parentMyLyricsSetup.MGuid);
            }

            btSave.Enabled = false;
            treeView.Focus();
        }
        private void btSearchSingle_Click(object sender, EventArgs e)
        {
            string temp   = "";
            string artist = "";
            string title  = "";

            if (treeView.SelectedNode != null)
            {
                temp = treeView.SelectedNode.Text;

                if (treeView.SelectedNode.Parent != null)
                {
                    artist = treeView.SelectedNode.Parent.Text;
                    title  = temp;
                }
                else
                {
                    artist = temp;
                }
            }


            MyLyricsSetup_SearchTitleDialog std = new MyLyricsSetup_SearchTitleDialog(this, artist, title, CurrentDB.Equals(MyLyricsSettings.LyricsMarkedDB));
        }
Example #3
0
 public static LyricsDatabase GetOtherLyricsDatabase(LyricsDatabase currentDatabase)
 {
     return(currentDatabase.Equals(MyLyricsUtils.LyricsDB) ? MyLyricsUtils.LyricsMarkedDB : MyLyricsUtils.LyricsDB);
 }