13 #ifndef __QMLPLUGINAPI_H__ 14 #define __QMLPLUGINAPI_H__ 17 #include "../qmlplugin.h" 19 #include "libmscore/harmony.h" 20 #include "libmscore/lyrics.h" 21 #include "libmscore/mscore.h" 22 #include "libmscore/utils.h" 23 #include "libmscore/score.h" 24 #include "libmscore/spanner.h" 39 class FractionWrapper;
43 #define DECLARE_API_ENUM(qmlName, cppName, enumName) \ 44 Q_PROPERTY(Ms::PluginAPI::Enum* qmlName READ get_##cppName CONSTANT) \ 45 static Enum* cppName; \ 46 static Enum* get_##cppName() { \ 48 cppName = wrapEnum<enumName>(); \ 104 DECLARE_API_ENUM(
Beam, beamModeEnum,
Ms::Beam::Mode )
114 DECLARE_API_ENUM(
Lyrics, lyricsSyllabicEnum,
Ms::Lyrics::Syllabic )
135 DECLARE_API_ENUM(
Tid, tidEnum,
Ms::Tid )
138 DECLARE_API_ENUM(
Align, alignEnum,
Ms::Align )
162 DECLARE_API_ENUM( Spanner, spannerAnchorEnum,
Ms::Spanner::Anchor )
165 DECLARE_API_ENUM(
SymId, symIdEnum,
Ms::SymId )
239 static
void registerQmlTypes();
241 void runPlugin()
override { emit
run(); }
242 void endCmd(
const QMap<QString, QVariant>& stateInfo)
override { emit
scoreStateChanged(stateInfo); }
245 QQmlListProperty<Score>
scores();
248 Q_INVOKABLE
Ms::PluginAPI::Score* newScore(
const QString& name,
const QString& part,
int measures);
251 Q_INVOKABLE
void cmd(
const QString&);
258 Q_INVOKABLE
void log(
const QString&);
259 Q_INVOKABLE
void logn(
const QString&);
260 Q_INVOKABLE
void log2(
const QString&,
const QString&);
261 Q_INVOKABLE
void openLog(
const QString&);
262 Q_INVOKABLE
void closeLog();
267 #undef DECLARE_API_ENUM QString description
Human-readable plugin description, displayed in Plugin Manager.
Definition: qmlpluginapi.h:71
bool requiresScore
Whether the plugin requires an existing score to run, default is true
Definition: qmlpluginapi.h:77
QString filePath
Source file path, without the file name (read only)
Definition: qmlpluginapi.h:67
SymId
Definition: sym.h:45
Ms::PluginAPI::Enum NoteHeadGroup
Contains Ms::NoteHead::Group enumeration values.
Definition: qmlpluginapi.h:155
symbols for line break, page break etc.
Definition: layoutbreak.h:27
Placement
Definition: types.h:393
Tid
Enumerates the list of built-in text substyles.
Definition: types.h:462
void run()
Indicates that the plugin was launched.
QString dockArea
Where to dock on main screen.
Definition: qmlpluginapi.h:75
Ms::PluginAPI::Enum NoteHeadType
Contains Ms::NoteHead::Type enumeration values.
Definition: qmlpluginapi.h:148
Definition: elements.h:709
Q_INVOKABLE bool writeScore(Ms::PluginAPI::Score *, const QString &name, const QString &ext)
Writes a score to a file.
Definition: qmlpluginapi.cpp:97
QQmlListProperty< Ms::PluginAPI::Score > scores
List of currently open scores (read only).
Definition: qmlpluginapi.h:96
int mscoreMajorVersion
1st part of the MuseScore version (read only)
Definition: qmlpluginapi.h:86
ElementType
Definition: types.h:34
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:114
void scoreStateChanged(const QMap< QString, QVariant > &state)
Notifies plugin about changes in score state.
Definition: elements.h:85
Direction
Definition: types.h:351
Align
Align Because the Align enum has Top = 0 and Left = 0, align() & Align::Top will always return false...
Definition: types.h:537
Ms::PluginAPI::Enum Glissando
Contains Ms::GlissandoType enumeration values.
Definition: qmlpluginapi.h:110
PlayEventType
Determines whether oranaments are automatically generated when playing a score and whether the PlayEv...
Definition: types.h:587
Ms::PluginAPI::Enum Accidental
Contains Ms::AccidentalType enumeration values.
Definition: qmlpluginapi.h:102
Ms::PluginAPI::Score curScore
Current score, if any (read only)
Definition: qmlpluginapi.h:94
Ms::PluginAPI::Enum DirectionH
Contains Ms::MScore::DirectionH enumeration values.
Definition: qmlpluginapi.h:122
QString menuPath
Path where the plugin is placed in menu.
Definition: qmlpluginapi.h:65
NoteType
Definition: types.h:324
Ms::PluginAPI::Enum NoteHeadScheme
Contains Ms::NoteHead::Scheme enumeration values.
Definition: qmlpluginapi.h:151
GlissandoStyle
Definition: types.h:371
HarmonyType
Definition: types.h:381
Ms::PluginAPI::Enum OrnamentStyle
Contains Ms::MScore::OrnamentStyle enumeration values.
Definition: qmlpluginapi.h:126
qreal mscoreDPI
(read-only)
Definition: qmlpluginapi.h:92
AccidentalType
Definition: types.h:152
Definition: cursor.cpp:30
SegmentType
Definition: types.h:424
int mscoreUpdateVersion
3rd part of the MuseScore version (read only)
Definition: qmlpluginapi.h:90
Q_INVOKABLE Ms::PluginAPI::FractionWrapper * fraction(int numerator, int denominator) const
Creates a new fraction with the given numerator and denominator.
Definition: qmlpluginapi.cpp:273
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:62
int mscoreMinorVersion
2nd part of the MuseScore version (read only)
Definition: qmlpluginapi.h:88
QString pluginType
Type may be dialog, dock, or not defined.
Definition: qmlpluginapi.h:73
int division
Number of MIDI ticks for 1/4 note (read only)
Definition: qmlpluginapi.h:82
int mscoreVersion
Complete version number of MuseScore in the form: MMmmuu (read only)
Definition: qmlpluginapi.h:84
QString version
Version of this plugin.
Definition: qmlpluginapi.h:69
Q_INVOKABLE void removeElement(Ms::PluginAPI::Element *wrapped)
Disposes of an Element and its children.
Definition: qmlpluginapi.cpp:162
Ms::PluginAPI::Enum NoteValueType
Contains Ms::Note::ValueType enumeration values.
Definition: qmlpluginapi.h:159
Fraction object available to QML plugins.
Definition: fraction.h:32
Q_INVOKABLE Ms::PluginAPI::Element * newElement(int)
Creates a new element with the given type.
Definition: qmlpluginapi.cpp:141
GlissandoType
Definition: types.h:361
Definition: elements.h:423