![]() |
MuseScore Plugins 3.2.3
Plugins API for MuseScore
|
Cursor can be used by plugins to manipulate the score. More...
#include <cursor.h>


Public Types | |
| enum | RewindMode { SCORE_START = 0 , SELECTION_START = 1 , SELECTION_END = 2 } |
Public Member Functions | |
| Q_INVOKABLE void | rewind (RewindMode mode) |
| Rewind cursor to a certain position. | |
| Q_INVOKABLE bool | next () |
| Move the cursor to the next segment. | |
| Q_INVOKABLE bool | nextMeasure () |
| Move the cursor to the first segment of the next measure. | |
| 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. | |
| Q_INVOKABLE void | setDuration (int z, int n) |
| Set duration of the notes added by the cursor. | |
Properties | |
| int | track |
| Current track. | |
| int | staffIdx |
| Current staff (track / 4). | |
| int | voice |
| Current voice (track % 4). | |
| int | filter |
| Segment type filter, a bitmask from PluginAPI::PluginAPI::Segment values. | |
| int | tick |
| MIDI tick position, read only. | |
| double | time |
| Time at tick position, read only. | |
| qreal | tempo |
| Tempo at current tick, read only. | |
| int | keySignature |
| Key signature of current staff at tick pos. | |
| Ms::PluginAPI::Score * | score |
| Associated score. | |
| Ms::PluginAPI::Element * | element |
| Current element at track, read only. | |
| Ms::PluginAPI::Segment * | segment |
| Current segment, read only. | |
| Ms::PluginAPI::Measure * | measure |
| Current measure, read only. | |
Cursor can be used by plugins to manipulate the score.
| enum RewindMode |
| 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.
| pitch | MIDI pitch of the added note. |
| bool next | ( | ) |
Move the cursor to the next segment.
false if the end of the score is reached, true otherwise. | bool nextMeasure | ( | ) |
Move the cursor to the first segment of the next measure.
false if the end of the score is reached, true otherwise. | void rewind | ( | RewindMode | mode | ) |
Rewind cursor to a certain position.
| mode | Determines the position where to move this cursor. See Cursor::RewindMode to see the list of avaliable rewind modes. |
| void setDuration | ( | int | z, |
| int | n ) |
Set duration of the notes added by the cursor.
| z | numerator |
| n | denominator. If n == 0, sets duration to a quarter. |
|
readwrite |
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.
|
read |
Key signature of current staff at tick pos.
(read only)