The playback cursor is not repositioned when selecting items other than notes, rests or measures
The manual recommends that, when starting playback, the user should "click on a note, rest or the blank part of a measure to establish the starting point".
I often find that, when attempting to establish the starting point, I accidentally select a score element which isn't a note, rest or measure - for example, a note stem or a clef. Therefore, the playback cursor's position is not changed. I usually only realise this when I've already pressed "Play", and the viewport has been whisked away to some distant part of the score.
Most score elements have an obvious correspondence to a particular time-point in the score. For example, a note stem "belongs" to a particular note, while a clef "belongs" to the start of a particular bar.
I suggest that, when a score element other than a note, rest or measure is selected, and the selected element has an obvious position in time, the playback cursor should always be repositioned to that element.
Comments
Still the case in 3.4
FWIW, probably an easy fix.
I'll take this one.
PR #5749.
Side note: Not as easy as I expected.
FWIW, you went way beyond what I had in mind, which would have been to just use tick() and call it done (two-line change to the code that calls setPlayPos). That's what I saw as easy :-). But I do like special handling you did for element types where tick() is not so meaningful.
Fixed in branch master, commit f363220a1b
_Fix #297426: The playback cursor is not repositioned when selecting items 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._
Fixed in branch master, commit 2a1b76e691
_Merge pull request #5749 from Spire42/297426-move-playhead-to-selected-element
Fix #297426: The playback cursor is not repositioned when selecting items other than notes, rests or measures_
Automatically closed -- issue fixed for 2 weeks with no activity.