-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Playhead and Timeline to Pattern Editor #7794
base: master
Are you sure you want to change the base?
Conversation
Edit: Fixed. I decided to add a new signal to
|
Co-authored-by: Sotonye Atemie <satemiej@gmail.com>
I have decided to make the code simpler by using the clip length instead of the clip steps. This means I do not need to edit |
Do you guys want me to add some kind of timeline playhead for normal midi clips/sample clips/automation clips in the pattern editor? |
This PR adds a visual indicator to show the pattern editor playing, along with a timeline widget to allow the user to skip forward/backward in a pattern.
Addresses #1195
2025-03-18.17-00-04.mp4
I noticed that the timeline arrow position moves smoothly while the step highlighting moves in steps, which kind of looks weird. Are you guys okay with that, or do you have any ideas for a better solution?
Changes
TimeLineWidget
toPatternEditor
, and set it up in the constructor, along with some helper variables (the track head width, which was copied from the Song Editor, and the max number of steps in the clips to calculate the pixels per bar, which has its own function to update)step_btn_highlight
, to overlay the steps which are currently being played.TrackView::getClipViews()
to allow the Pattern Editor to access the midi clip views to update them when the playhead moves. Previously, afaik, once the clip views are created, they leave the scope and cannot be accessed again, which is a problem.MidiClip::steps()
to allow the pattern editor to know how long the clips are, and update the pixelsPerBar for the timeline accordingly (since we don't have scrolling yet; maybe this will change in the future). On second, this could probably be achieved viaMidiClip::length()
, but it probably doesn't hurt to handle it with steps. I can rework this if anyone wants.Note: the current signal/slot system for the pattern editor is very odd;
updatePosition
doesn't seem to be called when the playback position changes, which means that I had to make it be triggered by something else. I have decided to connect it toTimeLineWidget::positionChanged
, which works, but this may have to be reworked when #7454 is completed.