public void AddPoint(int index) { var previousPoint = Lyric.TimeLines.GetFirstProgressPointByIndex(index); var nextPoint = Lyric.TimeLines.GetLastProgressPointByIndex(index); var deltaTime = ((previousPoint.Value?.RelativeTime ?? 0) + (nextPoint.Value?.RelativeTime ?? (previousPoint.Value?.RelativeTime ?? 0) + 500)) / 2; var point = new TimeLine(deltaTime); Lyric.TimeLines.Add(index, point); DrawableKaraokeThumbnail.UpdateView(); }
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); }