/[svn]/qsampler/trunk/src/qsamplerChannel.h
ViewVC logotype

Diff of /qsampler/trunk/src/qsamplerChannel.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1460 by schoenebeck, Mon Oct 1 18:26:06 2007 UTC revision 1461 by schoenebeck, Sun Oct 28 23:30:36 2007 UTC
# Line 22  Line 22 
22  #ifndef __qsamplerChannel_h  #ifndef __qsamplerChannel_h
23  #define __qsamplerChannel_h  #define __qsamplerChannel_h
24    
25  #include <qtable.h>  #include <QTableWidgetItem>
26    #include <QAbstractTableModel>
27    #include <QMetaType>
28    #include <QItemDelegate>
29    #include <QFontMetrics>
30    #include <QModelIndex>
31    #include <QSize>
32    
33  #include <lscp/client.h>  #include <lscp/client.h>
34  #include <lscp/device.h>  #include <lscp/device.h>
# Line 191  private: Line 197  private:
197  // qsamplerChannelRoutingTable - Channel routing table widget.  // qsamplerChannelRoutingTable - Channel routing table widget.
198  //  //
199    
200    #if 0
201  class qsamplerChannelRoutingTable : public QTable  class qsamplerChannelRoutingTable : public QTable
202  {  {
203          Q_OBJECT          Q_OBJECT
# Line 209  public: Line 216  public:
216          // Commit any pending editing.          // Commit any pending editing.
217          void flush();          void flush();
218  };  };
219    #endif
220    
221    struct ChannelRoutingItem {
222        QStringList options;
223        int         selection;
224    };
225    
226    // so we can use it i.e. through QVariant
227    Q_DECLARE_METATYPE(ChannelRoutingItem)
228    
229    class ChannelRoutingModel : public QAbstractTableModel {
230            Q_OBJECT
231        public:
232            ChannelRoutingModel(QObject* parent = 0);
233    
234            // overridden methods from subclass(es)
235            int rowCount(const QModelIndex &parent) const;
236            int columnCount(const QModelIndex &parent) const;
237            QVariant data(const QModelIndex &index, int role) const;
238            QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
239    
240        public slots:
241            void refresh(qsamplerDevice *pDevice, const qsamplerChannelRoutingMap& routing);
242    
243        private:
244            qsamplerDevice* pDevice;
245            qsamplerChannelRoutingMap routing;
246    };
247    
248    class ChannelRoutingDelegate : public QItemDelegate {
249            Q_OBJECT
250        public:
251            ChannelRoutingDelegate(QObject* parent = 0);
252    
253            QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option,
254                                  const QModelIndex& index) const;
255    
256            void setEditorData(QWidget* editor, const QModelIndex& index) const;
257            void setModelData(QWidget* editor, QAbstractItemModel* model,
258                              const QModelIndex& index) const;
259    
260            void updateEditorGeometry(QWidget* editor,
261                const QStyleOptionViewItem& option, const QModelIndex& index) const;
262    };
263    
264    
265  //-------------------------------------------------------------------------  //-------------------------------------------------------------------------
266  // qsamplerChannelRoutingComboBox - Custom combo box for routing table.  // qsamplerChannelRoutingComboBox - Custom combo box for routing table.
267  //  //
268    
269  class qsamplerChannelRoutingComboBox : public QTableItem  /*
270    class qsamplerChannelRoutingComboBox : public QTableWidgetItem
271  {  {
272  public:  public:
273    
274          // Constructor.          // Constructor.
275          qsamplerChannelRoutingComboBox(QTable *pTable,          qsamplerChannelRoutingComboBox(QTableWidget *pTable,
276                  const QStringList& list, const QPixmap& pixmap);                  const QStringList& list, const QPixmap& pixmap);
277    
278          // Public accessors.          // Public accessors.
# Line 239  private: Line 291  private:
291          QStringList m_list;          QStringList m_list;
292          int m_iCurrentItem;          int m_iCurrentItem;
293  };  };
294    */
295    
296  #endif  // __qsamplerChannel_h  #endif  // __qsamplerChannel_h
297    

Legend:
Removed from v.1460  
changed lines
  Added in v.1461

  ViewVC Help
Powered by ViewVC