20 #ifndef __PLUGIN_API_INSTRUMENT_H__ 21 #define __PLUGIN_API_INSTRUMENT_H__ 23 #include "scoreelement.h" 24 #include "libmscore/instrument.h" 68 Ms::Channel* _channel;
87 Q_PROPERTY(
int pan READ
pan WRITE setPan)
125 void setMidiBankAndProgram(
int bank,
int program,
bool setUserBankController);
130 : QObject(parent), _channel(ch), _part(p) {}
132 QString
name()
const {
return _channel->name(); }
134 int volume()
const {
return _channel->volume(); }
135 void setVolume(
int val) { activeChannel()->setVolume(qBound(0, val, 127)); }
136 int pan()
const {
return _channel->pan(); }
137 void setPan(
int val) { activeChannel()->setPan(qBound(0, val, 127)); }
138 int chorus()
const {
return _channel->chorus(); }
139 void setChorus(
int val) { activeChannel()->setChorus(qBound(0, val, 127)); }
140 int reverb()
const {
return _channel->reverb(); }
141 void setReverb(
int val) { activeChannel()->setReverb(qBound(0, val, 127)); }
143 bool mute()
const {
return _channel->mute(); }
144 void setMute(
bool val) { activeChannel()->setMute(val); }
146 int midiProgram()
const {
return _channel->program(); }
147 void setMidiProgram(
int prog);
148 int midiBank()
const {
return _channel->bank(); }
149 void setMidiBank(
int bank);
172 Q_PROPERTY(QVariantList strings READ stringList)
175 Q_PROPERTY(
int frets READ frets)
182 : QObject(parent), _data(*d) {}
184 QVariantList stringList()
const;
185 int frets()
const {
return _data.frets(); }
194 class ChannelListProperty :
public QQmlListProperty<Channel> {
198 static int count(QQmlListProperty<Channel>* l);
199 static Channel* at(QQmlListProperty<Channel>* l,
int i);
216 Q_PROPERTY(QString instrumentId READ instrumentId)
221 Q_PROPERTY(QString longName READ longName)
223 Q_PROPERTY(QString shortName READ shortName)
241 : QObject(), _instrument(i), _part(p) {}
243 Ms::Instrument* instrument() {
return _instrument; };
244 const Ms::Instrument* instrument()
const {
return _instrument; };
246 Ms::Part* part() {
return _part; }
248 QString instrumentId()
const {
return instrument()->
instrumentId(); }
249 QString longName()
const;
250 QString shortName()
const;
252 StringData* stringData() {
return customWrap<StringData>(instrument()->stringData()); }
254 ChannelListProperty channels();
Provides an access to channel properties.
Definition: instrument.h:65
int midiProgram
MIDI program number, from 0 to 127.
Definition: instrument.h:115
int midiBank
MIDI patch bank number.
Definition: instrument.h:121
Q_INVOKABLE bool is(Ms::PluginAPI::Instrument *other)
Checks whether two variables represent the same object.
Definition: instrument.h:258
QString instrumentId
The string identifier (MusicXML Sound ID) for this instrument.
Definition: instrument.h:216
Definition: instrument.h:158
QString name
Name of this channel.
Definition: instrument.h:72
int pan
Channel pan, from 0 to 127.
Definition: instrument.h:87
int chorus
Channel chorus, from 0 to 127.
Definition: instrument.h:94
int volume
Channel volume, from 0 to 127.
Definition: instrument.h:80
Definition: cursor.cpp:30
bool mute
Whether this channel is muted.
Definition: instrument.h:108
Main class of the plugins framework. Named as MuseScore in QML.
Definition: qmlpluginapi.h:62
Definition: instrument.h:207
int reverb
Channel reverb, from 0 to 127.
Definition: instrument.h:101