-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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 #297426: The playback cursor is not repositioned when selecting items other than notes, rests or measures #5749
Fix #297426: The playback cursor is not repositioned when selecting items other than notes, rests or measures #5749
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some minor comments, but the overall solution seems really good to me.
6c6586d
to
d327ab2
Compare
I believe that determining where to play is not the responsibility of these elements, it is external logic, application level logic rather than domain model (as opposed to getting a tick, for example) |
This is not a class helper, this is a class service that fulfills its responsibility :) |
if you think the logic from where to play is the level of the domain model (and not the application level), then your solution is excellent |
We fundamentally disagree on this. If you have a look at the code for the various |
Thanks. I ask you to write comments in the base class that each tick method returns (what is |
I completely agree with you that these three member functions of There has been some talk recently in the Developers Chat of an initiative to write comprehensive Doxygen-style documentation for the entire MuseScore codebase, possibly as a GSoC project. I think that would be a great idea. In any case, I think writing documentation should be considered an issue on its own, separate from a small fix like this. |
these three functions especially need documentation, because they are all similar, it is not obvious what their difference is. I personally am not a adherent of documenting everything, I believe in self-documenting code (I try to write code like this). I believe that documentation needs something that is not obvious. Although at the same time I write a lot of comments myself :) (you can see it in my PR) |
OK. I will document the one function I added, but I have to leave the other two alone for now, firstly because they aren't related to this PR, and secondly because I didn't write those functions and I'm not confident that I fully understand them well enough to explain precisely what they're meant to be used for — especially |
d327ab2
to
2025506
Compare
Done. |
…tems other than notes, rests or measures Improved the functionality of the playhead (a.k.a. the playback cursor) so that whenever the user selects an element, the playhead is automatically repositioned to the element's time position. Previously, this worked only for noteheads and rests, but it now works for note stems, beams, augmentation dots, accidentals, ties, slurs, articulations, time signatures, key signatures, clefs, tempo changes, dynamics, lines, barlines, breaks, spacers, measure numbers, text, and so on. Special cases handled: * Barlines. The playhead is moved to the start of the measure to the right of the barline, unless it's the last barline in either the entire score or the system, in which case the playhead is moved to the start of the measure to the left of the barline. * Brackets always have a time position of zero, so the playhead is moved to the start of the first measure in the system that the bracket belongs to. * Instrument names always have a time position of zero, so the playhead is moved to the start of the first measure in the system that the instrument name belongs to.
7132261
to
f363220
Compare
Resolves: #297426
Improved the functionality of the playhead (a.k.a. the playback cursor) so that whenever the user selects an element, the playhead is automatically repositioned to the element's time position. Previously, this worked only for noteheads and rests, but it now works for note stems, beams, augmentation dots, accidentals, ties, slurs, articulations, time signatures, key signatures, clefs, tempo changes, dynamics, lines, barlines, breaks, spacers, measure numbers, text, and so on.
Special cases handled:
Barlines. The playhead is moved to the start of the measure to the right of the barline, unless it's the last barline in either the entire score or the system, in which case the playhead is moved to the start of the measure to the left of the barline.
Brackets always have a time position of zero, so the playhead is moved to the start of the first measure in the system that the bracket belongs to.
Instrument names always have a time position of zero, so the playhead is moved to the start of the first measure in the system that the instrument name belongs to.