Addition of Timeline Range Selection#2115
Draft
rokujyushi wants to merge 5 commits into
Draft
Conversation
A new TimelineSelectionViewModel has been added to manage timeline range selection, enabling the sharing of selection states between MainWindowViewModel, TracksViewModel, NotesViewModel, and PianoRollViewModel. Properties for selection range Ticks and rendering, along with operation methods, have been added to NotesViewModel and TracksViewModel. These have been implemented to track state changes through reactive subscriptions. As a result, range selection is now possible on the timeline and piano roll, allowing selection states to be synchronized across UI components.
To enable timeline range selection, I have implemented new management for range selection states using TimelinePointerPressed, TimelinePointerMoved, and TimelinePointerReleased. The target components are the TimelineCanvas in both PianoRoll and MainWindow. Additionally, markers have been added to make the selected range visually easier to understand.
Removed TimelineSelectionViewModel and migrated the timeline selection logic to TracksViewModel. This unifies selection range synchronization and property updates, achieving code simplification and improved readability. Key changes: - Removed timeline selection-related processing in PianoRoll.axaml.cs. - Removed TimelineSelectionViewModel and added dependency on TracksViewModel in MainWindowViewModel.cs. - Discontinued use of TimelineSelectionViewModel and switched to TracksViewModel in NotesViewModel.cs. - Completely deleted TimelineSelectionViewModel.cs. - Performed code formatting fixes and removal of unnecessary code.
Removed dependency on TimelineSelectionViewModel and integrated selection range management into TracksViewModel. Introduced the TimeLineEditState class to clarify state management for timeline operations. - Modified the PianoRollViewModel constructor to accept TracksViewModel. - Integrated properties and logic related to selection ranges into TracksViewModel. - Refactored selection range operation methods and added ApplySelectionRange. - Migrated timeline operation logic in MainWindow to TimeLineEditState. - Added TimelineSelectionEditState to clarify the start, update, and end of selection range operations. - Improved code readability, maintainability, and extensibility.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new timeline selection range feature in the Piano Roll, allowing users to select a range of time directly on the timeline (e.g., by Shift+dragging), with visual feedback and new commands for managing the selection. The changes span UI updates, new properties and logic in the view models, and integration of the selection state throughout the relevant components.
This pull request is limited to providing the timeline selection range feature; other functions, such as range exporting and loop playback of the selected range, are planned to be added in the future.
New timeline selection range feature:
PianoRoll.axamlfor displaying the selection range, including the selection rectangle, top line, left/right markers, and guide lines that extend through the note area. These elements are bound to new properties inNotesViewModelfor dynamic updates. [1] [2]PianoRoll.axaml.csto handle selection range creation and updates via Shift+drag on the timeline, including state management and an "Escape" key handler to clear the selection. Also added a menu command for clearing the selection range. [1] [2] [3] [4] [5]ViewModel and data flow enhancements:
TimelineSelectionViewModeland integrated it intoMainWindowViewModel,TracksViewModel,NotesViewModel, andPianoRollViewModelto centralize and synchronize selection range state across the application. [1] [2] [3]NotesViewModelwith new reactive properties and methods for managing the selection range, tick-space calculations, and visual updates. The view model now listens for changes in the timeline selection and updates the UI accordingly. [1] [2] [3] [4] [5] [6]UI/UX and localization: