Skip to content

Addition of Timeline Range Selection#2115

Draft
rokujyushi wants to merge 5 commits into
openutau:masterfrom
rokujyushi:Export-Selection
Draft

Addition of Timeline Range Selection#2115
rokujyushi wants to merge 5 commits into
openutau:masterfrom
rokujyushi:Export-Selection

Conversation

@rokujyushi
Copy link
Copy Markdown
Contributor

@rokujyushi rokujyushi commented May 9, 2026

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:

  • Added visual elements to the timeline in PianoRoll.axaml for 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 in NotesViewModel for dynamic updates. [1] [2]
  • Introduced new commands and logic in PianoRoll.axaml.cs to 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:

  • Added TimelineSelectionViewModel and integrated it into MainWindowViewModel, TracksViewModel, NotesViewModel, and PianoRollViewModel to centralize and synchronize selection range state across the application. [1] [2] [3]
  • Expanded NotesViewModel with 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:

  • Added a new menu entry and string resource for "Clear selection range" to support the new feature. Also clarified the "Mute this only" menu string for better user understanding. [1] [2]
image

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.
Copilot AI review requested due to automatic review settings May 9, 2026 19:40
@rokujyushi rokujyushi marked this pull request as draft May 9, 2026 19:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@rokujyushi rokujyushi marked this pull request as ready for review May 9, 2026 21:06
@rokujyushi rokujyushi marked this pull request as draft May 10, 2026 09:44
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants