MuseScore  3.4
Music composition and notation
part.h
Go to the documentation of this file.
1 //=============================================================================
2 // MuseScore
3 // Music Composition & Notation
4 //
5 // Copyright (C) 2019 Werner Schweer and others
6 //
7 // This program is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License version 2
9 // as published by the Free Software Foundation and appearing in
10 // the file LICENCE.GPL
11 //=============================================================================
12 
13 #ifndef __PLUGIN_API_PART_H__
14 #define __PLUGIN_API_PART_H__
15 
16 #include "scoreelement.h"
17 #include "libmscore/part.h"
18 
19 namespace Ms {
20 namespace PluginAPI {
21 
22 //---------------------------------------------------------
23 // Part
24 //---------------------------------------------------------
25 
27  Q_OBJECT
28  Q_PROPERTY(int startTrack READ startTrack)
29  Q_PROPERTY(int endTrack READ endTrack)
31  Q_PROPERTY(QString instrumentId READ instrumentId)
33  Q_PROPERTY(int harmonyCount READ harmonyCount)
35  Q_PROPERTY(bool hasDrumStaff READ hasDrumStaff)
37  Q_PROPERTY(bool hasPitchedStaff READ hasPitchedStaff)
39  Q_PROPERTY(bool hasTabStaff READ hasTabStaff)
41  Q_PROPERTY(int lyricCount READ lyricCount)
43  Q_PROPERTY(int midiChannel READ midiChannel)
45  Q_PROPERTY(int midiProgram READ midiProgram)
49  Q_PROPERTY(QString longName READ longName)
53  Q_PROPERTY(QString shortName READ shortName)
59  Q_PROPERTY(QString partName READ partName)
63  Q_PROPERTY(bool show READ show)
64 
65  public:
67  Part(Ms::Part* p = nullptr, Ownership o = Ownership::SCORE)
68  : ScoreElement(p, o) {}
69 
70  Ms::Part* part() { return toPart(e); }
71  const Ms::Part* part() const { return toPart(e); }
72 
73  int startTrack() const { return part()->startTrack(); }
74  int endTrack() const { return part()->endTrack(); }
75  QString instrumentId() const { return part()->instrument()->instrumentId(); }
76  int harmonyCount() const { return part()->harmonyCount(); }
77  bool hasPitchedStaff() const { return part()->hasPitchedStaff(); }
78  bool hasTabStaff() const { return part()->hasTabStaff(); }
79  bool hasDrumStaff() const { return part()->hasDrumStaff(); }
80  int lyricCount() const { return part()->lyricCount(); }
81  int midiChannel() const { return part()->midiChannel(); }
82  int midiProgram() const { return part()->midiProgram(); }
83  QString longName() const { return part()->longName(); }
84  QString shortName() const { return part()->shortName(); }
85  QString partName() const { return part()->partName(); }
86  bool show() const { return part()->show(); }
88  };
89 } // namespace PluginAPI
90 } // namespace Ms
91 #endif
Base class for most of object wrappers exposed to QML.
Definition: scoreelement.h:42
QString partName() const
Definition: part.h:85
QString shortName(const Fraction &tick={ -1, 1 }) const
Definition: part.cpp:376
int midiChannel() const
Definition: part.cpp:251
Ms::Part * part()
Definition: part.h:70
QString longName(const Fraction &tick={ -1, 1 }) const
Definition: part.cpp:357
Definition: part.h:26
bool hasPitchedStaff() const
Definition: part.h:77
bool hasTabStaff() const
Definition: part.h:78
QString partName() const
Definition: part.h:117
Ms::ScoreElement *const e
Definition: scoreelement.h:60
int lyricCount() const
Definition: part.h:80
int lyricCount() const
Definition: part.cpp:507
int startTrack() const
Definition: part.h:73
bool hasPitchedStaff() const
Definition: part.cpp:546
const Ms::Part * part() const
Definition: part.h:71
Ownership
Definition: scoreelement.h:32
int harmonyCount() const
Definition: part.h:76
int endTrack() const
Definition: part.cpp:468
int harmonyCount() const
Definition: part.cpp:527
Instrument * instrument(Fraction={ -1, 1 })
Definition: part.cpp:321
Definition: aeolus.cpp:26
QString instrumentId()
Definition: instrument.h:292
int midiProgram() const
Definition: part.cpp:242
QString instrumentId() const
Definition: part.h:75
QString shortName() const
Definition: part.h:84
bool hasDrumStaff() const
Definition: part.cpp:576
int midiChannel() const
Definition: part.h:81
bool hasTabStaff() const
Definition: part.cpp:561
int startTrack() const
Definition: part.cpp:459
bool show() const
Definition: part.h:104
bool show() const
Definition: part.h:86
bool hasDrumStaff() const
Definition: part.h:79
QString longName() const
Definition: part.h:83
int midiProgram() const
Definition: part.h:82
int endTrack() const
Definition: part.h:74
Definition: part.h:47