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)
182 : QObject(parent), _data(*d) {}
184 QVariantList stringList()
const;
185 int frets()
const {
return _data.frets(); }
194class ChannelListProperty :
public QQmlListProperty<Channel> {
196 ChannelListProperty(Instrument* i);
198 static int count(QQmlListProperty<Channel>* l);
199 static Channel* at(QQmlListProperty<Channel>* l,
int i);
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(); }
254 ChannelListProperty channels();
Provides an access to channel properties.
Definition instrument.h:65
int reverb
Channel reverb, from 0 to 127.
Definition instrument.h:101
QString name
Name of this channel.
Definition instrument.h:72
int chorus
Channel chorus, from 0 to 127.
Definition instrument.h:94
int pan
Channel pan, from 0 to 127.
Definition instrument.h:87
int midiProgram
MIDI program number, from 0 to 127.
Definition instrument.h:115
int volume
Channel volume, from 0 to 127.
Definition instrument.h:80
bool mute
Whether this channel is muted.
Definition instrument.h:108
int midiBank
MIDI patch bank number.
Definition instrument.h:121
Definition instrument.h:207
Ms::PluginAPI::StringData * stringData
For fretted instruments, an information about this instrument's strings.
Definition instrument.h:229
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
QString longName
The long name for this instrument.
Definition instrument.h:221
QString shortName
The short name for this instrument.
Definition instrument.h:223
Main class of the plugins framework. Named as MuseScore in QML.
Definition qmlpluginapi.h:62
Definition instrument.h:158
int frets
Number of frets in this instrument.
Definition instrument.h:175
QVariantList strings
List of strings in this instrument.
Definition instrument.h:172