Commit graph

52 commits

Author SHA1 Message Date
Igor Korsukov
45b9887603 changed code style 2020-05-28 09:50:45 +02:00
Joachim Schmitz
e9c0b35a22 fix compiler warnings seen on Travis CI, for the Linux build and on MinGW 2020-04-21 13:20:54 +02:00
DangWang
b140feb71e fix #302822: breaks are now accessible via keyboard 2020-04-09 23:00:20 +03:00
MarcSabatella
ad3b5c2dde fix #301496: voltas excluded from navigation
Resolves: https://musescore.org/en/node/301496

Alt+Left/Right commands were skipping voltas because
we were checking start element and checking against the active staff,
but the start element is actually the measure for voltas.
The main change here is to go ahead and visit the volta
if the active staff if you are navigating the top staff.
Arguably, it could make sense to check for the top *visible* staff,
since that is what the volta at least appears to be attached to.
So I have code here to that.
But I disabled it because in practice,
neither the navigation commands themsevles nor the screen reader
treat invisible staves specially.
So a blind user navigating would have no way of knowing
the top staff is not visible.
So they would likely continue to see it as relevant.

I would not the same issue occurs for system text,
which we always treat as attached to the top staff only.
I added a TODO to indicate where this code would need updating.

Eventually we could consider coming up with some way
of presenting information about hidden staves.
Perhaps in conjunction with a facility allow user
to hide staves on specific systems only,
which seems to be a fairly common request.
2020-02-24 08:02:38 -07:00
MarcSabatella
b5d53248ab fix #301436: invalid selection when navigating with mmrests
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.
2020-02-21 12:23:26 -07:00
Marc Sabatella
6c51400d46 fix #295106: crash on next element
There are a number of cases where next element ended up hitting unexpected code paths.
Mostly these involve cases of elements being attached somewhere pther than expected:
symbols attached to rests or to other symbols rather than to notes,
chord symbols attached to fret diagrams.
This change addresses these cases in a few different ways:
1) for symbols to attached to other symbols, or chord symbols attached to fret diagrams,
srt the track correctly (it was -1, causing the  the code to not be able to find a next element).
2) for symbols attached to rests, be sure to handle that case in Score::nextElement(),
and also make sure that Segment::nextElement() and Segment::prevElement()
don't assume these elements actually have the segment as parent,
but instead check for that and move on if not.
2019-09-30 21:28:06 -06:00
Marc Sabatella
2f2aa3c731 fix #294485: don't wrap to begin/end on next/previous element
Blind users find it disorienting for the previous element command to wrap to the end,
or for next element to wrap back to the beginning.
Besides, no other navigation commands work that way.
This commit stops that behavior by simply swapping the calls
to Score::lastElement() and Score::firstElement() in the places where this wrapping occurs.
That is, if previous-element finds no previous element,
we return the first element.
2019-09-17 13:39:52 -06:00
Marc Sabatella
ceaea1f149 fix #292510, fix #292928: navigation and screenreader support for frames
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.
2019-09-17 13:33:23 +02:00
ws
ec3be9a99a Replacd integer midi tick values by fractions.
- 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
2019-02-18 11:46:05 +01:00
ws
1be753b3a4 fix delete of LetRing and PalmMute; updates for Trill and Hairpin in inspector 2018-08-06 10:38:28 +02:00
Matt McClinch
2e112abcff fix #175216, fix #269114: Crash with shortcut alt+arrow up/down if more than one element or nothing is selected
Fix other related issues with the up-chord/down-chord commands
Prevent crash when adjusting the grips of ties
2018-02-09 12:44:18 +01:00
Werner Schweer
1943bd1ff1 replace most static_cast in libmscore 2017-12-20 16:49:58 +01:00
lasconic
e356a89e51 update for vibrato, it's now a first class Element. GPX import test for vibrato. 2017-11-30 13:25:25 +01:00
divya-urs
28d4e39b05 accessibility: nextElement and prevElement 2017-07-13 23:52:00 +05:30
lasconic
ddc1de68be fix #180986: crash on ctrl+home of empty score 2017-03-14 18:53:32 +01:00
Werner Schweer
867f2582f6 move Segment::Type into SegmentType 2017-03-08 13:12:26 +01:00
Werner Schweer
1d4c6b2f21 move Element::type() to ScoreElement 2017-01-18 14:16:33 +01:00
Werner Schweer
4e0b0dbae0 update layout code 2016-10-20 11:32:17 +02:00
werner
7c5e99a358 implement lyrics above stave 2016-08-24 14:49:51 +02:00
Rockettwo
43cfd69a2f Fix for the broken Alt + Up command 2016-05-17 15:57:51 +02:00
ws
6fdbf515e8 changed element type conversion 2016-04-13 11:20:06 +02:00
ws
14ee35ba52 misc. regression fixes 2016-04-13 11:20:05 +02:00
ws
9ec1d02471 code cleanups & speed optimizations 2016-04-13 11:18:14 +02:00
Maurizio M. Gavioli
49edb8d0c3 Fixes #19155, #22861 (duplicate of the former) and #23100.
__References__:
Issues:	https://musescore.org/en/node/19155 https://musescore.org/en/node/22861 https://musescore.org/en/node/23100

