![]() |
MuseScore Plugins
3.5
Plugins API for MuseScore
|
Main class of the plugins framework. Named as MuseScore
in QML.
More...
Signals | |
void | run () |
Indicates that the plugin was launched. More... | |
void | scoreStateChanged (const QMap< QString, QVariant > &state) |
Notifies plugin about changes in score state. More... | |
Public Member Functions | |
Q_INVOKABLE Ms::PluginAPI::Score * | newScore (const QString &name, const QString &part, int measures) |
Q_INVOKABLE Ms::PluginAPI::Element * | newElement (int) |
Creates a new element with the given type. More... | |
Q_INVOKABLE void | removeElement (Ms::PluginAPI::Element *wrapped) |
Disposes of an Element and its children. More... | |
Q_INVOKABLE void | cmd (const QString &) |
Q_INVOKABLE bool | writeScore (Ms::PluginAPI::Score *, const QString &name, const QString &ext) |
Writes a score to a file. More... | |
Q_INVOKABLE Ms::PluginAPI::Score * | readScore (const QString &name, bool noninteractive=false) |
Reads the score from a file and opens it in a new tab. More... | |
Q_INVOKABLE void | closeScore (Ms::PluginAPI::Score *) |
Q_INVOKABLE void | log (const QString &) |
Q_INVOKABLE void | logn (const QString &) |
Q_INVOKABLE void | log2 (const QString &, const QString &) |
Q_INVOKABLE void | openLog (const QString &) |
Q_INVOKABLE void | closeLog () |
Q_INVOKABLE Ms::PluginAPI::FractionWrapper * | fraction (int numerator, int denominator) const |
Creates a new fraction with the given numerator and denominator. | |
Properties | |
QString | menuPath |
Path where the plugin is placed in menu. | |
QString | filePath |
Source file path, without the file name (read only) | |
QString | version |
Version of this plugin. | |
QString | description |
Human-readable plugin description, displayed in Plugin Manager. | |
QString | pluginType |
Type may be dialog, dock, or not defined. | |
QString | dockArea |
Where to dock on main screen. More... | |
bool | requiresScore |
Whether the plugin requires an existing score to run, default is true | |
int | division |
Number of MIDI ticks for 1/4 note (read only) More... | |
int | mscoreVersion |
Complete version number of MuseScore in the form: MMmmuu (read only) | |
int | mscoreMajorVersion |
1st part of the MuseScore version (read only) | |
int | mscoreMinorVersion |
2nd part of the MuseScore version (read only) | |
int | mscoreUpdateVersion |
3rd part of the MuseScore version (read only) | |
qreal | mscoreDPI |
(read-only) | |
Ms::PluginAPI::Score | curScore |
Current score, if any (read only) | |
QQmlListProperty< Ms::PluginAPI::Score > | scores |
List of currently open scores (read only). More... | |
Ms::PluginAPI::Enum | Element |
Contains Ms::ElementType enumeration values. | |
Ms::PluginAPI::Enum | Accidental |
Contains Ms::AccidentalType enumeration values. | |
Ms::PluginAPI::Enum | Beam |
Contains Ms::Beam::Mode enumeration values. | |
Ms::PluginAPI::Enum | Placement |
Contains Ms::Placement enumeration values. More... | |
Ms::PluginAPI::Enum | Glissando |
Contains Ms::GlissandoType enumeration values. | |
Ms::PluginAPI::Enum | LayoutBreak |
Contains Ms::LayoutBreak::Type enumeration values. | |
Ms::PluginAPI::Enum | Lyrics |
Contains Ms::Lyrics::Syllabic enumeration values. | |
Ms::PluginAPI::Enum | Direction |
Contains Ms::Direction enumeration values. More... | |
Ms::PluginAPI::Enum | DirectionH |
Contains Ms::MScore::DirectionH enumeration values. More... | |
Ms::PluginAPI::Enum | OrnamentStyle |
Contains Ms::MScore::OrnamentStyle enumeration values. More... | |
Ms::PluginAPI::Enum | GlissandoStyle |
Contains Ms::GlissandoStyle enumeration values. More... | |
Ms::PluginAPI::Enum | Tid |
Contains Ms::Tid enumeration values. More... | |
Ms::PluginAPI::Enum | Align |
Contains Ms::Align enumeration values. More... | |
Ms::PluginAPI::Enum | NoteType |
Contains Ms::NoteType enumeration values. More... | |
Ms::PluginAPI::Enum | PlayEventType |
Contains Ms::PlayEventType enumeration values. More... | |
Ms::PluginAPI::Enum | NoteHeadType |
Contains Ms::NoteHead::Type enumeration values. More... | |
Ms::PluginAPI::Enum | NoteHeadScheme |
Contains Ms::NoteHead::Scheme enumeration values. More... | |
Ms::PluginAPI::Enum | NoteHeadGroup |
Contains Ms::NoteHead::Group enumeration values. More... | |
Ms::PluginAPI::Enum | NoteValueType |
Contains Ms::Note::ValueType enumeration values. More... | |
Ms::PluginAPI::Enum | Segment |
Contains Ms::SegmentType enumeration values. | |
Ms::PluginAPI::Enum | Spanner |
Ms::PluginAPI::Enum | SymId |
Contains Ms::SymId enumeration values. More... | |
Ms::PluginAPI::Enum | HarmonyType |
Contains Ms::HarmonyType enumeration values. More... | |
Main class of the plugins framework. Named as MuseScore
in QML.
This class is exposed to QML plugins framework under MuseScore
name and is the root component of each MuseScore plugin.
Element * newElement | ( | int | elementType | ) |
Creates a new element with the given type.
The element can be then added to a score via Cursor::add.
elementType | Element type, should be the value from PluginAPI::PluginAPI::Element enumeration. |
Score * readScore | ( | const QString & | name, |
bool | noninteractive = false |
||
) |
Reads the score from a file and opens it in a new tab.
name | Path to the file to be opened. |
noninteractive | Can be used to avoid a "save changes" dialog on closing a score that is either imported or was created with an older version of MuseScore. |
void removeElement | ( | Ms::PluginAPI::Element * | wrapped | ) |
|
signal |
Indicates that the plugin was launched.
Implement onRun()
function in your plugin to handle this signal.
|
signal |
Notifies plugin about changes in score state.
Called after each user (or plugin) action which may have changed a score. Implement onScoreStateChanged()
function in your plugin to handle this signal.
state
variable is available within the handler with following fields:
selectionChanged
excerptsChanged
instrumentsChanged
startLayoutTick
endLayoutTick
undoRedo
- whether this onScoreStateChanged invokation results from user undo/redo action. It is usualy not recommended to modify score from plugins in this case. Available since MuseScore 3.5.If a plugin modifies score in this handler, then it should:
Example:
bool writeScore | ( | Ms::PluginAPI::Score * | s, |
const QString & | name, | ||
const QString & | ext | ||
) |
Writes a score to a file.
s | The score which should be saved. |
name | Path where to save the score, with or without the filename extension (the extension is determined by ext parameter). |
ext | Filename extension without the dot, e.g. "mscz" or "pdf" . Determines the file format to be used. |
|
read |
Contains Ms::Align enumeration values.
Contains Ms::Direction enumeration values.
|
read |
Contains Ms::MScore::DirectionH enumeration values.
|
read |
Number of MIDI ticks for 1/4 note (read only)
|
readwrite |
Where to dock on main screen.
Possible values: left, top, bottom, right
Contains Ms::GlissandoStyle enumeration values.
Contains Ms::HarmonyType enumeration values.
|
read |
Contains Ms::NoteHead::Group enumeration values.
|
read |
Contains Ms::NoteHead::Scheme enumeration values.
|
read |
Contains Ms::NoteHead::Type enumeration values.
Contains Ms::NoteType enumeration values.
|
read |
Contains Ms::Note::ValueType enumeration values.
|
read |
Contains Ms::MScore::OrnamentStyle enumeration values.
Contains Ms::Placement enumeration values.
Contains Ms::PlayEventType enumeration values.
|
read |
List of currently open scores (read only).
|
read |
Contains Ms::SymId enumeration values.
|
read |
Contains Ms::Tid enumeration values.