1 |
// qsamplerChannel.h |
// qsamplerChannel.h |
2 |
// |
// |
3 |
/**************************************************************************** |
/**************************************************************************** |
4 |
Copyright (C) 2003-2005, rncbc aka Rui Nuno Capela. All rights reserved. |
Copyright (C) 2004-2006, rncbc aka Rui Nuno Capela. All rights reserved. |
5 |
|
|
6 |
This program is free software; you can redistribute it and/or |
This program is free software; you can redistribute it and/or |
7 |
modify it under the terms of the GNU General Public License |
modify it under the terms of the GNU General Public License |
13 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
GNU General Public License for more details. |
GNU General Public License for more details. |
15 |
|
|
16 |
You should have received a copy of the GNU General Public License |
You should have received a copy of the GNU General Public License along |
17 |
along with this program; if not, write to the Free Software |
with this program; if not, write to the Free Software Foundation, Inc., |
18 |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
19 |
|
|
20 |
*****************************************************************************/ |
*****************************************************************************/ |
21 |
|
|
22 |
#ifndef __qsamplerChannel_h |
#ifndef __qsamplerChannel_h |
23 |
#define __qsamplerChannel_h |
#define __qsamplerChannel_h |
24 |
|
|
25 |
#include <qobject.h> |
#include <qtable.h> |
26 |
|
|
27 |
#include <lscp/client.h> |
#include <lscp/client.h> |
28 |
#include <lscp/device.h> |
#include <lscp/device.h> |
29 |
|
|
30 |
#include "qsamplerOptions.h" |
#include "qsamplerOptions.h" |
31 |
|
|
32 |
|
class qsamplerDevice; |
33 |
class qsamplerMainForm; |
class qsamplerMainForm; |
34 |
|
|
35 |
|
|
36 |
|
// Typedef'd QMap. |
37 |
|
typedef QMap<int, int> qsamplerChannelRoutingMap; |
38 |
|
|
39 |
|
|
40 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
41 |
// qsamplerChannel - Sampler channel structure. |
// qsamplerChannel - Sampler channel structure. |
42 |
// |
// |
113 |
float volume() const; |
float volume() const; |
114 |
bool setVolume(float fVolume); |
bool setVolume(float fVolume); |
115 |
|
|
116 |
|
// Sampler channel mute state. |
117 |
|
bool channelMute() const; |
118 |
|
bool setChannelMute(bool bMute); |
119 |
|
|
120 |
|
// Sampler channel solo state. |
121 |
|
bool channelSolo() const; |
122 |
|
bool setChannelSolo(bool bSolo); |
123 |
|
|
124 |
|
// Audio routing accessors. |
125 |
|
int audioChannel(int iAudioOut) const; |
126 |
|
bool setAudioChannel(int iAudioOut, int iAudioIn); |
127 |
|
// The audio routing map itself. |
128 |
|
const qsamplerChannelRoutingMap& audioRouting() const; |
129 |
|
|
130 |
// Istrument name remapper. |
// Istrument name remapper. |
131 |
void updateInstrumentName(); |
void updateInstrumentName(); |
132 |
|
|
152 |
// Common (invalid) name-helpers. |
// Common (invalid) name-helpers. |
153 |
static QString noEngineName(); |
static QString noEngineName(); |
154 |
static QString noInstrumentName(); |
static QString noInstrumentName(); |
155 |
|
static QString loadingInstrument(); |
156 |
|
|
157 |
// Check whether a given file is an instrument file. |
// Check whether a given file is an instrument file. |
158 |
static bool isInstrumentFile (const QString& sInstrumentFile); |
static bool isInstrumentFile (const QString& sInstrumentFile); |
184 |
QString m_sAudioDriver; |
QString m_sAudioDriver; |
185 |
int m_iAudioDevice; |
int m_iAudioDevice; |
186 |
float m_fVolume; |
float m_fVolume; |
187 |
|
bool m_bMute; |
188 |
|
bool m_bSolo; |
189 |
|
|
190 |
|
// The audio routing mapping. |
191 |
|
qsamplerChannelRoutingMap m_audioRouting; |
192 |
}; |
}; |
193 |
|
|
194 |
|
|
195 |
|
//------------------------------------------------------------------------- |
196 |
|
// qsamplerChannelRoutingTable - Channel routing table widget. |
197 |
|
// |
198 |
|
|
199 |
|
class qsamplerChannelRoutingTable : public QTable |
200 |
|
{ |
201 |
|
Q_OBJECT |
202 |
|
|
203 |
|
public: |
204 |
|
|
205 |
|
// Constructor. |
206 |
|
qsamplerChannelRoutingTable(QWidget *pParent = 0, const char *pszName = 0); |
207 |
|
// Default destructor. |
208 |
|
~qsamplerChannelRoutingTable(); |
209 |
|
|
210 |
|
// Common parameter table renderer. |
211 |
|
void refresh(qsamplerDevice *pDevice, |
212 |
|
const qsamplerChannelRoutingMap& routing); |
213 |
|
|
214 |
|
// Commit any pending editing. |
215 |
|
void flush(); |
216 |
|
}; |
217 |
|
|
218 |
|
|
219 |
|
//------------------------------------------------------------------------- |
220 |
|
// qsamplerChannelRoutingComboBox - Custom combo box for routing table. |
221 |
|
// |
222 |
|
|
223 |
|
class qsamplerChannelRoutingComboBox : public QTableItem |
224 |
|
{ |
225 |
|
public: |
226 |
|
|
227 |
|
// Constructor. |
228 |
|
qsamplerChannelRoutingComboBox(QTable *pTable, |
229 |
|
const QStringList& list, const QPixmap& pixmap); |
230 |
|
|
231 |
|
// Public accessors. |
232 |
|
void setCurrentItem(int iCurrentItem); |
233 |
|
int currentItem() const; |
234 |
|
|
235 |
|
protected: |
236 |
|
|
237 |
|
// Virtual implemetations. |
238 |
|
QWidget *createEditor() const; |
239 |
|
void setContentFromEditor(QWidget *pWidget); |
240 |
|
|
241 |
|
private: |
242 |
|
|
243 |
|
// Initial value holders |
244 |
|
QStringList m_list; |
245 |
|
int m_iCurrentItem; |
246 |
|
}; |
247 |
|
|
248 |
|
|
249 |
#endif // __qsamplerChannel_h |
#endif // __qsamplerChannel_h |
250 |
|
|
251 |
|
|