Skip to content
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

Fix #16519: L/R Arrow During Playback Moves From Playhead Current Location #19038

Merged
merged 3 commits into from
Aug 15, 2024

Conversation

22justinl
Copy link
Contributor

@22justinl 22justinl commented Aug 12, 2023

  • Left/Right Arrow: Move between beats
  • Left/Right Arrow + Ctrl/Command: Move between measures

Resolves: #16519
Resolves: #23795

Changed so that left and right arrows during playback move the playback cursor instead of the selection (which causes the playback cursor to move back to the selection)

  • I signed the CLA
  • The title of the PR describes the problem it addresses
  • Each commit's message describes its purpose and effects, and references the issue it resolves
  • If changes are extensive, there is a sequence of easily reviewable commits
  • The code in the PR follows the coding rules
  • There are no unnecessary changes
  • The code compiles and runs on my machine, preferably after each commit individually
  • I created a unit test or vtest to verify the changes I made (if applicable)

@22justinl 22justinl force-pushed the move_playback_cursor_lr branch from 5caad1b to dd35901 Compare August 12, 2023 20:50
@cbjeukendrup cbjeukendrup self-requested a review August 13, 2023 21:47
@22justinl 22justinl force-pushed the move_playback_cursor_lr branch from dd35901 to cc61b0a Compare August 24, 2023 08:19
@RomanPudashkin
Copy link
Contributor

@22justinl please rebase this PR. Thanks!

@22justinl 22justinl force-pushed the move_playback_cursor_lr branch from cc61b0a to 2a12b95 Compare December 16, 2023 23:43
@zacjansheski
Copy link
Contributor

I think this change is problematic with repeats

Here is a video from the PR

video1399164880.mp4

@zacjansheski
Copy link
Contributor

Here is a video from current 4.2

video1231836572.mp4

@igorkorsukov igorkorsukov force-pushed the master branch 6 times, most recently from fa1f8d3 to 525a11a Compare February 14, 2024 09:08
@cbjeukendrup
Copy link
Contributor

cbjeukendrup commented Mar 31, 2024

@22justinl Kind reminder about the comments above :)
If you don't have time anymore to fix them, that's alright; in that case we'll close this PR, so that a different contributor can continue your work.
Please let us know!

@22justinl 22justinl force-pushed the move_playback_cursor_lr branch 3 times, most recently from c75a8b5 to 591151f Compare July 8, 2024 10:48
@22justinl 22justinl marked this pull request as draft July 8, 2024 11:04
@22justinl 22justinl force-pushed the move_playback_cursor_lr branch 2 times, most recently from d1bb114 to 2fadc4a Compare July 8, 2024 12:52
@22justinl 22justinl marked this pull request as ready for review July 8, 2024 13:41
@22justinl 22justinl force-pushed the move_playback_cursor_lr branch 2 times, most recently from d1f5e88 to ba0a45e Compare July 20, 2024 19:31
@22justinl 22justinl force-pushed the move_playback_cursor_lr branch from ba0a45e to f3733e1 Compare July 20, 2024 19:56
Copy link
Contributor

@cbjeukendrup cbjeukendrup left a comment

Choose a reason for hiding this comment

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

Thanks very much! Besides fixing the issue, this PR helped uncover quite some problems with PlaybackController!

@zacjansheski
Copy link
Contributor

zacjansheski commented Aug 6, 2024

Playhead gets stuck on time signature change

I don't think this is a "show-stopper" but in master, pressing left will take the playhead past the time signature change and in the PR you need to use Cmd+Left

Sorry this video is longer than necessary

video1423174087.mp4

@22justinl 22justinl force-pushed the move_playback_cursor_lr branch from 37cb03f to 1de3ae8 Compare August 14, 2024 15:23
@22justinl 22justinl force-pushed the move_playback_cursor_lr branch from 1de3ae8 to a1ca193 Compare August 14, 2024 15:24
Comment on lines +1016 to +1019
// Set target beat to max beat of previous bar
engraving::TimeSigMap* timeSigMap = currentMasterNotation()->masterScore()->sigmap();
int targetBarStartTick = timeSigMap->bar2tick(targetMeasureIdx, 0);
targetBeatIdx = timeSigMap->timesig(Fraction::fromTicks(targetBarStartTick)).timesig().numerator() - 1;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are the changes I made + #include "engraving/dom/sig.h" at the top (I thought it might be unclear because I rebased the branch)

Copy link
Contributor

Choose a reason for hiding this comment

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

@RomanPudashkin do you think we should try to extract these lines into a method that can be reused here and in NotationPlayback::beat? Or is that not worth the effort?
(The question would also be, where to put such a method.)

Copy link
Contributor

Choose a reason for hiding this comment

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

Cosmetic improvements can be made later

@zacjansheski
Copy link
Contributor

Tested on MacOS 14, Windows 11, Ubuntu 22.04.3. Approved
#16519 FIXED
#23795 FIXED

Copy link
Contributor

@cbjeukendrup cbjeukendrup left a comment

Choose a reason for hiding this comment

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

Thanks for the fix! I have one last stylistic doubt, that I'll ask Roman about:

Comment on lines +1016 to +1019
// Set target beat to max beat of previous bar
engraving::TimeSigMap* timeSigMap = currentMasterNotation()->masterScore()->sigmap();
int targetBarStartTick = timeSigMap->bar2tick(targetMeasureIdx, 0);
targetBeatIdx = timeSigMap->timesig(Fraction::fromTicks(targetBarStartTick)).timesig().numerator() - 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

@RomanPudashkin do you think we should try to extract these lines into a method that can be reused here and in NotationPlayback::beat? Or is that not worth the effort?
(The question would also be, where to put such a method.)

@RomanPudashkin RomanPudashkin merged commit 08e50e2 into musescore:master Aug 15, 2024
11 checks passed
RomanPudashkin added a commit to RomanPudashkin/MuseScore that referenced this pull request Aug 20, 2024
…r_lr

Fix musescore#16519: L/R Arrow During Playback Moves From Playhead Current Location
@RomanPudashkin RomanPudashkin mentioned this pull request Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants