/[svn]/qsampler/trunk/src/qsamplerDeviceForm.cpp
ViewVC logotype

Diff of /qsampler/trunk/src/qsamplerDeviceForm.cpp

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

revision 1464 by capela, Thu Nov 1 17:14:21 2007 UTC revision 1477 by schoenebeck, Mon Nov 12 01:33:13 2007 UTC
# Line 23  Line 23 
23  #include "qsamplerDeviceForm.h"  #include "qsamplerDeviceForm.h"
24    
25  #include "qsamplerAbout.h"  #include "qsamplerAbout.h"
26    #include "qsamplerMainForm.h"
27    
28  namespace QSampler {  namespace QSampler {
29    
# Line 39  DeviceForm::DeviceForm(QWidget* parent, Line 40  DeviceForm::DeviceForm(QWidget* parent,
40          // No exclusive mode as default.          // No exclusive mode as default.
41          m_deviceTypeMode = qsamplerDevice::None;          m_deviceTypeMode = qsamplerDevice::None;
42    
43            ui.DeviceListView->header()->hide();
44    
45          ui.DeviceParamTable->setModel(&deviceParamModel);          ui.DeviceParamTable->setModel(&deviceParamModel);
46          ui.DeviceParamTable->setItemDelegate(&deviceParamDelegate);          ui.DeviceParamTable->setItemDelegate(&deviceParamDelegate);
47    
# Line 55  DeviceForm::DeviceForm(QWidget* parent, Line 58  DeviceForm::DeviceForm(QWidget* parent,
58          refreshDevices();          refreshDevices();
59          // Try to restore normal window positioning.          // Try to restore normal window positioning.
60          adjustSize();          adjustSize();
61    
62            QObject::connect(ui.DeviceListView,
63                    SIGNAL(itemSelectionChanged()),
64                    SLOT(selectDevice()));
65            QObject::connect(ui.DeviceListView,
66                    SIGNAL(customContextMenuRequested(const QPoint&)),
67                    SLOT(deviceListViewContextMenu(const QPoint&)));
68            QObject::connect(ui.RefreshDevicesPushButton,
69                    SIGNAL(clicked()),
70                    SLOT(refreshDevices()));
71            QObject::connect(ui.DriverNameComboBox,
72                    SIGNAL(activated(const QString&)),
73                    SLOT(selectDriver(const QString&)));
74            QObject::connect(ui.DevicePortComboBox,
75                    SIGNAL(activated(int)),
76                    SLOT(selectDevicePort(int)));
77            QObject::connect(ui.CreateDevicePushButton,
78                    SIGNAL(clicked()),
79                    SLOT(createDevice()));
80            QObject::connect(ui.DeleteDevicePushButton,
81                    SIGNAL(clicked()),
82                    SLOT(deleteDevice()));
83            QObject::connect(ui.ClosePushButton,
84                    SIGNAL(clicked()),
85                    SLOT(close()));
86  }  }
87    
88  DeviceForm::~DeviceForm() {  DeviceForm::~DeviceForm() {
# Line 109  void DeviceForm::setDeviceTypeMode ( Line 137  void DeviceForm::setDeviceTypeMode (
137  // Device driver name setup formal initializer.  // Device driver name setup formal initializer.
138  void DeviceForm::setDriverName ( const QString& sDriverName )  void DeviceForm::setDriverName ( const QString& sDriverName )
139  {  {
140          if (ui.DriverNameComboBox->findText(sDriverName) == 0) {          if (ui.DriverNameComboBox->findText(sDriverName) < 0) {
141                  ui.DriverNameComboBox->insertItem(sDriverName);                  ui.DriverNameComboBox->insertItem(sDriverName);
142          }          }
143          ui.DriverNameComboBox->setCurrentText(sDriverName);          ui.DriverNameComboBox->setCurrentText(sDriverName);
# Line 324  void DeviceForm::selectDriver ( const QS Line 352  void DeviceForm::selectDriver ( const QS
352    
353    
354  // Device selection slot.  // Device selection slot.
355  void DeviceForm::selectDevice (void)  void DeviceForm::selectDevice ()
356  {  {
357          MainForm *pMainForm = MainForm::getInstance();          MainForm *pMainForm = MainForm::getInstance();
358          if (pMainForm == NULL)          if (pMainForm == NULL)
# Line 395  void DeviceForm::selectDevice (void) Line 423  void DeviceForm::selectDevice (void)
423                  QPixmap pixmap;                  QPixmap pixmap;
424                  switch (device.deviceType()) {                  switch (device.deviceType()) {
425                  case qsamplerDevice::Audio:                  case qsamplerDevice::Audio:
426                          pixmap = QPixmap(":/qsampler/pixmaps/audio2.png");                          pixmap = QPixmap(":/icons/audio2.png");
427                          break;                          break;
428                  case qsamplerDevice::Midi:                  case qsamplerDevice::Midi:
429                          pixmap = QPixmap(":/qsampler/pixmaps/midi2.png");                          pixmap = QPixmap(":/icons/midi2.png");
430                          break;                          break;
431                  case qsamplerDevice::None:                  case qsamplerDevice::None:
432                          break;                          break;
# Line 528  void DeviceForm::changeDevicePortParam ( Line 556  void DeviceForm::changeDevicePortParam (
556    
557    
558  // Device list view context menu handler.  // Device list view context menu handler.
559  void DeviceForm::contextMenu ( QTreeWidgetItem* pItem, const QPoint& pos, int )  void DeviceForm::deviceListViewContextMenu ( const QPoint& pos )
560  {  {
561          MainForm *pMainForm = MainForm::getInstance();          MainForm *pMainForm = MainForm::getInstance();
562          if (pMainForm == NULL)          if (pMainForm == NULL)
563                  return;                  return;
564    
565            QTreeWidgetItem* pItem = ui.DeviceListView->itemAt(pos);
566            if (pItem == NULL)
567                    return;
568    
569          int iItemID;          int iItemID;
570    
571          // Build the device context menu...          // Build the device context menu...

Legend:
Removed from v.1464  
changed lines
  Added in v.1477

  ViewVC Help
Powered by ViewVC