1 |
// qsamplerChannel.h |
// qsamplerChannel.h |
2 |
// |
// |
3 |
/**************************************************************************** |
/**************************************************************************** |
4 |
Copyright (C) 2003-2005, rncbc aka Rui Nuno Capela. All rights reserved. |
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 |
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 qsamplerMainForm; |
class qsamplerDevice; |
33 |
|
|
34 |
|
|
35 |
|
// Typedef'd QMap. |
36 |
|
typedef QMap<int, int> qsamplerChannelRoutingMap; |
37 |
|
|
38 |
|
|
39 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
45 |
public: |
public: |
46 |
|
|
47 |
// Constructor. |
// Constructor. |
48 |
qsamplerChannel(qsamplerMainForm *pMainForm, int iChannelID = -1); |
qsamplerChannel(int iChannelID = -1); |
49 |
// Default destructor. |
// Default destructor. |
50 |
~qsamplerChannel(); |
~qsamplerChannel(); |
51 |
|
|
|
// Main application form accessor. |
|
|
qsamplerMainForm *mainForm() const; |
|
|
|
|
|
// Main application options accessor. |
|
|
qsamplerOptions *options() const; |
|
|
|
|
|
// LSCP client descriptor accessor. |
|
|
lscp_client_t * client() const; |
|
|
|
|
52 |
// Add/remove sampler channel methods. |
// Add/remove sampler channel methods. |
53 |
bool addChannel(); |
bool addChannel(); |
54 |
bool removeChannel(); |
bool removeChannel(); |
91 |
int midiChannel() const; |
int midiChannel() const; |
92 |
bool setMidiChannel(int iMidiChannel); |
bool setMidiChannel(int iMidiChannel); |
93 |
|
|
94 |
|
// MIDI instrument map. |
95 |
|
int midiMap() const; |
96 |
|
bool setMidiMap(int iMidiMap); |
97 |
|
|
98 |
// Audio output driver (DEPRECATED). |
// Audio output driver (DEPRECATED). |
99 |
const QString& audioDriver() const; |
const QString& audioDriver() const; |
100 |
bool setAudioDriver(const QString& sAudioDriver); |
bool setAudioDriver(const QString& sAudioDriver); |
115 |
bool channelSolo() const; |
bool channelSolo() const; |
116 |
bool setChannelSolo(bool bSolo); |
bool setChannelSolo(bool bSolo); |
117 |
|
|
118 |
|
// Audio routing accessors. |
119 |
|
int audioChannel(int iAudioOut) const; |
120 |
|
bool setAudioChannel(int iAudioOut, int iAudioIn); |
121 |
|
// The audio routing map itself. |
122 |
|
const qsamplerChannelRoutingMap& audioRouting() const; |
123 |
|
|
124 |
// Istrument name remapper. |
// Istrument name remapper. |
125 |
void updateInstrumentName(); |
void updateInstrumentName(); |
126 |
|
|
159 |
|
|
160 |
private: |
private: |
161 |
|
|
|
// Main application form reference. |
|
|
qsamplerMainForm *m_pMainForm; |
|
|
|
|
162 |
// Unique channel identifier. |
// Unique channel identifier. |
163 |
int m_iChannelID; |
int m_iChannelID; |
164 |
|
|
172 |
int m_iMidiDevice; |
int m_iMidiDevice; |
173 |
int m_iMidiPort; |
int m_iMidiPort; |
174 |
int m_iMidiChannel; |
int m_iMidiChannel; |
175 |
|
int m_iMidiMap; |
176 |
QString m_sAudioDriver; |
QString m_sAudioDriver; |
177 |
int m_iAudioDevice; |
int m_iAudioDevice; |
178 |
float m_fVolume; |
float m_fVolume; |
179 |
bool m_bMute; |
bool m_bMute; |
180 |
bool m_bSolo; |
bool m_bSolo; |
181 |
|
|
182 |
|
// The audio routing mapping. |
183 |
|
qsamplerChannelRoutingMap m_audioRouting; |
184 |
|
}; |
185 |
|
|
186 |
|
|
187 |
|
//------------------------------------------------------------------------- |
188 |
|
// qsamplerChannelRoutingTable - Channel routing table widget. |
189 |
|
// |
190 |
|
|
191 |
|
class qsamplerChannelRoutingTable : public QTable |
192 |
|
{ |
193 |
|
Q_OBJECT |
194 |
|
|
195 |
|
public: |
196 |
|
|
197 |
|
// Constructor. |
198 |
|
qsamplerChannelRoutingTable(QWidget *pParent = 0, const char *pszName = 0); |
199 |
|
// Default destructor. |
200 |
|
~qsamplerChannelRoutingTable(); |
201 |
|
|
202 |
|
// Common parameter table renderer. |
203 |
|
void refresh(qsamplerDevice *pDevice, |
204 |
|
const qsamplerChannelRoutingMap& routing); |
205 |
|
|
206 |
|
// Commit any pending editing. |
207 |
|
void flush(); |
208 |
}; |
}; |
209 |
|
|
210 |
|
|
211 |
|
//------------------------------------------------------------------------- |
212 |
|
// qsamplerChannelRoutingComboBox - Custom combo box for routing table. |
213 |
|
// |
214 |
|
|
215 |
|
class qsamplerChannelRoutingComboBox : public QTableItem |
216 |
|
{ |
217 |
|
public: |
218 |
|
|
219 |
|
// Constructor. |
220 |
|
qsamplerChannelRoutingComboBox(QTable *pTable, |
221 |
|
const QStringList& list, const QPixmap& pixmap); |
222 |
|
|
223 |
|
// Public accessors. |
224 |
|
void setCurrentItem(int iCurrentItem); |
225 |
|
int currentItem() const; |
226 |
|
|
227 |
|
protected: |
228 |
|
|
229 |
|
// Virtual implemetations. |
230 |
|
QWidget *createEditor() const; |
231 |
|
void setContentFromEditor(QWidget *pWidget); |
232 |
|
|
233 |
|
private: |
234 |
|
|
235 |
|
// Initial value holders |
236 |
|
QStringList m_list; |
237 |
|
int m_iCurrentItem; |
238 |
|
}; |
239 |
|
|
240 |
|
|
241 |
#endif // __qsamplerChannel_h |
#endif // __qsamplerChannel_h |
242 |
|
|
243 |
|
|