MuseScore  3.4
Music composition and notation
Public Member Functions | Properties | List of all members
Ms::PluginAPI::Score Class Reference

#include <score.h>

Inheritance diagram for Ms::PluginAPI::Score:
Inheritance graph
[legend]
Collaboration diagram for Ms::PluginAPI::Score:
Collaboration graph
[legend]

Public Member Functions

 Score (Ms::Score *s=nullptr, Ownership o=Ownership::SCORE)
 
Ms::Scorescore ()
 
const Ms::Scorescore () const
 
QString composer ()
 
int duration ()
 
int harmonyCount ()
 
bool hasHarmonies ()
 
bool hasLyrics ()
 
int keysig ()
 
int lyricCount ()
 
QString lyricist ()
 
QString title ()
 
Ms::PluginAPI::Selectionselection ()
 
Q_INVOKABLE QString metaTag (const QString &tag) const
 Returns as a string the metatag named tag. More...
 
Q_INVOKABLE void setMetaTag (const QString &tag, const QString &val)
 Sets the metatag named tag to val. More...
 
Q_INVOKABLE void appendMeasures (int n)
 Appends a number of measures to this score. More...
 
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. More...
 
Q_INVOKABLE Ms::PluginAPI::SegmentfirstSegment ()
 
SegmentlastSegment ()
 
MeasurefirstMeasure ()
 
MeasurefirstMeasureMM ()
 
MeasurelastMeasure ()
 
MeasurelastMeasureMM ()
 
QString name () const
 
void setName (const QString &name)
 
Q_INVOKABLE QString extractLyrics ()
 
int nmeasures () const
 
int npages () const
 
int nstaves () const
 
int ntracks () const
 
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...
 
QString mscoreVersion ()
 
QString mscoreRevision ()
 
QQmlListProperty< Partparts ()
 
QQmlListProperty< Excerptexcerpts ()
 
- Public Member Functions inherited from Ms::PluginAPI::ScoreElement
 ScoreElement (Ms::ScoreElement *_e=nullptr, Ownership own=Ownership::PLUGIN)
 
 ScoreElement (const ScoreElement &)=delete
 
ScoreElementoperator= (const ScoreElement &)=delete
 
virtual ~ScoreElement ()
 
Ownership ownership () const
 
void setOwnership (Ownership o)
 
Ms::ScoreElementelement ()
 
const Ms::ScoreElementelement () const
 
QString name () const
 
int type () const
 
QVariant get (Ms::Pid pid) const
 
void set (Ms::Pid pid, QVariant val)
 
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) More...
 
Ms::PluginAPI::Measure firstMeasure
 First measure of the score (read only) More...
 
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) More...
 
Ms::PluginAPI::Measure lastMeasureMM
 Last multimeasure rest measure of the score (read only). More...
 
Ms::PluginAPI::Segment lastSegment
 Last score segment (read only) More...
 
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) More...
 
int npages
 Number of pages (read only) More...
 
int nstaves
 Number of staves (read only) More...
 
int ntracks
 Number of tracks (nstaves * 4) (read only) More...
 
QQmlListProperty< Ms::PluginAPI::Partparts
 The list of parts. More...
 
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) More...
 
QString mscoreRevision
 MuseScore revision the score has been last saved with (includes autosave) (read only) More...
 
Ms::PluginAPI::Selection selection
 Current selections for the score. More...
 
- Properties inherited from Ms::PluginAPI::ScoreElement
int type
 Type of this element. More...
 
QString name
 Name of this element's type, not localized. More...
 

Additional Inherited Members

- Protected Attributes inherited from Ms::PluginAPI::ScoreElement
Ms::ScoreElement *const e
 

Constructor & Destructor Documentation

◆ Score()

Ms::PluginAPI::Score::Score ( Ms::Score s = nullptr,
Ownership  o = Ownership::SCORE 
)
inline

Member Function Documentation

◆ addText()

void Ms::PluginAPI::Score::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.

◆ appendMeasures()

Q_INVOKABLE void Ms::PluginAPI::Score::appendMeasures ( int  n)
inline

Appends a number of measures to this score.

◆ composer()

QString Ms::PluginAPI::Score::composer ( )
inline

◆ createPlayEvents()

Q_INVOKABLE void Ms::PluginAPI::Score::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

◆ duration()

int Ms::PluginAPI::Score::duration ( )
inline

◆ endCmd()

Q_INVOKABLE void Ms::PluginAPI::Score::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.

◆ excerpts()

QQmlListProperty<Excerpt> Ms::PluginAPI::Score::excerpts ( )
inline

◆ extractLyrics()

Q_INVOKABLE QString Ms::PluginAPI::Score::extractLyrics ( )
inline

◆ firstMeasure()

Measure* Ms::PluginAPI::Score::firstMeasure ( )

◆ firstMeasureMM()

Measure* Ms::PluginAPI::Score::firstMeasureMM ( )

◆ firstSegment()

Segment * Ms::PluginAPI::Score::firstSegment ( )

◆ harmonyCount()

int Ms::PluginAPI::Score::harmonyCount ( )
inline

◆ hasHarmonies()

bool Ms::PluginAPI::Score::hasHarmonies ( )
inline

◆ hasLyrics()

bool Ms::PluginAPI::Score::hasLyrics ( )
inline

◆ keysig()

int Ms::PluginAPI::Score::keysig ( )
inline

