--- qsampler/trunk/src/qsamplerDeviceForm.h 2007/10/28 23:30:36 1461 +++ qsampler/trunk/src/qsamplerDeviceForm.h 2019/06/30 16:58:30 3518 @@ -1,63 +1,105 @@ -#ifndef QSAMPLER_DEVICE_FORM_H -#define QSAMPLER_DEVICE_FORM_H +// qsamplerDeviceForm.h +// +/**************************************************************************** + Copyright (C) 2004-2019, rncbc aka Rui Nuno Capela. All rights reserved. + Copyright (C) 2007, Christian Schoenebeck + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +*****************************************************************************/ + +#ifndef __qsamplerDeviceForm_h +#define __qsamplerDeviceForm_h #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; + + PortParamModel m_devicePortParamModel; + DeviceParamDelegate m_devicePortParamDelegate; - DeviceParamModel devicePortParamModel; - DeviceParamDelegate 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 // QSAMPLER_DEVICE_FORM_H + +#endif // __qsamplerDeviceForm_h + + +// end of qsamplerDeviceForm.h