diff --git a/OpenUtau.Core/Util/Preferences.cs b/OpenUtau.Core/Util/Preferences.cs index f9b8d4e4e..98a30197e 100644 --- a/OpenUtau.Core/Util/Preferences.cs +++ b/OpenUtau.Core/Util/Preferences.cs @@ -160,6 +160,7 @@ public class SerializablePreferences { public bool DiffSingerTensorCache = true; public bool DiffSingerLangCodeHide = false; public bool SkipRenderingMutedTracks = false; + public bool UseSolidPlaybackLine = false; public string Language = string.Empty; public string? SortingOrder = null; public List RecentFiles = new List(); diff --git a/OpenUtau/Controls/PianoRoll.axaml b/OpenUtau/Controls/PianoRoll.axaml index 0015e266d..ebd22e2ff 100644 --- a/OpenUtau/Controls/PianoRoll.axaml +++ b/OpenUtau/Controls/PianoRoll.axaml @@ -178,6 +178,13 @@ Canvas.Left="{Binding NotesViewModel.PlayPosHighlightX, Mode=OneWay}" Canvas.Top="0" ZIndex="-10" Fill="{DynamicResource NeutralAccentBrushSemi2}"/> + Do nothing Move cursor and view position back to where you started playing Move only cursor back to where you started playing + Solid playback line Test Rendering Default renderer (for classic voicebanks) diff --git a/OpenUtau/ViewModels/NotesViewModel.cs b/OpenUtau/ViewModels/NotesViewModel.cs index 551efb319..8aef981a6 100644 --- a/OpenUtau/ViewModels/NotesViewModel.cs +++ b/OpenUtau/ViewModels/NotesViewModel.cs @@ -51,6 +51,7 @@ public class NotesViewModel : ViewModelBase, ICmdSubscriber { [Reactive] public double PlayPosHighlightX { get; set; } [Reactive] public double PlayPosHighlightWidth { get; set; } [Reactive] public bool PlayPosWaitingRendering { get; set; } + [Reactive] public bool UseSolidPlaybackLine { get; set; } [Reactive] public bool CursorTool { get; set; } [Reactive] public bool PenTool { get; set; } [Reactive] public bool PenPlusTool { get; set; } @@ -286,6 +287,14 @@ public NotesViewModel() { Preferences.Default.ShowNoteParams = showNoteParams; Preferences.Save(); }); + UseSolidPlaybackLine = Preferences.Default.UseSolidPlaybackLine; + MessageBus.Current.Listen() + .Subscribe(e => { + UseSolidPlaybackLine = e.UseSolidLine; + if (Part != null) { + SetPlayPos(DocManager.Inst.playPosTick, false); + } + }); TickWidth = ViewConstants.PianoRollTickWidthDefault; TrackHeight = ViewConstants.NoteHeightDefault; @@ -985,6 +994,13 @@ public void ClearPhraseCache() { } } + public class PlaybackLineModeChangedEvent { + public readonly bool UseSolidLine; + public PlaybackLineModeChangedEvent(bool useSolidLine) { + UseSolidLine = useSolidLine; + } + } + private void SetPlayPos(int tick, bool waitingRendering) { PlayPosWaitingRendering = waitingRendering; if (waitingRendering) { @@ -992,9 +1008,14 @@ private void SetPlayPos(int tick, bool waitingRendering) { } tick -= Part?.position ?? 0; PlayPosX = TickToneToPoint(tick, 0).X; - TickToLineTick(tick, out int left, out int right); - PlayPosHighlightX = TickToneToPoint(left, 0).X; - PlayPosHighlightWidth = (right - left) * TickWidth; + if (UseSolidPlaybackLine) { + PlayPosHighlightX = PlayPosX - 1; + PlayPosHighlightWidth = 2; + } else { + TickToLineTick(tick, out int left, out int right); + PlayPosHighlightX = TickToneToPoint(left, 0).X; + PlayPosHighlightWidth = (right - left) * TickWidth; + } } private void FocusNote(UNote note) { diff --git a/OpenUtau/ViewModels/PreferencesViewModel.cs b/OpenUtau/ViewModels/PreferencesViewModel.cs index 958f0fe8f..0994fcfc9 100644 --- a/OpenUtau/ViewModels/PreferencesViewModel.cs +++ b/OpenUtau/ViewModels/PreferencesViewModel.cs @@ -58,6 +58,7 @@ public AudioOutputDevice? AudioOutputDevice { [Reactive] public int LockStartTime { get; set; } [Reactive] public int PlaybackAutoScroll { get; set; } [Reactive] public double PlayPosMarkerMargin { get; set; } + [Reactive] public bool UseSolidPlaybackLine { get; set; } // Paths public string SingerPath => PathManager.Inst.SingersPath; @@ -140,6 +141,7 @@ public PreferencesViewModel() { PreferPortAudio = Preferences.Default.PreferPortAudio ? 1 : 0; PlaybackAutoScroll = Preferences.Default.PlaybackAutoScroll; PlayPosMarkerMargin = Preferences.Default.PlayPosMarkerMargin; + UseSolidPlaybackLine = Preferences.Default.UseSolidPlaybackLine; LockStartTime = Preferences.Default.LockStartTime; InstallToAdditionalSingersPath = Preferences.Default.InstallToAdditionalSingersPath; LoadDeepFolders = Preferences.Default.LoadDeepFolderSinger; @@ -220,6 +222,12 @@ public PreferencesViewModel() { Preferences.Default.PlayPosMarkerMargin = playPosMarkerMargin; Preferences.Save(); }); + this.WhenAnyValue(vm => vm.UseSolidPlaybackLine) + .Subscribe(useSolidPlaybackLine => { + Preferences.Default.UseSolidPlaybackLine = useSolidPlaybackLine; + Preferences.Save(); + MessageBus.Current.SendMessage(new NotesViewModel.PlaybackLineModeChangedEvent(useSolidPlaybackLine)); + }); this.WhenAnyValue(vm => vm.LockStartTime) .Subscribe(lockStartTime => { Preferences.Default.LockStartTime = lockStartTime; diff --git a/OpenUtau/Views/PreferencesDialog.axaml b/OpenUtau/Views/PreferencesDialog.axaml index 55428064b..5b0c6571c 100644 --- a/OpenUtau/Views/PreferencesDialog.axaml +++ b/OpenUtau/Views/PreferencesDialog.axaml @@ -124,6 +124,10 @@ + + + +