1 |
// qsamplerInstrument.h |
2 |
// |
3 |
/**************************************************************************** |
4 |
Copyright (C) 2004-2007, rncbc aka Rui Nuno Capela. All rights reserved. |
5 |
|
6 |
This program is free software; you can redistribute it and/or |
7 |
modify it under the terms of the GNU General Public License |
8 |
as published by the Free Software Foundation; either version 2 |
9 |
of the License, or (at your option) any later version. |
10 |
|
11 |
This program is distributed in the hope that it will be useful, |
12 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
GNU General Public License for more details. |
15 |
|
16 |
You should have received a copy of the GNU General Public License along |
17 |
with this program; if not, write to the Free Software Foundation, Inc., |
18 |
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
19 |
|
20 |
*****************************************************************************/ |
21 |
|
22 |
#ifndef __qsamplerInstrument_h |
23 |
#define __qsamplerInstrument_h |
24 |
|
25 |
#include <QStringList> |
26 |
#include <QMetaType> |
27 |
|
28 |
|
29 |
//------------------------------------------------------------------------- |
30 |
// qsamplerInstrument - MIDI instrument map structure. |
31 |
// |
32 |
|
33 |
class qsamplerInstrument |
34 |
{ |
35 |
public: |
36 |
|
37 |
// Constructor. |
38 |
qsamplerInstrument(int iMap = 0, int iBank = -1, int iProg = -1); |
39 |
|
40 |
// Default destructor. |
41 |
~qsamplerInstrument(); |
42 |
|
43 |
// Instrument accessors. |
44 |
void setMap(int iMap); |
45 |
int map() const; |
46 |
|
47 |
void setBank(int iBank); |
48 |
int bank() const; |
49 |
|
50 |
void setProg(int iProg); |
51 |
int prog() const; |
52 |
|
53 |
void setName(const QString& sName); |
54 |
const QString& name() const; |
55 |
|
56 |
void setEngineName(const QString& sEngineName); |
57 |
const QString& engineName() const; |
58 |
|
59 |
void setInstrumentFile(const QString& sInstrumentFile); |
60 |
const QString& instrumentFile() const; |
61 |
|
62 |
const QString& instrumentName() const; |
63 |
|
64 |
void setInstrumentNr(int InstrumentNr); |
65 |
int instrumentNr() const; |
66 |
|
67 |
void setVolume(float fVolume); |
68 |
float volume() const; |
69 |
|
70 |
void setLoadMode(int iLoadMode); |
71 |
int loadMode() const; |
72 |
|
73 |
// Sync methods. |
74 |
bool getInstrument(); |
75 |
bool mapInstrument(); |
76 |
bool unmapInstrument(); |
77 |
|
78 |
// Instrument map names initialization... |
79 |
static QStringList getMapNames(); |
80 |
static QString getMapName(int iMidiMap); |
81 |
|
82 |
private: |
83 |
|
84 |
// Instance variables. |
85 |
int m_iMap; |
86 |
int m_iBank; |
87 |
int m_iProg; |
88 |
QString m_sName; |
89 |
QString m_sEngineName; |
90 |
QString m_sInstrumentFile; |
91 |
QString m_sInstrumentName; |
92 |
int m_iInstrumentNr; |
93 |
float m_fVolume; |
94 |
int m_iLoadMode; |
95 |
|
96 |
}; |
97 |
|
98 |
// so we can use it i.e. through QVariant |
99 |
Q_DECLARE_METATYPE(qsamplerInstrument) |
100 |
|
101 |
|
102 |
#endif // __qsamplerInstrument_h |
103 |
|
104 |
|
105 |
// end of qsamplerInstrument.h |