MuseScore Plugins  3.5
Plugins API for MuseScore
Public Member Functions | Properties | List of all members
Score Class Reference
Inheritance diagram for Score:
Inheritance graph
[legend]
Collaboration diagram for Score:
Collaboration graph
[legend]

Public Member Functions

Q_INVOKABLE QString metaTag (const QString &tag) const
 Returns as a string the metatag named tag.
 
Q_INVOKABLE void setMetaTag (const QString &tag, const QString &val)
 Sets the metatag named tag to val.
 
Q_INVOKABLE void appendPart (const QString &instrumentId)
 Appends a part with the instrument defined by instrumentId to this score. More...
 
Q_INVOKABLE void appendPartByMusicXmlId (const QString &instrumentMusicXmlId)
 Appends a part with the instrument defined by the given MusicXML ID to this score. More...
 
Q_INVOKABLE void appendMeasures (int n)
 Appends a number of measures to this score.
 
Q_INVOKABLE void addText (const QString &type, const QString &text)
 Adds a header text to the score. More...
 
Q_INVOKABLE Ms::PluginAPI::CursornewCursor ()
 Creates and returns a cursor to be used to navigate in the score.
 
Q_INVOKABLE Ms::PluginAPI::SegmentfirstSegment ()
 
Q_INVOKABLE QString extractLyrics ()
 
Q_INVOKABLE void startCmd ()
 For "dock" type plugins: to be used before score modifications to make them undoable. More...
 
Q_INVOKABLE void endCmd (bool rollback=false)
 For "dock" type plugins: to be used after score modifications to make them undoable. More...
 
Q_INVOKABLE void createPlayEvents ()
 Create PlayEvents for all notes based on ornamentation. More...
 
- Public Member Functions inherited from ScoreElement
Q_INVOKABLE QString userName () const
 Human-readable element type name. More...
 
Q_INVOKABLE bool is (Ms::PluginAPI::ScoreElement *other)
 Checks whether two variables represent the same object. More...
 

Properties

QString composer
 Composer of the score, as taken from the score properties (read only). More...
 
int duration
 Duration of score in seconds (read only). More...
 
QQmlListProperty< Ms::PluginAPI::Excerptexcerpts
 List of the excerpts (linked parts) (read only)
 
Ms::PluginAPI::Measure firstMeasure
 First measure of the score (read only)
 
Ms::PluginAPI::Measure firstMeasureMM
 First multimeasure rest measure of the score (read only). More...
 
int harmonyCount
 Number of harmony items (chord symbols) in the score (read only). More...
 
bool hasHarmonies
 Whether score has harmonies (chord symbols) (read only). More...
 
bool hasLyrics
 Whether score has lyrics (read only). More...
 
int keysig
 Key signature at the start of the score, in number of accidentals, negative for flats, postitive for sharps (read only). More...
 
Ms::PluginAPI::Measure lastMeasure
 Last measure of the score (read only)
 
Ms::PluginAPI::Measure lastMeasureMM
 Last multimeasure rest measure of the score (read only). More...
 
Ms::PluginAPI::Segment lastSegment
 Last score segment (read only)
 
int lyricCount
 Number of lyrics items (syllables) in the score (read only). More...
 
QString scoreName
 Name of the score, without path leading to it and extension. More...
 
int nmeasures
 Number of measures (read only)
 
int npages
 Number of pages (read only)
 
int nstaves
 Number of staves (read only)
 
int ntracks
 Number of tracks (nstaves * 4) (read only)
 
QQmlListProperty< Ms::PluginAPI::Partparts
 The list of parts.
 
QString lyricist
 Lyricist of score, as taken from the score properties. More...
 
QString title
 Title of score, as taken from the score properties' workTitle (read only). More...
 
QString mscoreVersion
 MuseScore version the score has been last saved with (includes autosave) (read only)
 
QString mscoreRevision
 MuseScore revision the score has been last saved with (includes autosave) (read only)
 
Ms::PluginAPI::Selection selection
 Current selections for the score. More...
 
Ms::PluginAPI::MStyle style
 Style settings for this score. More...
 
int pageNumberOffset
 Page numbering offset. More...
 
QQmlListProperty< Ms::PluginAPI::Staffstaves
 List of staves in this score. More...
 
