96 Q_PROPERTY(
int stringNumber READ inputStateString WRITE setInputStateString)
122 Ms::Score* _score =
nullptr;
125 std::unique_ptr<InputState> is;
131 void setScore(Ms::Score* s);
132 Ms::Element* currentElement()
const;
134 InputState& inputState();
135 const InputState& inputState()
const {
return const_cast<Cursor*
>(
this)->inputState(); }
138 void setSegment(Ms::Segment* seg);
140 int inputStateString()
const;
141 void setInputStateString(
int);
145 Cursor(Ms::Score* s =
nullptr);
149 void setScore(
Score* s);
152 void setTrack(
int v);
155 void setStaffIdx(
int v);
158 void setVoice(
int v);
160 int filter()
const {
return int(_filter); }
161 void setFilter(
int f) { _filter =
SegmentType(f); }
167 Segment* qmlSegment()
const;
174 int qmlKeySignature();
180 Q_INVOKABLE
bool next();
182 Q_INVOKABLE
bool prev();
183 Q_INVOKABLE
void add(Ms::PluginAPI::Element*);
185 Q_INVOKABLE
void addNote(
int pitch,
bool addToChord =
false);
187 Q_INVOKABLE
void addTuplet(Ms::PluginAPI::FractionWrapper* ratio, Ms::PluginAPI::FractionWrapper* duration);
Graphic representation of a note.
Definition note.h:235
Cursor can be used by plugins to manipulate the score.
Definition cursor.h:53
qreal tempo
Tempo at current tick, read only.
Definition cursor.h:77
Q_INVOKABLE bool prev()
Move the cursor to the previous segment.
Definition cursor.cpp:184
Q_INVOKABLE void rewindToTick(int tick)
Rewind cursor to a position defined by tick.
Definition cursor.cpp:161
RewindMode
Definition cursor.h:99
@ SELECTION_START
Rewind to the start of a selection.
Definition cursor.h:101
@ SELECTION_END
Rewind to the end of a selection.
Definition cursor.h:102
@ SCORE_START
Rewind to the start of a score.
Definition cursor.h:100
Q_INVOKABLE void addNote(int pitch, bool addToChord=false)
Adds a note to the current cursor position.
Definition cursor.cpp:377
int stringNumber
A physical string number where this cursor currently at.
Definition cursor.h:96
Q_INVOKABLE bool next()
Move the cursor to the next segment.
Definition cursor.cpp:199
Q_INVOKABLE bool nextMeasure()
Move the cursor to the first segment of the next measure.
Definition cursor.cpp:216
Q_INVOKABLE void rewind(RewindMode mode)
Rewind cursor to a certain position.
Definition cursor.cpp:116
InputStateMode inputStateMode
Behavior of input state (position, notes duration etc.) of this cursor with respect to input state of...
Definition cursor.h:120
Q_INVOKABLE void addRest()
Adds a rest to the current cursor position.
Definition cursor.cpp:401
Ms::PluginAPI::Score * score
Associated score.
Definition cursor.h:82
Ms::PluginAPI::Segment * segment
Current segment, read only.
Definition cursor.h:87
double time
Time at tick position, read only.
Definition cursor.h:74
Ms::PluginAPI::Measure * measure
Current measure, read only.
Definition cursor.h:89
Ms::PluginAPI::Element * element
Current element at track, read only.
Definition cursor.h:85
int voice
Current voice (track % 4).
Definition cursor.h:60
int keySignature
Key signature of current staff at tick pos.
Definition cursor.h:80
InputStateMode
Definition cursor.h:107
@ INPUT_STATE_INDEPENDENT
Input state of cursor is independent of score input state (default).
Definition cursor.h:108
@ INPUT_STATE_SYNC_WITH_SCORE
Input state of cursor is synchronized with score input state.
Definition cursor.h:109
Q_INVOKABLE void setDuration(int z, int n)
Set duration of the notes added by the cursor.
Definition cursor.cpp:508
int tick
MIDI tick position, read only.
Definition cursor.h:72
Q_INVOKABLE void add(Ms::PluginAPI::Element *)
Adds the given element to a score at this cursor's position.
Definition cursor.cpp:236
int track
Current track.
Definition cursor.h:56
Q_INVOKABLE void addTuplet(Ms::PluginAPI::FractionWrapper *ratio, Ms::PluginAPI::FractionWrapper *duration)
Adds a tuplet to the current cursor position.
Definition cursor.cpp:446
int staffIdx
Current staff (track / 4).
Definition cursor.h:58
int filter
Segment type filter, a bitmask from PluginAPI::PluginAPI::Segment values.
Definition cursor.h:69
Definition elements.h:781
Main class of the plugins framework. Named as MuseScore in QML.
Definition qmlpluginapi.h:62
Definition elements.h:715
Contains items exposed to the QML plugins framework.
Definition cursor.cpp:31
SegmentType
Definition types.h:436
@ ChordRest
Definition types.h:449