13 #ifndef __QMLPLUGINAPI_H__
14 #define __QMLPLUGINAPI_H__
18 #include "../qmlplugin.h"
20 #include "libmscore/mscore.h"
21 #include "libmscore/utils.h"
40 #define DECLARE_API_ENUM(qmlName, cppName) \
41 Q_PROPERTY(Ms::PluginAPI::Enum* qmlName READ get_##cppName CONSTANT) \
42 static Enum* cppName; \
43 static Enum* get_##cppName() { return cppName; }
86 Q_PROPERTY(QQmlListProperty<Ms::PluginAPI::Score>
scores READ
scores)
90 DECLARE_API_ENUM(
Element, elementTypeEnum )
94 DECLARE_API_ENUM(
Beam, beamModeEnum )
104 DECLARE_API_ENUM(
Lyrics, lyricsSyllabicEnum )
125 DECLARE_API_ENUM(
Tid, tidEnum )
142 DECLARE_API_ENUM(
Segment, segmentTypeEnum )
143 DECLARE_API_ENUM( Spanner, spannerAnchorEnum )
147 static
void initEnums();
158 static
void registerQmlTypes();
160 void runPlugin()
override { emit
run(); }
163 QQmlListProperty<Score>
scores();
166 Q_INVOKABLE
Ms::PluginAPI::Score* newScore(
const QString& name,
const QString& part,
int measures);
169 Q_INVOKABLE
void cmd(
const QString&);
176 Q_INVOKABLE
void log(
const QString&);
177 Q_INVOKABLE
void logn(
const QString&);
178 Q_INVOKABLE
void log2(
const QString&,
const QString&);
179 Q_INVOKABLE
void openLog(
const QString&);
180 Q_INVOKABLE
void closeLog();
185 #undef DECLARE_API_ENUM
symbols for line break, page break etc.
Definition: layoutbreak.h:27
Definition: elements.h:69
Fraction object available to QML plugins.
Definition: fraction.h:32
Start an external program. Available in QML as QProcess.
Definition: util.h:116
Main class of the plugins framework. Named as MuseScore in QML.
Definition: qmlpluginapi.h:55
void run()
Indicates that the plugin was launched.
Ms::PluginAPI::Enum * DirectionH
Contains Ms::MScore::DirectionH enumeration values.
Definition: qmlpluginapi.h:112
int mscoreMajorVersion
1st part of the MuseScore version (read only)
Definition: qmlpluginapi.h:76
bool requiresScore
Whether the plugin requires an existing score to run, default is true
Definition: qmlpluginapi.h:70
Ms::PluginAPI::Enum * Glissando
Contains Ms::GlissandoType enumeration values.
Definition: qmlpluginapi.h:100
int division
Number of MIDI ticks for 1/4 note (read only)
Definition: qmlpluginapi.h:72
Q_INVOKABLE Ms::PluginAPI::Element * newElement(int)
Creates a new element with the given type.
Definition: qmlpluginapi.cpp:168
QQmlListProperty< Ms::PluginAPI::Score > scores
List of currently open scores (read only).
Definition: qmlpluginapi.h:86
qreal mscoreDPI
(read-only)
Definition: qmlpluginapi.h:82
Q_INVOKABLE void removeElement(Ms::PluginAPI::Element *wrapped)
Disposes of an Element and its children.
Definition: qmlpluginapi.cpp:189
QString pluginType
Type may be dialog, dock, or not defined.
Definition: qmlpluginapi.h:66
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.
Definition: qmlpluginapi.cpp:141
Q_INVOKABLE Ms::PluginAPI::FractionWrapper * fraction(int numerator, int denominator) const
Creates a new fraction with the given numerator and denominator.
Definition: qmlpluginapi.cpp:308
Ms::PluginAPI::Enum * NoteValueType
Contains Ms::Note::ValueType enumeration values.
Definition: qmlpluginapi.h:140
QString description
Human-readable plugin description, displayed in Plugin Manager.
Definition: qmlpluginapi.h:64
QString dockArea
Where to dock on main screen.
Definition: qmlpluginapi.h:68
Ms::PluginAPI::Enum * OrnamentStyle
Contains Ms::MScore::OrnamentStyle enumeration values.
Definition: qmlpluginapi.h:116
int mscoreVersion
Complete version number of MuseScore in the form: MMmmuu (read only)
Definition: qmlpluginapi.h:74
Ms::PluginAPI::Enum * Accidental
Contains Ms::AccidentalType enumeration values.
Definition: qmlpluginapi.h:92
Ms::PluginAPI::Enum * NoteHeadType
Contains Ms::NoteHead::Type enumeration values.
Definition: qmlpluginapi.h:132
QString version
Version of this plugin.
Definition: qmlpluginapi.h:62
Ms::PluginAPI::Score * curScore
Current score, if any (read only)
Definition: qmlpluginapi.h:84
int mscoreUpdateVersion
3rd part of the MuseScore version (read only)
Definition: qmlpluginapi.h:80
Ms::PluginAPI::Enum * NoteHeadGroup
Contains Ms::NoteHead::Group enumeration values.
Definition: qmlpluginapi.h:136
QString filePath
Source file path, without the file name (read only)
Definition: qmlpluginapi.h:60
Q_INVOKABLE bool writeScore(Ms::PluginAPI::Score *, const QString &name, const QString &ext)
Writes a score to a file.
Definition: qmlpluginapi.cpp:124
QString menuPath
Path where the plugin is placed in menu.
Definition: qmlpluginapi.h:58
int mscoreMinorVersion
2nd part of the MuseScore version (read only)
Definition: qmlpluginapi.h:78
Definition: elements.h:474
Definition: cursor.cpp:29
NoteType
Definition: types.h:254
Direction
Definition: types.h:281
Placement
Definition: types.h:311
Tid
Enumerates the list of built-in text substyles.
Definition: types.h:370
GlissandoStyle
Definition: types.h:301