- Properties inherited from ScoreElement
int type
 Type of this element. More...
 
QString name
 Name of this element's type, not localized. More...
 

Member Function Documentation

◆ addText()

void addText ( const QString &  type,
const QString &  txt 
)

Adds a header text to the score.

Parameters
typeOne of the following values:
  • "title"
  • "subtitle"
  • "composer"
  • "lyricist"
  • Any other value corresponds to default text style.
txtText to be added.

◆ appendPart()

void appendPart ( const QString &  instrumentId)

Appends a part with the instrument defined by instrumentId to this score.

Parameters
instrumentId- ID of the instrument to be added, as listed in instruments.xml file.
Since
MuseScore 3.5

◆ appendPartByMusicXmlId()

void appendPartByMusicXmlId ( const QString &  instrumentMusicXmlId)

Appends a part with the instrument defined by the given MusicXML ID to this score.

Parameters
instrumentMusicXmlId- MusicXML Sound ID of the instrument to be added.
See also
Ms::PluginAPI::Part::instrumentId, Ms::PluginAPI::Instrument::instrumentId
Since
MuseScore 3.5

◆ createPlayEvents()

Q_INVOKABLE void createPlayEvents ( )
inline

Create PlayEvents for all notes based on ornamentation.

You need to call this if you are manipulating PlayEvent's so that all ornamentations are populated into Note's PlayEvent lists.

Since
3.3

◆ endCmd()

Q_INVOKABLE void endCmd ( bool  rollback = false)
inline

For "dock" type plugins: to be used after score modifications to make them undoable.

Ends an undoable command. Should be used at least once by "dock" type plugins in case they modify the score.

Parameters
rollbackIf true, reverts all the changes made since the last startCmd() invocation.

◆ startCmd()

void startCmd ( )

For "dock" type plugins: to be used before score modifications to make them undoable.

Starts an undoable command. Must be accompanied by a corresponding endCmd() call. Should be used at least once by "dock" type plugins in case they modify the score.

Property Documentation

◆ composer

QString composer
read

Composer of the score, as taken from the score properties (read only).


Since
MuseScore 3.2

◆ duration

int duration
read

Duration of score in seconds (read only).


Since
MuseScore 3.2

◆ firstMeasureMM

Measure * firstMeasureMM
read

First multimeasure rest measure of the score (read only).

See also
Measure::nextMeasureMM
Since
MuseScore 3.2

◆ harmonyCount

int harmonyCount
read

Number of harmony items (chord symbols) in the score (read only).


Since
MuseScore 3.2

◆ hasHarmonies

bool hasHarmonies
read

Whether score has harmonies (chord symbols) (read only).


Since
MuseScore 3.2

◆ hasLyrics

bool hasLyrics
read

Whether score has lyrics (read only).


Since
MuseScore 3.2

◆ keysig

int keysig
read

Key signature at the start of the score, in number of accidentals, negative for flats, postitive for sharps (read only).


Since
MuseScore 3.2

◆ lastMeasureMM

Measure * lastMeasureMM
read

Last multimeasure rest measure of the score (read only).

See also
Measure::prevMeasureMM
Since
MuseScore 3.2

◆ lyricCount

int lyricCount
read

Number of lyrics items (syllables) in the score (read only).


Since
MuseScore 3.2

◆ lyricist

QString lyricist
read

Lyricist of score, as taken from the score properties.


Since
MuseScore 3.2

◆ pageNumberOffset

int pageNumberOffset
readwrite

Page numbering offset.

The user-visible number of the given page is defined as

page.pagenumber + 1 + score.pageNumberOffset
Since
MuseScore 3.5
See also
Page::pagenumber

◆ scoreName

QString scoreName
readwrite

Name of the score, without path leading to it and extension.


Since
MuseScore 3.2

◆ selection

Ms::PluginAPI::Selection selection
read

Current selections for the score.

Since
MuseScore 3.3

◆ staves

QQmlListProperty< Staff > staves
read

List of staves in this score.

Since
MuseScore 3.5

◆ style

Style settings for this score.

Since
MuseScore 3.5

◆ title

QString title
read

Title of score, as taken from the score properties' workTitle (read only).


Since
MuseScore 3.2

The documentation for this class was generated from the following files: