--- qsampler/trunk/src/qsamplerChannel.h 2005/08/19 17:10:16 751 +++ qsampler/trunk/src/qsamplerChannel.h 2005/08/30 09:52:46 767 @@ -22,16 +22,21 @@ #ifndef __qsamplerChannel_h #define __qsamplerChannel_h -#include +#include #include #include #include "qsamplerOptions.h" +class qsamplerDevice; class qsamplerMainForm; +// Typedef'd QMap. +typedef QMap qsamplerChannelRoutingMap; + + //------------------------------------------------------------------------- // qsamplerChannel - Sampler channel structure. // @@ -116,6 +121,12 @@ bool channelSolo() const; bool setChannelSolo(bool bSolo); + // Audio routing accessors. + int audioChannel(int iAudioOut) const; + bool setAudioChannel(int iAudioOut, int iAudioIn); + // The audio routing map itself. + const qsamplerChannelRoutingMap& audioRouting() const; + // Istrument name remapper. void updateInstrumentName(); @@ -175,8 +186,66 @@ float m_fVolume; bool m_bMute; bool m_bSolo; + + // The audio routing mapping. + qsamplerChannelRoutingMap m_audioRouting; }; + +//------------------------------------------------------------------------- +// qsamplerChannelRoutingTable - Channel routing table widget. +// + +class qsamplerChannelRoutingTable : public QTable +{ + Q_OBJECT + +public: + + // Constructor. + qsamplerChannelRoutingTable(QWidget *pParent = 0, const char *pszName = 0); + // Default destructor. + ~qsamplerChannelRoutingTable(); + + // Common parameter table renderer. + void refresh(qsamplerDevice *pDevice, + const qsamplerChannelRoutingMap& routing); + + // Commit any pending editing. + void flush(); +}; + + +//------------------------------------------------------------------------- +// qsamplerChannelRoutingComboBox - Custom combo box for routing table. +// + +class qsamplerChannelRoutingComboBox : public QTableItem +{ +public: + + // Constructor. + qsamplerChannelRoutingComboBox(QTable *pTable, + const QStringList& list, const QPixmap& pixmap); + + // Public accessors. + void setCurrentItem(int iCurrentItem); + int currentItem() const; + +protected: + + // Virtual implemetations. + QWidget *createEditor() const; + void setContentFromEditor(QWidget *pWidget); + +private: + + // Initial value holders + QStringList m_list; + int m_iCurrentItem; +}; + + #endif // __qsamplerChannel_h