Main class of the plugins framework. Named as MuseScore
in QML.
More...
#include <qmlpluginapi.h>
|
void | run () |
| Indicates that the plugin was launched. More...
|
|
void | scoreStateChanged (const QMap< QString, QVariant > &state) |
| Notifies plugin about changes in score state. 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.
◆ PluginAPI()
Ms::PluginAPI::PluginAPI::PluginAPI |
( |
QQuickItem * |
parent = 0 | ) |
|
◆ closeLog()
void Ms::PluginAPI::PluginAPI::closeLog |
( |
| ) |
|
◆ closeScore()
◆ cmd()
void Ms::PluginAPI::PluginAPI::cmd |
( |
const QString & |
s | ) |
|
◆ curScore()
Score* Ms::PluginAPI::PluginAPI::curScore |
( |
| ) |
const |
◆ endCmd()
void Ms::PluginAPI::PluginAPI::endCmd |
( |
const QMap< QString, QVariant > & |
stateInfo | ) |
|
|
inlineoverridevirtual |
◆ fraction()
FractionWrapper * Ms::PluginAPI::PluginAPI::fraction |
( |
int |
numerator, |
|
|
int |
denominator |
|
) |
| const |
Creates a new fraction with the given numerator and denominator.
◆ get_accidentalTypeEnum()
static Enum* Ms::PluginAPI::PluginAPI::get_accidentalTypeEnum |
( |
| ) |
|
|
inlinestaticprivate |
◆ get_alignEnum()
static Enum* Ms::PluginAPI::PluginAPI::get_alignEnum |
( |
| ) |
|
|
inlinestaticprivate |
◆ get_beamModeEnum()
static Enum* Ms::PluginAPI::PluginAPI::get_beamModeEnum |
( |
| ) |
|
|
inlinestaticprivate |
◆ get_directionEnum()
static Enum* Ms::PluginAPI::PluginAPI::get_directionEnum |
( |
| ) |
|
|
inlinestaticprivate |
◆ get_directionHEnum()
static Enum* Ms::PluginAPI::PluginAPI::get_directionHEnum |
( |
| ) |
|
|
inlinestaticprivate |
◆ get_elementTypeEnum()
static Enum* Ms::PluginAPI::PluginAPI::get_elementTypeEnum |
( |
| ) |
|
|
inlinestaticprivate |
◆ get_glissandoStyleEnum()
static Enum* Ms::PluginAPI::PluginAPI::get_glissandoStyleEnum |
( |
| ) |
|
|
inlinestaticprivate |
◆ get_glissandoTypeEnum()
static Enum* Ms::PluginAPI::PluginAPI::get_glissandoTypeEnum |
( |
| ) |
|
|
inlinestaticprivate |
◆ get_layoutBreakTypeEnum()
static Enum* Ms::PluginAPI::PluginAPI::get_layoutBreakTypeEnum |
( |
| ) |
|
|
inlinestaticprivate |
◆ get_lyricsSyllabicEnum()
static Enum* Ms::PluginAPI::PluginAPI::get_lyricsSyllabicEnum |
( |
| ) |
|
|
inlinestaticprivate |
◆ get_noteHeadGroupEnum()
static Enum* Ms::PluginAPI::PluginAPI::get_noteHeadGroupEnum |
( |
| ) |
|
|
inlinestaticprivate |
◆ get_noteHeadTypeEnum()
static Enum* Ms::PluginAPI::PluginAPI::get_noteHeadTypeEnum |
( |
| ) |
|
|
inlinestaticprivate |
◆ get_noteTypeEnum()
static Enum* Ms::PluginAPI::PluginAPI::get_noteTypeEnum |
( |
| ) |
|
|
inlinestaticprivate |
◆ get_noteValueTypeEnum()
static Enum* Ms::PluginAPI::PluginAPI::get_noteValueTypeEnum |
( |
| ) |
|
|
inlinestaticprivate |
◆ get_ornamentStyleEnum()
static Enum* Ms::PluginAPI::PluginAPI::get_ornamentStyleEnum |
( |
| ) |
|
|
inlinestaticprivate |
◆ get_placementEnum()
static Enum* Ms::PluginAPI::PluginAPI::get_placementEnum |
( |
| ) |
|
|
inlinestaticprivate |
◆ get_playEventTypeEnum()
static Enum* Ms::PluginAPI::PluginAPI::get_playEventTypeEnum |
( |
| ) |
|
|
inlinestaticprivate |
◆ get_segmentTypeEnum()
static Enum* Ms::PluginAPI::PluginAPI::get_segmentTypeEnum |
( |
| ) |
|
|
inlinestaticprivate |
◆ get_spannerAnchorEnum()
static Enum* Ms::PluginAPI::PluginAPI::get_spannerAnchorEnum |
( |
| ) |
|
|
inlinestaticprivate |
◆ get_tidEnum()
static Enum* Ms::PluginAPI::PluginAPI::get_tidEnum |
( |
| ) |
|
|
inlinestaticprivate |
◆ initEnums()
void Ms::PluginAPI::PluginAPI::initEnums |
( |
| ) |
|
|
staticprivate |
◆ log()
void Ms::PluginAPI::PluginAPI::log |
( |
const QString & |
txt | ) |
|
◆ log2()
void Ms::PluginAPI::PluginAPI::log2 |
( |
const QString & |
txt, |
|
|
const QString & |
txt2 |
|
) |
| |
◆ logn()
void Ms::PluginAPI::PluginAPI::logn |
( |
const QString & |
txt | ) |
|
◆ newElement()
Element * Ms::PluginAPI::PluginAPI::newElement |
( |
int |
elementType | ) |
|
Creates a new element with the given type.
The element can be then added to a score via Cursor::add.
- Parameters
-
◆ newQProcess()
MsProcess * Ms::PluginAPI::PluginAPI::newQProcess |
( |
| ) |
|
Not enabled currently (so excluded from plugin docs)
◆ newScore()
Score * Ms::PluginAPI::PluginAPI::newScore |
( |
const QString & |
name, |
|
|
const QString & |
part, |
|
|
int |
measures |
|
) |
| |
◆ openLog()
void Ms::PluginAPI::PluginAPI::openLog |
( |
const QString & |
name | ) |
|
◆ readScore()
Score * Ms::PluginAPI::PluginAPI::readScore |
( |
const QString & |
name, |
|
|
bool |
noninteractive = false |
|
) |
| |
Reads the score from a file and opens it in a new tab.
- Parameters
-
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. |
◆ registerQmlTypes()
void Ms::PluginAPI::PluginAPI::registerQmlTypes |
( |
| ) |
|
|
static |
◆ removeElement()
◆ run
void Ms::PluginAPI::PluginAPI::run |
( |
| ) |
|
|
signal |
Indicates that the plugin was launched.
Implement onRun()
function in your plugin to handle this signal.
◆ runPlugin()
void Ms::PluginAPI::PluginAPI::runPlugin |
( |
| ) |
|
|
inlineoverridevirtual |
◆ scores()
QQmlListProperty<Score> Ms::PluginAPI::PluginAPI::scores |
( |
| ) |
|
◆ scoreStateChanged
void Ms::PluginAPI::PluginAPI::scoreStateChanged |
( |
const QMap< QString, QVariant > & |
state | ) |
|
|
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
If a plugin modifies score in this handler, then it should:
- enclose all modifications within Score::startCmd() / Score::endCmd()
- take care of preventing an infinite recursion, as plugin-originated changes will trigger this signal again after calling Score::endCmd()
Example:
import QtQuick 2.0
import MuseScore 3.0
MuseScore {
menuPath:
"Plugins.selectionChangeExample" implicitHeight: 75
implicitWidth: 150
id: pitchLabel
anchors.fill: parent
}
onScoreStateChanged: {
if (state.selectionChanged) {
pitchLabel.text = el.pitch;
else
pitchLabel.text = "no note selected";
}
}
}
- Warning
- This functionality is considered experimental. This API may change in future versions of MuseScore.
- Since
- MuseScore 3.3
◆ writeScore()
bool Ms::PluginAPI::PluginAPI::writeScore |
( |
Ms::PluginAPI::Score * |
s, |
|
|
const QString & |
name, |
|
|
const QString & |
ext |
|
) |
| |
Writes a score to a file.
- Parameters
-
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. |
◆ accidentalTypeEnum
Enum * Ms::PluginAPI::PluginAPI::accidentalTypeEnum |
|
staticprivate |
◆ alignEnum
Enum * Ms::PluginAPI::PluginAPI::alignEnum |
|
staticprivate |
◆ beamModeEnum
Enum * Ms::PluginAPI::PluginAPI::beamModeEnum |
|
staticprivate |
◆ directionEnum
Enum * Ms::PluginAPI::PluginAPI::directionEnum |
|
staticprivate |
◆ directionHEnum
Enum * Ms::PluginAPI::PluginAPI::directionHEnum |
|
staticprivate |
◆ elementTypeEnum
Enum * Ms::PluginAPI::PluginAPI::elementTypeEnum |
|
staticprivate |
◆ glissandoStyleEnum
Enum * Ms::PluginAPI::PluginAPI::glissandoStyleEnum |
|
staticprivate |
◆ glissandoTypeEnum
Enum * Ms::PluginAPI::PluginAPI::glissandoTypeEnum |
|
staticprivate |
◆ layoutBreakTypeEnum
Enum * Ms::PluginAPI::PluginAPI::layoutBreakTypeEnum |
|
staticprivate |
◆ logFile
QFile Ms::PluginAPI::PluginAPI::logFile |
|
private |
◆ lyricsSyllabicEnum
Enum * Ms::PluginAPI::PluginAPI::lyricsSyllabicEnum |
|
staticprivate |
◆ noteHeadGroupEnum
Enum * Ms::PluginAPI::PluginAPI::noteHeadGroupEnum |
|
staticprivate |
◆ noteHeadTypeEnum
Enum * Ms::PluginAPI::PluginAPI::noteHeadTypeEnum |
|
staticprivate |
◆ noteTypeEnum
Enum * Ms::PluginAPI::PluginAPI::noteTypeEnum |
|
staticprivate |
◆ noteValueTypeEnum
Enum * Ms::PluginAPI::PluginAPI::noteValueTypeEnum |
|
staticprivate |
◆ ornamentStyleEnum
Enum * Ms::PluginAPI::PluginAPI::ornamentStyleEnum |
|
staticprivate |
◆ placementEnum
Enum * Ms::PluginAPI::PluginAPI::placementEnum |
|
staticprivate |
◆ playEventTypeEnum
Enum * Ms::PluginAPI::PluginAPI::playEventTypeEnum |
|
staticprivate |
◆ segmentTypeEnum
Enum * Ms::PluginAPI::PluginAPI::segmentTypeEnum |
|
staticprivate |
◆ spannerAnchorEnum
Enum * Ms::PluginAPI::PluginAPI::spannerAnchorEnum |
|
staticprivate |
◆ tidEnum
Enum * Ms::PluginAPI::PluginAPI::tidEnum |
|
staticprivate |
◆ Accidental
◆ Align
◆ Beam
◆ curScore
Score * Ms::PluginAPI::PluginAPI::curScore |
|
read |
Current score, if any (read only)
◆ description
QString Ms::PluginAPI::PluginAPI::description |
|
readwrite |
Human-readable plugin description, displayed in Plugin Manager.
◆ Direction
◆ DirectionH
◆ division
int Ms::PluginAPI::PluginAPI::division |
|
read |
Number of MIDI ticks for 1/4 note (read only)
- See also
- ticklength
◆ dockArea
QString Ms::PluginAPI::PluginAPI::dockArea |
|
readwrite |
Where to dock on main screen.
Possible values: left, top, bottom, right
◆ Element
◆ filePath
QString Ms::PluginAPI::PluginAPI::filePath |
|
read |
Source file path, without the file name (read only)
◆ Glissando
◆ GlissandoStyle
◆ LayoutBreak
◆ Lyrics
◆ menuPath
QString Ms::PluginAPI::PluginAPI::menuPath |
|
readwrite |
Path where the plugin is placed in menu.
◆ mscoreDPI
qreal Ms::PluginAPI::PluginAPI::mscoreDPI |
|
read |
◆ mscoreMajorVersion
int Ms::PluginAPI::PluginAPI::mscoreMajorVersion |
|
read |
1st part of the MuseScore version (read only)
◆ mscoreMinorVersion
int Ms::PluginAPI::PluginAPI::mscoreMinorVersion |
|
read |
2nd part of the MuseScore version (read only)
◆ mscoreUpdateVersion
int Ms::PluginAPI::PluginAPI::mscoreUpdateVersion |
|
read |
3rd part of the MuseScore version (read only)
◆ mscoreVersion
int Ms::PluginAPI::PluginAPI::mscoreVersion |
|
read |
Complete version number of MuseScore in the form: MMmmuu (read only)
◆ NoteHeadGroup
◆ NoteHeadType
◆ NoteType
◆ NoteValueType
◆ OrnamentStyle
◆ Placement
◆ PlayEventType
◆ pluginType
QString Ms::PluginAPI::PluginAPI::pluginType |
|
readwrite |
Type may be dialog, dock, or not defined.
◆ requiresScore
bool Ms::PluginAPI::PluginAPI::requiresScore |
|
readwrite |
Whether the plugin requires an existing score to run, default is true
◆ scores
QQmlListProperty< Score > Ms::PluginAPI::PluginAPI::scores |
|
read |
List of currently open scores (read only).
- Since
- MuseScore 3.2
◆ Segment
◆ Spanner
◆ Tid
◆ version
QString Ms::PluginAPI::PluginAPI::version |
|
readwrite |
The documentation for this class was generated from the following files: