--- qsampler/trunk/src/qsamplerDeviceForm.h 2007/11/01 17:14:21 1464 +++ qsampler/trunk/src/qsamplerDeviceForm.h 2007/12/06 09:35:33 1558 @@ -25,63 +25,80 @@ #include "ui_qsamplerDeviceForm.h" -#include "qsamplerMainForm.h" +#include "qsamplerDevice.h" + namespace QSampler { -class MainForm; +//------------------------------------------------------------------------- +// QSampler::DeviceForm -- Device form interface. +// + +class DeviceForm : public QDialog +{ + Q_OBJECT -class DeviceForm : public QDialog { -Q_OBJECT public: - DeviceForm(QWidget* parent = 0, Qt::WFlags f = 0); - ~DeviceForm(); - void showEvent(QShowEvent* pShowEvent); - - void setDeviceTypeMode(qsamplerDevice::qsamplerDeviceType deviceType); - void setDriverName(const QString& sDriverName); - void setDevice(qsamplerDevice* pDevice); -signals: - void devicesChanged(); + DeviceForm(QWidget *pParent = NULL, Qt::WindowFlags wflags = 0); + ~DeviceForm(); + + void setDeviceTypeMode(Device::DeviceType deviceType); + void setDriverName(const QString& sDriverName); + void setDevice(Device *pDevice); public slots: - void createDevice(); - void deleteDevice(); - void refreshDevices(); - void selectDriver(const QString& sDriverName); - void selectDevice(); - void selectDevicePort(int iPort); - void changeDeviceParam(int iRow, int iCol); - void changeDevicePortParam(int iRow, int iCol); - void contextMenu(QTreeWidgetItem* item, const QPoint&, int); - void stabilizeForm(); + + void createDevice(); + void deleteDevice(); + void refreshDevices(); + void selectDriver(const QString& sDriverName); + void selectDevice(); + void selectDevicePort(int iPort); + void changeDeviceParam(int iRow, int iCol); + void changeDevicePortParam(int iRow, int iCol); + void deviceListViewContextMenu(const QPoint& pos); + void stabilizeForm(); + + void updateCellRenderers(); + void updateCellRenderers( + const QModelIndex& topLeft, const QModelIndex& bottomRight); + void updatePortCellRenderers(); + void updatePortCellRenderers( + const QModelIndex& topLeft, const QModelIndex& bottomRight); + +signals: + + void devicesChanged(); protected: - MainForm *m_pMainForm; - lscp_client_t *m_pClient; - int m_iDirtySetup; - int m_iDirtyCount; - bool m_bNewDevice; - qsamplerDevice::qsamplerDeviceType m_deviceType; - qsamplerDevice::qsamplerDeviceType m_deviceTypeMode; - qsamplerDeviceItem *m_pAudioItems; - qsamplerDeviceItem *m_pMidiItems; - void hideEvent(QHideEvent* pHideEvent); + void showEvent(QShowEvent* pShowEvent); + void hideEvent(QHideEvent* pHideEvent); private: - Ui::qsamplerDeviceForm ui; - DeviceParamModel deviceParamModel; - DeviceParamDelegate deviceParamDelegate; + Ui::qsamplerDeviceForm m_ui; + + DeviceParamModel m_deviceParamModel; + DeviceParamDelegate m_deviceParamDelegate; - DeviceParamModel devicePortParamModel; - DeviceParamDelegate devicePortParamDelegate; + PortParamModel m_devicePortParamModel; + DeviceParamDelegate m_devicePortParamDelegate; + + lscp_client_t *m_pClient; + int m_iDirtySetup; + int m_iDirtyCount; + bool m_bNewDevice; + Device::DeviceType m_deviceType; + Device::DeviceType m_deviceTypeMode; + DeviceItem *m_pAudioItems; + DeviceItem *m_pMidiItems; }; } // namespace QSampler + #endif // __qsamplerDeviceForm_h