예제 #1
0
        private async Task <bool> TransformLyrics(Data.UtaFormat toFormat)
        {
            var changeLyrics = new ChangeLyrics();

            switch (mainData.Lyric.TypeAnalysed)
            {
            case Lyric.LyricType.None:
                System.Windows.MessageBox.Show("The type of the lyrics is not detected, please select the correct type by yourself.", "Lyrics Transformation");
                changeLyrics.RadioButtonFrom1.IsChecked = true;
                break;

            case Lyric.LyricType.RomajiTandoku:
                changeLyrics.RadioButtonFrom1.IsChecked = true;
                break;

            case Lyric.LyricType.RomajiRenzoku:
                changeLyrics.RadioButtonFrom2.IsChecked = true;
                break;

            case Lyric.LyricType.KanaTandoku:
                changeLyrics.RadioButtonFrom3.IsChecked = true;
                break;

            case Lyric.LyricType.KanaRenzoku:
                changeLyrics.RadioButtonFrom4.IsChecked = true;
                break;

            default:
                break;
            }
            changeLyrics.RadioButtonTo3.IsChecked = true;
            switch (toFormat)
            {
            case Data.UtaFormat.Vsq4:
                changeLyrics.RadioButtonTo2.Visibility = Visibility.Hidden;
                changeLyrics.RadioButtonTo4.Visibility = Visibility.Hidden;
                changeLyrics.RadioButtonTo3.Margin     = changeLyrics.RadioButtonTo2.Margin;
                break;

            case Data.UtaFormat.Ccs:
                changeLyrics.RadioButtonTo1.Visibility = Visibility.Hidden;
                changeLyrics.RadioButtonTo2.Visibility = Visibility.Hidden;
                changeLyrics.RadioButtonTo4.Visibility = Visibility.Hidden;
                changeLyrics.RadioButtonTo3.Margin     = changeLyrics.RadioButtonTo1.Margin;
                break;

            default:
                break;
            }
            bool?dialogResult = changeLyrics.ShowDialog();

            if (dialogResult == true)
            {
                ShowProcessingScreen();
                await Task.Run(() =>
                {
                    exportingData.Lyric.Transform(changeLyrics.fromType, changeLyrics.ToType);
                });

                HideProcessingScreen();
                return(true);
            }
            else
            {
                return(false);
            }
        }
예제 #2
0
        bool Transformlyrics(UtaFormat toFormat)
        {
            ChangeLyrics changelyrics = new ChangeLyrics();

            switch (maindata.Lyric.AnalyzedType)
            {
            case Lyric.LyricType.None:
                MessageBox.Show("The type of the lyrics is not detected, please select the correct type by yourself.", "Lyrics Transformation");
                changelyrics.RdoRomaCV.IsChecked = true;
                break;

            case Lyric.LyricType.Romaji_Tandoku:
                changelyrics.RdoRomaCV.IsChecked = true;
                break;

            case Lyric.LyricType.Romaji_Renzoku:
                changelyrics.RdoRomaVCV.IsChecked = true;
                break;

            case Lyric.LyricType.Kana_Tandoku:
                changelyrics.RdoKanaCV.IsChecked = true;
                break;

            case Lyric.LyricType.Kana_Renzoku:
                changelyrics.RdoKanaVCV.IsChecked = true;
                break;

            default:
                break;
            }
            changelyrics.Rdo2KanaCV.IsChecked = true;
            switch (toFormat)
            {
            case UtaFormat.Vsq4:
                changelyrics.Rdo2RomaVCV.Visibility = Visibility.Hidden;
                changelyrics.Rdo2KanaVCV.Visibility = Visibility.Hidden;
                changelyrics.Rdo2KanaCV.Margin      = changelyrics.Rdo2RomaVCV.Margin;
                break;

            case UtaFormat.Ccs:
                changelyrics.Rdo2RomaCV.Visibility  = Visibility.Hidden;
                changelyrics.Rdo2RomaVCV.Visibility = Visibility.Hidden;
                changelyrics.Rdo2KanaVCV.Visibility = Visibility.Hidden;
                changelyrics.Rdo2KanaCV.Margin      = changelyrics.Rdo2RomaCV.Margin;
                break;

            default:
                break;
            }
            var dialogResult = changelyrics.ShowDialog();

            if (dialogResult == true)
            {
                exportingdata.Lyric.Transform(changelyrics.fromType, changelyrics.ToType);
                return(true);
            }
            else
            {
                return(false);
            }
        }