__Description__:
Allows to change the start and end note to which a glissando is anchored after it has been entered. Either anchor can be changed independently.

The user interface follows the current working of other 'snappable' lines. Once either the start or end grip is selected:
- `[Shift]+[Left]` snaps the anchor to the previous chord, defaulting to its top note.
- `[Shift]+[Right]` snaps to the next chord, defaulting to its top note.
- `[Shift]+[Up]` snaps to the note above (possibly in a chord, voice or staff above the current one).
- `[Shift]+[Down]` snaps to the note below (possibly in a chord, voice or staff below the current one).

This permits to set the anchor points of a glissando to any note in the score, allowing several glissandi between the notes of the same two chords and other complex configurations (glissandi skipping intermediate chords, start and end notes in different voices or staves, and so on).

It is possible to move the anchor to a different staff of the same instrument, but not to a different instrument; also, it is not possible to 'cross' a change of instrument in the same staff.

__Known limitations__:
- The `[Shift]+[Up]` and `[Shift]+[Down]` use the same note-finding functions as the `[Alt]+[Up]` and `[Alt]+[Down]`actions which move the selection cursor to the above and below note, even across voices or staves. Occasionally, in particular if the note immediately above or below is not time-aligned, the algorithm has little expected results; however, the behaviour is already known to the user. Improving the algorithm would benefit both uses.

__Notes__:
- Most of the added infrastructure is not specific to glissando but to any spanner anchored to notes, then it should also add after-the-fact "snap to" note support to note-anchored text line.
- When moving an anchor, the algorithm usually prefers a note in the same voice/staff of the old note if it exists; if there is none, it tries other voices of the same staff.
- The change of anchor is undoable.
- The fix corrects the management of the `Chord::_endsGlissando` flag, taking into account that a chord can be the ending point of several glissandi and removing one of them not necessarily means the chord no longer ends a glissando (another glissando may still exists).
- The fix also improved the rendering of the glissando wavy line, with better alignment with anchor notes and, with glissando text, better text-line spacing.
2015-09-30 09:16:47 +02:00
Marc Sabatella
96d6641d90 fix #48406: cannot extend range past grace notes with keybaord 2015-02-22 09:13:24 -07:00
ws
329124c789 some layout optimizations/claenups 2015-02-19 10:33:46 +01:00
lasconic
edcaa098a3 fix #31221 2014-11-25 16:53:43 +01:00
ws
66c14cdf4f fix #31221 2014-11-22 11:47:06 +01:00
Marc Sabatella
f99eaceb1a fix #29406: grace note navigation 2014-08-17 12:12:14 -06:00
Andrei Tuicu
9caa98b130 Added 4 new navigation commands:
- next element
- previous element
- first element
- last element
2014-08-17 17:25:21 +03:00
Joachim Schmitz
e6e7436177 move SegmentType to Segment::Type and make int again
needed to make it available to the plugin framework
and the memory saved is not worth the performance penalty
2014-06-26 11:57:39 +02:00
Joachim Schmitz
75623c53dc move ElementType to Element::Type
needed to make it available to the Plugin framework
2014-06-26 11:57:35 +02:00
ws
e8be73f41b fix transposition when changing instrument 2014-06-04 10:40:26 +02:00
ws
e1b1246e0c make SegmentType an global enum class 2014-06-01 20:24:29 +02:00
Bartlomiej Lewandowski
3c0617a8b7 Added isType methods for selection 2014-05-29 20:59:12 +02:00
Joachim Schmitz
cd48d9ccfd convert enum SelState into enum class 2014-05-26 13:21:04 +02:00
Joachim Schmitz
931e837c5e convert enum ElementType into enum class 2014-05-23 10:35:27 +02:00
Isensee
69f250919e fix #24951: grace notes after enabled 2014-04-23 18:09:57 +02:00
ws
239ffd7456 change implementation of multi measure rests 2013-09-19 15:08:54 +02:00
lasconic
53f9023afb fix #22470: Shift+Ctrl+Right to extend selection doesn't work if existing selection extends to end of measure 2013-09-06 11:57:02 +02:00
ws
517627a21f update clef implementation 2013-09-05 16:38:04 +02:00
ws
5350ef7682 cleanup some casts in navigation code 2013-08-06 14:49:02 +02:00
Marc Sabatella
c2225d7b83 change alt-up/down to move by chord and track
First move through current chord on current track, then move up and down
by track.
2013-08-02 19:12:23 -06:00
Marc Sabatella
d9d64723c9 implementation of next/prev track
move up and down by track, stopping only at tracks that have content at
or before the cursor position within the current measure
2013-08-02 15:45:45 -06:00
wschweer
705307a034 updates 2013-06-16 23:33:37 +02:00
wschweer
ab6120f85e refactoring grace notes 2013-06-12 14:23:57 +02:00
ws
9ebabcc2e5 add namespace Ms 2013-05-13 19:43:59 +02:00
ws
220db94494 reorganize synthesizer; add zita1 reverb 2013-04-03 12:50:21 +02:00
Werner Schweer
4c4069d3a9 navigate next-chord and prev-chord now stops on grace note 2012-11-23 15:22:16 +01:00
Werner Schweer
3139970fd1 move ElementType to Element() 2012-09-13 18:07:11 +02:00