◆ lastMeasure()

Measure* Ms::PluginAPI::Score::lastMeasure ( )

◆ lastMeasureMM()

Measure* Ms::PluginAPI::Score::lastMeasureMM ( )

◆ lastSegment()

Segment* Ms::PluginAPI::Score::lastSegment ( )

◆ lyricCount()

int Ms::PluginAPI::Score::lyricCount ( )
inline

◆ lyricist()

QString Ms::PluginAPI::Score::lyricist ( )
inline

◆ metaTag()

Q_INVOKABLE QString Ms::PluginAPI::Score::metaTag ( const QString &  tag) const
inline

Returns as a string the metatag named tag.

◆ mscoreRevision()

QString Ms::PluginAPI::Score::mscoreRevision ( )
inline

◆ mscoreVersion()

QString Ms::PluginAPI::Score::mscoreVersion ( )
inline

◆ name()

QString Ms::PluginAPI::Score::name ( ) const
inline

◆ newCursor()

Cursor * Ms::PluginAPI::Score::newCursor ( )

Creates and returns a cursor to be used to navigate in the score.

◆ nmeasures()

int Ms::PluginAPI::Score::nmeasures ( ) const
inline

◆ npages()

int Ms::PluginAPI::Score::npages ( ) const
inline

◆ nstaves()

int Ms::PluginAPI::Score::nstaves ( ) const
inline

◆ ntracks()

int Ms::PluginAPI::Score::ntracks ( ) const
inline

◆ parts()

QQmlListProperty<Part> Ms::PluginAPI::Score::parts ( )
inline

◆ score() [1/2]

Ms::Score* Ms::PluginAPI::Score::score ( )
inline

◆ score() [2/2]

const Ms::Score* Ms::PluginAPI::Score::score ( ) const
inline

◆ selection()

Ms::PluginAPI::Selection* Ms::PluginAPI::Score::selection ( )
inline

◆ setMetaTag()

Q_INVOKABLE void Ms::PluginAPI::Score::setMetaTag ( const QString &  tag,
const QString &  val 
)
inline

Sets the metatag named tag to val.

◆ setName()

void Ms::PluginAPI::Score::setName ( const QString &  name)
inline

◆ startCmd()

void Ms::PluginAPI::Score::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.

◆ title()

QString Ms::PluginAPI::Score::title ( )
inline

Property Documentation

◆ composer

QString Ms::PluginAPI::Score::composer
read

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


Since
MuseScore 3.2

◆ duration

int Ms::PluginAPI::Score::duration
read

Duration of score in seconds (read only).


Since
MuseScore 3.2

◆ excerpts

QQmlListProperty<Ms::PluginAPI::Excerpt> Ms::PluginAPI::Score::excerpts
read

List of the excerpts (linked parts) (read only)

◆ firstMeasure

Measure * Ms::PluginAPI::Score::firstMeasure
read

First measure of the score (read only)

◆ firstMeasureMM

Measure * Ms::PluginAPI::Score::firstMeasureMM
read

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


Since
MuseScore 3.2

◆ harmonyCount

int Ms::PluginAPI::Score::harmonyCount
read

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


Since
MuseScore 3.2

◆ hasHarmonies

bool Ms::PluginAPI::Score::hasHarmonies
read

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


Since
MuseScore 3.2

◆ hasLyrics

bool Ms::PluginAPI::Score::hasLyrics
read

Whether score has lyrics (read only).


Since
MuseScore 3.2

◆ keysig

int Ms::PluginAPI::Score::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

◆ lastMeasure

Measure * Ms::PluginAPI::Score::lastMeasure
read

Last measure of the score (read only)

◆ lastMeasureMM

Measure * Ms::PluginAPI::Score::lastMeasureMM
read

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


Since
MuseScore 3.2

◆ lastSegment

Segment * Ms::PluginAPI::Score::lastSegment
read

Last score segment (read only)

◆ lyricCount

int Ms::PluginAPI::Score::lyricCount
read

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


Since
MuseScore 3.2

◆ lyricist

QString Ms::PluginAPI::Score::lyricist
read

Lyricist of score, as taken from the score properties.


Since
MuseScore 3.2

◆ mscoreRevision

QString Ms::PluginAPI::Score::mscoreRevision
read

MuseScore revision the score has been last saved with (includes autosave) (read only)

◆ mscoreVersion

QString Ms::PluginAPI::Score::mscoreVersion
read

MuseScore version the score has been last saved with (includes autosave) (read only)

◆ nmeasures

int Ms::PluginAPI::Score::nmeasures
read

Number of measures (read only)

◆ npages

int Ms::PluginAPI::Score::npages
read

Number of pages (read only)

◆ nstaves

int Ms::PluginAPI::Score::nstaves
read

Number of staves (read only)

◆ ntracks

int Ms::PluginAPI::Score::ntracks
read

Number of tracks (nstaves * 4) (read only)

◆ parts

QQmlListProperty<Ms::PluginAPI::Part> Ms::PluginAPI::Score::parts
read

The list of parts.

◆ scoreName

QString Ms::PluginAPI::Score::scoreName
readwrite

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


Since
MuseScore 3.2

◆ selection

Ms::PluginAPI::Selection Ms::PluginAPI::Score::selection
read

Current selections for the score.

Since
MuseScore 3.3

◆ title

QString Ms::PluginAPI::Score::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: