Cursor can be used by plugins to manipulate the score.
More...
#include <cursor.h>
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.
|
◆ Cursor()
Ms::PluginAPI::Cursor::Cursor |
( |
Ms::Score * |
s = nullptr | ) |
|
◆ add()
Adds the given element to a score at this cursor's position.
◆ addNote()
void Ms::PluginAPI::Cursor::addNote |
( |
int |
pitch, |
|
|
bool |
addToChord = false |
|
) |
| |
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. |
addToChord | add note to the current chord instead of replacing it. This parameter is available since MuseScore 3.3.4. |
◆ currentElement()
Ms::Element * Ms::PluginAPI::Cursor::currentElement |
( |
| ) |
const |
|
private |
◆ element()
Element* Ms::PluginAPI::Cursor::element |
( |
| ) |
const |
◆ filter()
int Ms::PluginAPI::Cursor::filter |
( |
| ) |
const |
|
inline |
◆ measure()
Measure* Ms::PluginAPI::Cursor::measure |
( |
| ) |
const |
◆ next()
bool Ms::PluginAPI::Cursor::next |
( |
| ) |
|
Move the cursor to the next segment.
- Returns
false
if the end of the score is reached, true
otherwise.
◆ nextInTrack()
void Ms::PluginAPI::Cursor::nextInTrack |
( |
| ) |
|
|
private |
◆ nextMeasure()
bool Ms::PluginAPI::Cursor::nextMeasure |
( |
| ) |
|
Move the cursor to the first segment of the next measure.
- Returns
false
if the end of the score is reached, true
otherwise.
◆ prev()
bool Ms::PluginAPI::Cursor::prev |
( |
| ) |
|
Move the cursor to the previous segment.
- Returns
false
if the beginning of the score is reached, true
otherwise.
- Since
- MuseScore 3.3.4
◆ prevInTrack()
void Ms::PluginAPI::Cursor::prevInTrack |
( |
| ) |
|
|
private |
◆ qmlKeySignature()
int Ms::PluginAPI::Cursor::qmlKeySignature |
( |
| ) |
|
◆ rewind()
void Ms::PluginAPI::Cursor::rewind |
( |
RewindMode |
mode | ) |
|
Rewind cursor to a certain position.
- Parameters
-
mode | Determines the position where to move this cursor. See Cursor::RewindMode to see the list of available 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.
◆ score()
Score* Ms::PluginAPI::Cursor::score |
( |
| ) |
const |
◆ segment()
Segment* Ms::PluginAPI::Cursor::segment |
( |
| ) |
const |
◆ setDuration()
void Ms::PluginAPI::Cursor::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()
◆ setFilter()
void Ms::PluginAPI::Cursor::setFilter |
( |
int |
f | ) |
|
|
inline |
◆ setScore() [1/2]
void Ms::PluginAPI::Cursor::setScore |
( |
Ms::Score * |
s | ) |
|
|
private |
◆ setScore() [2/2]
void Ms::PluginAPI::Cursor::setScore |
( |
Score * |
s | ) |
|
◆ setStaffIdx()
void Ms::PluginAPI::Cursor::setStaffIdx |
( |
int |
v | ) |
|
◆ setTrack()
void Ms::PluginAPI::Cursor::setTrack |
( |
int |
v | ) |
|
◆ setVoice()
void Ms::PluginAPI::Cursor::setVoice |
( |
int |
v | ) |
|
◆ staffIdx()
int Ms::PluginAPI::Cursor::staffIdx |
( |
| ) |
const |
◆ tempo()
qreal Ms::PluginAPI::Cursor::tempo |
( |
| ) |
|
◆ tick()
int Ms::PluginAPI::Cursor::tick |
( |
| ) |
|
◆ time()
double Ms::PluginAPI::Cursor::time |
( |
| ) |
|
◆ track()
int Ms::PluginAPI::Cursor::track |
( |
| ) |
const |
|
inline |
◆ voice()
int Ms::PluginAPI::Cursor::voice |
( |
| ) |
const |
◆ _filter
◆ _score
Ms::Score* Ms::PluginAPI::Cursor::_score = nullptr |
|
private |
◆ _segment
◆ _track
int Ms::PluginAPI::Cursor::_track = 0 |
|
private |
◆ element
Element * Ms::PluginAPI::Cursor::element |
|
read |
Current element at track, read only.
◆ filter
int Ms::PluginAPI::Cursor::filter |
|
readwrite |
◆ keySignature
int Ms::PluginAPI::Cursor::keySignature |
|
read |
Key signature of current staff at tick pos.
(read only)
◆ measure
Measure * Ms::PluginAPI::Cursor::measure |
|
read |
Current measure, read only.
◆ score
Score * Ms::PluginAPI::Cursor::score |
|
readwrite |
◆ segment
Segment * Ms::PluginAPI::Cursor::segment |
|
read |
Current segment, read only.
◆ staffIdx
int Ms::PluginAPI::Cursor::staffIdx |
|
readwrite |
Current staff (track / 4)
◆ tempo
qreal Ms::PluginAPI::Cursor::tempo |
|
read |
Tempo at current tick, read only.
◆ tick
int Ms::PluginAPI::Cursor::tick |
|
read |
MIDI tick position, read only.
◆ time
double Ms::PluginAPI::Cursor::time |
|
read |
Time at tick position, read only.
◆ track
int Ms::PluginAPI::Cursor::track |
|
readwrite |
◆ voice
int Ms::PluginAPI::Cursor::voice |
|
readwrite |
Current voice (track % 4)
The documentation for this class was generated from the following files: