24 |
#define __qsamplerChannel_h |
#define __qsamplerChannel_h |
25 |
|
|
26 |
#include <QTableWidgetItem> |
#include <QTableWidgetItem> |
|
#include <QAbstractTableModel> |
|
|
#include <QMetaType> |
|
27 |
#include <QItemDelegate> |
#include <QItemDelegate> |
|
#include <QFontMetrics> |
|
|
#include <QModelIndex> |
|
|
#include <QSize> |
|
28 |
|
|
29 |
#include <lscp/client.h> |
#include <lscp/client.h> |
30 |
#include <lscp/device.h> |
#include <lscp/device.h> |
190 |
|
|
191 |
|
|
192 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
193 |
// qsamplerChannelRoutingTable - Channel routing table widget. |
// ChannelRoutingModel - data model for audio routing (used for QTableView) |
194 |
// |
// |
195 |
|
|
|
#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 |
|
|
|
|
196 |
struct ChannelRoutingItem { |
struct ChannelRoutingItem { |
197 |
QStringList options; |
QStringList options; |
198 |
int selection; |
int selection; |
207 |
ChannelRoutingModel(QObject* parent = 0); |
ChannelRoutingModel(QObject* parent = 0); |
208 |
|
|
209 |
// overridden methods from subclass(es) |
// overridden methods from subclass(es) |
210 |
int rowCount(const QModelIndex &parent) const; |
int rowCount(const QModelIndex &parent = QModelIndex()) const; |
211 |
int columnCount(const QModelIndex &parent) const; |
int columnCount(const QModelIndex &parent = QModelIndex()) const; |
212 |
|
Qt::ItemFlags flags(const QModelIndex& index) const; |
213 |
|
bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole); |
214 |
QVariant data(const QModelIndex &index, int role) const; |
QVariant data(const QModelIndex &index, int role) const; |
215 |
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; |
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; |
216 |
|
|
217 |
|
// own methods |
218 |
|
qsamplerChannelRoutingMap routingMap() const { |
219 |
|
return routing; |
220 |
|
} |
221 |
|
|
222 |
|
void clear() { routing.clear(); } |
223 |
|
|
224 |
public slots: |
public slots: |
225 |
void refresh(qsamplerDevice *pDevice, const qsamplerChannelRoutingMap& routing); |
void refresh(qsamplerDevice *pDevice, const qsamplerChannelRoutingMap& routing); |
226 |
|
|
229 |
qsamplerChannelRoutingMap routing; |
qsamplerChannelRoutingMap routing; |
230 |
}; |
}; |
231 |
|
|
232 |
|
|
233 |
|
//------------------------------------------------------------------------- |
234 |
|
// ChannelRoutingDelegate - table cell renderer for audio routing |
235 |
|
// |
236 |
|
|
237 |
class ChannelRoutingDelegate : public QItemDelegate { |
class ChannelRoutingDelegate : public QItemDelegate { |
238 |
Q_OBJECT |
Q_OBJECT |
239 |
public: |
public: |
240 |
ChannelRoutingDelegate(QObject* parent = 0); |
ChannelRoutingDelegate(QObject* parent = 0); |
241 |
|
QWidget* createEditor(QWidget* parent, |
242 |
QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, |
const QStyleOptionViewItem& option, |
243 |
const QModelIndex& index) const; |
const QModelIndex& index) const; |
|
|
|
244 |
void setEditorData(QWidget* editor, const QModelIndex& index) const; |
void setEditorData(QWidget* editor, const QModelIndex& index) const; |
245 |
void setModelData(QWidget* editor, QAbstractItemModel* model, |
void setModelData(QWidget* editor, QAbstractItemModel* model, |
246 |
const QModelIndex& index) const; |
const QModelIndex& index) const; |
|
|
|
247 |
void updateEditorGeometry(QWidget* editor, |
void updateEditorGeometry(QWidget* editor, |
248 |
const QStyleOptionViewItem& option, const QModelIndex& index) const; |
const QStyleOptionViewItem& option, |
249 |
|
const QModelIndex& index) const; |
250 |
}; |
}; |
251 |
|
|
|
|
|
|
//------------------------------------------------------------------------- |
|
|
// 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; |
|
|
}; |
|
|
*/ |
|
|
|
|
252 |
#endif // __qsamplerChannel_h |
#endif // __qsamplerChannel_h |
253 |
|
|
|
|
|
254 |
// end of qsamplerChannel.h |
// end of qsamplerChannel.h |