Exemplo n.º 1
0
        public bool Import(List <string> filenames)
        {
            Files = new List <string>();
            Files.AddRange(filenames);
            UtaFormat format = UtaFormat.None;

            //Determine the format of the project
            if (Files[0].Remove(0, Files[0].Length - 5) == ".vsqx")
            {
                string readbuf = File.ReadAllText(Files[0]);
                if (readbuf.Contains("vsq3 xmlns=\"http://www.yamaha.co.jp/vocaloid/schema/vsq3/\""))
                {
                    format = UtaFormat.Vsq3;
                }
                else if (readbuf.Contains("vsq4 xmlns=\"http://www.yamaha.co.jp/vocaloid/schema/vsq4/\""))
                {
                    format = UtaFormat.Vsq4;
                }
            }
            else if (Files[0].Remove(0, Files[0].Length - 4) == ".ust")
            {
                format = UtaFormat.Ust;
            }
            else if (Files[0].Remove(0, Files[0].Length - 4) == ".ccs")
            {
                format = UtaFormat.Ccs;
            }
            //else if (filename.Remove(0, filename.Length - 4) == ".vsq")
            //{
            //    format = UtaFormat.vsq2;
            //}
            else
            {
                return(false);
            }

            switch (format)
            {
            case UtaFormat.Vsq2:
                break;

            case UtaFormat.Vsq3:
                return(ImportVsq3(Files));

            case UtaFormat.Vsq4:
                return(ImportVsq4(Files));

            case UtaFormat.Ust:
                return(ImportUst(Files));

            case UtaFormat.Ccs:
                return(ImportCcs(Files));
            }
            return(false);
        }
Exemplo n.º 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);
            }
        }