Resolves: https://musescore.org/en/node/301436
The accessibility navigation commands
(Alt+Left/Right, also Ctrl+Alt+Shift+Left/Right)
were not properly checking for mmrests,
resulting in selection of elements in the underlying measures
that were not valid in the current layout.
This adds the necessary checks.
Mostly just a matter of adding "MM" to various function calls.
In a couple of places, the appropriate function did not exist,
so I added it.
Also corrected errors in Ctrl+Alt+Shift+Left/Right
that occurs when going past the end of a staff,
the code to wrap around to the next staff this case well.
In part this is because the implementation of barlines changed
since the code was written.
Barlines are per-staff now even when spanned,
so the use and management of prevTrack is no longer appropriate.
Resolves: https://musescore.org/en/node/301174.
When restoring a range selection that ends on the last tick of a measure, make sure that it is not extended to the first tick of the next measure.
Added code to read the text within frames in accessibleExtraInfo(),
but also fixed the navigation to check for a frame
before moving to the next/previous measure.
Because frames will generally have a track of -1,
I also needed to take advantage of the tracking of the current track from a previous commit
so that nagivation continues on the correct track after passing through a frame.
I also needed to be careful to handle the -1.
This change adds code to track the current tick and track on every new single selection.
If the selection is ever lost (including by pressing Esc),
then a currentCR can be constructed from this when the user resumes navigation via Alt+left/right.
- tick names a position on the time axis
- tick is always a Fraction()
- only Measure() and Segment() (and Tuplet?) have a tick value
- tick() for an generic element return only a sensible value if isMeasure() or isSegment() or isSegment(parent())
- "ticks" names a duration stored in a Fraction()
- the tick value for an Segment is relative to its measure
- rename "duration" to "ticks"
- rename afrac() to tick()
- rename rfrac() to rtick()
- rename some variables, changing "fraction" into "tick"
(example: actualFraction() into actualTicks())
- Lyrics ticks are written as Fraction, on read if xmlreader sees a "/" it reads a fraction
else midi ticks for backwards compatibility
Make selection made after paste operation be actually updated after
re-layout and, hence, after reconstructing multi-measure rests.
This is needed as reconstructing MMRests changes segments structure
of the score which leads selection to be in invalid state.
This commit adds also some tweaks to selection boundaries to work
around the fixed bug (which would not work alone without the
previously described changes).