31 |
|
|
32 |
#include "qsamplerOptions.h" |
#include "qsamplerOptions.h" |
33 |
|
|
34 |
class qsamplerDevice; |
namespace QSampler { |
35 |
|
|
36 |
|
class Device; |
37 |
|
|
38 |
// Typedef'd QMap. |
// Typedef'd QMap. |
39 |
typedef QMap<int, int> qsamplerChannelRoutingMap; |
typedef QMap<int, int> ChannelRoutingMap; |
40 |
|
|
41 |
|
|
42 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
43 |
// qsamplerChannel - Sampler channel structure. |
// QSampler::Channel - Sampler channel structure. |
44 |
// |
// |
45 |
|
|
46 |
class qsamplerChannel |
class Channel |
47 |
{ |
{ |
48 |
public: |
public: |
49 |
|
|
50 |
// Constructor. |
// Constructor. |
51 |
qsamplerChannel(int iChannelID = -1); |
Channel(int iChannelID = -1); |
52 |
// Default destructor. |
// Default destructor. |
53 |
~qsamplerChannel(); |
~Channel(); |
54 |
|
|
55 |
// Add/remove sampler channel methods. |
// Add/remove sampler channel methods. |
56 |
bool addChannel(); |
bool addChannel(); |
122 |
int audioChannel(int iAudioOut) const; |
int audioChannel(int iAudioOut) const; |
123 |
bool setAudioChannel(int iAudioOut, int iAudioIn); |
bool setAudioChannel(int iAudioOut, int iAudioIn); |
124 |
// The audio routing map itself. |
// The audio routing map itself. |
125 |
const qsamplerChannelRoutingMap& audioRouting() const; |
const ChannelRoutingMap& audioRouting() const; |
126 |
|
|
127 |
// Istrument name remapper. |
// Istrument name remapper. |
128 |
void updateInstrumentName(); |
void updateInstrumentName(); |
186 |
bool m_bSolo; |
bool m_bSolo; |
187 |
|
|
188 |
// The audio routing mapping. |
// The audio routing mapping. |
189 |
qsamplerChannelRoutingMap m_audioRouting; |
ChannelRoutingMap m_audioRouting; |
190 |
}; |
}; |
191 |
|
|
192 |
|
|
193 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
194 |
// ChannelRoutingModel - data model for audio routing (used for QTableView) |
// QSampler::ChannelRoutingModel - data model for audio routing |
195 |
|
// (used for QTableView) |
196 |
// |
// |
197 |
|
|
198 |
struct ChannelRoutingItem { |
struct ChannelRoutingItem { |
200 |
int selection; |
int selection; |
201 |
}; |
}; |
202 |
|
|
|
// so we can use it i.e. through QVariant |
|
|
Q_DECLARE_METATYPE(ChannelRoutingItem) |
|
|
|
|
203 |
class ChannelRoutingModel : public QAbstractTableModel |
class ChannelRoutingModel : public QAbstractTableModel |
204 |
{ |
{ |
205 |
Q_OBJECT |
Q_OBJECT |
218 |
int role = Qt::DisplayRole) const; |
int role = Qt::DisplayRole) const; |
219 |
|
|
220 |
// own methods |
// own methods |
221 |
qsamplerChannelRoutingMap routingMap() const { return m_routing; } |
ChannelRoutingMap routingMap() const { return m_routing; } |
222 |
|
|
223 |
void clear() { m_routing.clear(); } |
void clear() { m_routing.clear(); } |
224 |
|
|
225 |
public slots: |
public slots: |
226 |
|
|
227 |
void refresh(qsamplerDevice *pDevice, |
void refresh(Device *pDevice, |
228 |
const qsamplerChannelRoutingMap& routing); |
const ChannelRoutingMap& routing); |
229 |
|
|
230 |
private: |
private: |
231 |
|
|
232 |
qsamplerDevice *m_pDevice; |
Device *m_pDevice; |
233 |
qsamplerChannelRoutingMap m_routing; |
ChannelRoutingMap m_routing; |
234 |
}; |
}; |
235 |
|
|
236 |
|
|
237 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
238 |
// ChannelRoutingDelegate - table cell renderer for audio routing |
// QSampler::ChannelRoutingDelegate - table cell renderer for audio routing |
239 |
// |
// |
240 |
|
|
241 |
class ChannelRoutingDelegate : public QItemDelegate |
class ChannelRoutingDelegate : public QItemDelegate |
255 |
const QStyleOptionViewItem& option, const QModelIndex& index) const; |
const QStyleOptionViewItem& option, const QModelIndex& index) const; |
256 |
}; |
}; |
257 |
|
|
258 |
|
} // namespace QSampler |
259 |
|
|
260 |
|
// So we can use it i.e. through QVariant |
261 |
|
Q_DECLARE_METATYPE(QSampler::ChannelRoutingItem) |
262 |
|
|
263 |
#endif // __qsamplerChannel_h |
#endif // __qsamplerChannel_h |
264 |
|
|
265 |
|
|
266 |
// end of qsamplerChannel.h |
// end of qsamplerChannel.h |