Cursor can be used by plugins to manipulate the score.
More...
|
Q_INVOKABLE void | rewind (RewindMode mode) |
| Rewind cursor to a certain position. More...
|
|
Q_INVOKABLE bool | next () |
| Move the cursor to the next segment. More...
|
|
Q_INVOKABLE bool | nextMeasure () |
| Move the cursor to the first segment of the next measure. More...
|
|
Q_INVOKABLE void | add (Ms::PluginAPI::Element *) |
| Adds the given element to a score at this cursor's position.
|
|
Q_INVOKABLE void | addNote (int pitch) |
| Adds a note to the current cursor position. More...
|
|
Q_INVOKABLE void | setDuration (int z, int n) |
| Set duration of the notes added by the cursor. More...
|
|
Cursor can be used by plugins to manipulate the score.
◆ RewindMode
Enumerator |
---|
SCORE_START | Rewind to the start of a score.
|
SELECTION_START | Rewind to the start of a selection.
|
SELECTION_END | Rewind to the end of a selection.
|
◆ addNote()
void addNote |
( |
int |
pitch | ) |
|
Adds a note to the current cursor position.
The duration of the added note equals to what has been set by the previous setDuration() call.
- Parameters
-
pitch | MIDI pitch of the added note. |
◆ next()
Move the cursor to the next segment.
- Returns
false
if the end of the score is reached, true
otherwise.
◆ nextMeasure()
Move the cursor to the first segment of the next measure.
- Returns
false
if the end of the score is reached, true
otherwise.
◆ rewind()
Rewind cursor to a certain position.
- Parameters
-
mode | Determines the position where to move this cursor. See Cursor::RewindMode to see the list of avaliable rewind modes. |
- Note
- In MuseScore 2.X, this function took an integer value (0, 1 or 2) as its parameter. For compatibility reasons, the old values are still working, but it is recommended to use RewindMode enumerators instead.
◆ setDuration()
void setDuration |
( |
int |
z, |
|
|
int |
n |
|
) |
| |
Set duration of the notes added by the cursor.
- Parameters
-
z | numerator |
n | denominator. If n == 0, sets duration to a quarter. |
- See also
- addNote()
◆ filter
Segment type filter, a bitmask from PluginAPI::PluginAPI::Segment values.
Determines which segments this cursor will move to on next() and nextMeasure() operations. The default value is Ms::SegmentType::ChordRest so only segments containing chords and rests are handled by default.
◆ keySignature
Key signature of current staff at tick pos.
(read only)
The documentation for this class was generated from the following files:
- mscore/plugin/api/cursor.h
- mscore/plugin/api/cursor.cpp