195 |
|
|
196 |
|
|
197 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
198 |
// qsamplerChannelRoutingTable - Channel routing table widget. |
// ChannelRoutingModel - data model for audio routing (used for QTableView) |
199 |
// |
// |
200 |
|
|
|
#if 0 |
|
|
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(); |
|
|
}; |
|
|
#endif |
|
|
|
|
201 |
struct ChannelRoutingItem { |
struct ChannelRoutingItem { |
202 |
QStringList options; |
QStringList options; |
203 |
int selection; |
int selection; |
212 |
ChannelRoutingModel(QObject* parent = 0); |
ChannelRoutingModel(QObject* parent = 0); |
213 |
|
|
214 |
// overridden methods from subclass(es) |
// overridden methods from subclass(es) |
215 |
int rowCount(const QModelIndex &parent) const; |
int rowCount(const QModelIndex &parent = QModelIndex()) const; |
216 |
int columnCount(const QModelIndex &parent) const; |
int columnCount(const QModelIndex &parent = QModelIndex()) const; |
217 |
|
Qt::ItemFlags flags(const QModelIndex& index) const; |
218 |
|
bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole); |
219 |
QVariant data(const QModelIndex &index, int role) const; |
QVariant data(const QModelIndex &index, int role) const; |
220 |
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; |
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; |
221 |
|
|
222 |
|
// own methods |
223 |
|
qsamplerChannelRoutingMap routingMap() const { |
224 |
|
return routing; |
225 |
|
} |
226 |
|
|
227 |
|
void clear() { routing.clear(); } |
228 |
|
|
229 |
public slots: |
public slots: |
230 |
void refresh(qsamplerDevice *pDevice, const qsamplerChannelRoutingMap& routing); |
void refresh(qsamplerDevice *pDevice, const qsamplerChannelRoutingMap& routing); |
231 |
|
|
234 |
qsamplerChannelRoutingMap routing; |
qsamplerChannelRoutingMap routing; |
235 |
}; |
}; |
236 |
|
|
237 |
|
|
238 |
|
//------------------------------------------------------------------------- |
239 |
|
// ChannelRoutingDelegate - table cell renderer for audio routing |
240 |
|
// |
241 |
|
|
242 |
class ChannelRoutingDelegate : public QItemDelegate { |
class ChannelRoutingDelegate : public QItemDelegate { |
243 |
Q_OBJECT |
Q_OBJECT |
244 |
public: |
public: |
245 |
ChannelRoutingDelegate(QObject* parent = 0); |
ChannelRoutingDelegate(QObject* parent = 0); |
246 |
|
QWidget* createEditor(QWidget* parent, |
247 |
QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, |
const QStyleOptionViewItem& option, |
248 |
const QModelIndex& index) const; |
const QModelIndex& index) const; |
|
|
|
249 |
void setEditorData(QWidget* editor, const QModelIndex& index) const; |
void setEditorData(QWidget* editor, const QModelIndex& index) const; |
250 |
void setModelData(QWidget* editor, QAbstractItemModel* model, |
void setModelData(QWidget* editor, QAbstractItemModel* model, |
251 |
const QModelIndex& index) const; |
const QModelIndex& index) const; |
|
|
|
252 |
void updateEditorGeometry(QWidget* editor, |
void updateEditorGeometry(QWidget* editor, |
253 |
const QStyleOptionViewItem& option, const QModelIndex& index) const; |
const QStyleOptionViewItem& option, |
254 |
|
const QModelIndex& index) const; |
255 |
}; |
}; |
256 |
|
|
|
|
|
|
//------------------------------------------------------------------------- |
|
|
// qsamplerChannelRoutingComboBox - Custom combo box for routing table. |
|
|
// |
|
|
|
|
|
/* |
|
|
class qsamplerChannelRoutingComboBox : public QTableWidgetItem |
|
|
{ |
|
|
public: |
|
|
|
|
|
// Constructor. |
|
|
qsamplerChannelRoutingComboBox(QTableWidget *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; |
|
|
}; |
|
|
*/ |
|
|
|
|
257 |
#endif // __qsamplerChannel_h |
#endif // __qsamplerChannel_h |
258 |
|
|
|
|
|
259 |
// end of qsamplerChannel.h |
// end of qsamplerChannel.h |