コード例 #1
0
ファイル: LrcEncoder.cs プロジェクト: littlebees/karaoke
 private LyricLine encodeLyric(Objects.Lyric lyric) =>
 new LyricLine
 {
     Text = lyric.Text,
     // Note : save to lyric will lost some tags with no value.
     TimeTags = convertTimeTag(lyric.Text, TimeTagsUtils.ToDictionary(lyric.TimeTags)).ToArray(),
 };
コード例 #2
0
 public DrawableEditableNotes(Objects.Lyric hitObject)
     : base(hitObject)
 {
     //add background
     AddInternal(new Box
     {
         RelativeSizeAxes = Axes.Both,
         Colour           = new Color4(0, 0, 0, 200),
         Depth            = 1
     });
 }
コード例 #3
0
        /// <summary>
        ///     translte list
        /// </summary>
        /// <param name="code"></param>
        /// <param name="translateListString"></param>
        /// <returns></returns>
        public async Task <List <Objects.Lyric> > Translate(TranslateCode code, List <Objects.Lyric> translateListString)
        {
            var listTranslate = new List <Objects.Lyric>();
            var result        = await romajiServerApi.Translate(code, translateListString.Select(x => x.Text).ToList());

            //convert each sentence
            foreach (var single in result)
            {
                var singleTranslate = new Objects.Lyric();

                //convert from Translatersult to lyruc
                for (var i = 0; i < single.Result.Count; i++)
                {
                    var character = single.Result[i];

                    //romaji
                    if (singleTranslate is IHasRomaji romajiLyric)
                    {
                        romajiLyric.Romaji.Add(i, new RomajiText
                        {
                            Text = character.Romaji
                        });
                    }

                    //means it is kanji
                    if (character.Type == 0)
                    {
                        if (singleTranslate is IHasFurigana furiganaLyric)
                        {
                            furiganaLyric.Furigana.Add(i, new FuriganaText
                            {
                                Text = character.Katakana
                            });
                        }
                    }
                }

                listTranslate.Add(singleTranslate);
            }

            return(listTranslate);
        }
コード例 #4
0
        public DrawableEditableKaraokeObject(Objects.Lyric hitObject)
            : base(hitObject)
        {
            DrawableKaraokeThumbnail = new DrawableKaraokeThumbnail(Lyric)
            {
                Position = new Vector2(0, -100),
                Width    = 300,
                Height   = 100
            };

            EditableLyricText = new EditableLyricContainer
            {
                AutoSizeAxes     = Axes.Y,
                RelativeSizeAxes = Axes.X,
            };


            EditableLyricText.Lyric           = hitObject;
            EditableLyricText.AddPointAction += AddPoint;
            AddInternal(EditableLyricText);
            AddInternal(DrawableKaraokeThumbnail);
        }
コード例 #5
0
 /// <summary>
 ///     translte list
 /// </summary>
 /// <param name="code"></param>
 /// <param name="translateListString"></param>
 /// <returns></returns>
 public async Task <Objects.Lyric> Translate(TranslateCode code, Objects.Lyric translateListString)
 {
     return((await Translate(code, new List <Objects.Lyric> {
         translateListString
     })).FirstOrDefault());
 }
コード例 #6
0
 public DrawableNotes(Objects.Lyric hitObject)
     : base(hitObject)
 {
 }
コード例 #7
0
 public DrawableKaraokeThumbnail(Objects.Lyric lyric)
 {
     Lyric = lyric;
     Add(ListEditableProgressPoint);
     UpdateView();
 }