24 |
#include <qfiledialog.h> |
#include <qfiledialog.h> |
25 |
#include <qfileinfo.h> |
#include <qfileinfo.h> |
26 |
#include <qlistbox.h> |
#include <qlistbox.h> |
27 |
|
#include <qptrlist.h> |
28 |
|
#include <qpopupmenu.h> |
29 |
|
|
30 |
#include "qsamplerMainForm.h" |
#include "qsamplerMainForm.h" |
31 |
|
|
46 |
|
|
47 |
// This an outsider (from designer), but rather important. |
// This an outsider (from designer), but rather important. |
48 |
QObject::connect(DeviceParamTable, SIGNAL(valueChanged(int,int)), |
QObject::connect(DeviceParamTable, SIGNAL(valueChanged(int,int)), |
49 |
this, SLOT(changeValue(int,int))); |
this, SLOT(changeDeviceParam(int,int))); |
50 |
|
QObject::connect(DevicePortParamTable, SIGNAL(valueChanged(int,int)), |
51 |
|
this, SLOT(changeDevicePortParam(int,int))); |
52 |
|
|
53 |
|
// Initial contents. |
54 |
|
refreshDevices(); |
55 |
// Try to restore normal window positioning. |
// Try to restore normal window positioning. |
56 |
adjustSize(); |
adjustSize(); |
57 |
} |
} |
107 |
if (pItem == NULL || pItem->rtti() != QSAMPLER_DEVICE_ITEM) |
if (pItem == NULL || pItem->rtti() != QSAMPLER_DEVICE_ITEM) |
108 |
return; |
return; |
109 |
|
|
110 |
qsamplerDevice& device = ((qsamplerDeviceItem *) pItem)->device(); |
const qsamplerDevice& device = ((qsamplerDeviceItem *) pItem)->device(); |
111 |
|
|
112 |
// Build the parameter list... |
// Build the parameter list... |
113 |
qsamplerDeviceParamMap& params = device.params(); |
const qsamplerDeviceParamMap& params = device.params(); |
114 |
lscp_param_t *pParams = new lscp_param_t [params.count() + 1]; |
lscp_param_t *pParams = new lscp_param_t [params.count() + 1]; |
115 |
int iParam = 0; |
int iParam = 0; |
116 |
qsamplerDeviceParamMap::ConstIterator iter; |
qsamplerDeviceParamMap::ConstIterator iter; |
128 |
int iDeviceID = -1; |
int iDeviceID = -1; |
129 |
switch (device.deviceType()) { |
switch (device.deviceType()) { |
130 |
case qsamplerDevice::Audio: |
case qsamplerDevice::Audio: |
131 |
pRootItem = m_pAudioItems; |
pRootItem = m_pAudioItems; |
132 |
if ((iDeviceID = ::lscp_create_audio_device(m_pClient, |
if ((iDeviceID = ::lscp_create_audio_device(m_pClient, |
133 |
device.driverName().latin1(), pParams)) < 0) |
device.driverName().latin1(), pParams)) < 0) |
134 |
m_pMainForm->appendMessagesClient("lscp_create_audio_device"); |
m_pMainForm->appendMessagesClient("lscp_create_audio_device"); |
135 |
break; |
break; |
136 |
case qsamplerDevice::Midi: |
case qsamplerDevice::Midi: |
137 |
pRootItem = m_pMidiItems; |
pRootItem = m_pMidiItems; |
138 |
if ((iDeviceID = ::lscp_create_midi_device(m_pClient, |
if ((iDeviceID = ::lscp_create_midi_device(m_pClient, |
139 |
device.driverName().latin1(), pParams)) < 0) |
device.driverName().latin1(), pParams)) < 0) |
140 |
m_pMainForm->appendMessagesClient("lscp_create_midi_device"); |
m_pMainForm->appendMessagesClient("lscp_create_midi_device"); |
154 |
// Just make it the new selection... |
// Just make it the new selection... |
155 |
DeviceListView->setSelected(pDeviceItem, true); |
DeviceListView->setSelected(pDeviceItem, true); |
156 |
// Done. |
// Done. |
157 |
m_pMainForm->appendMessages(pDeviceItem->device().deviceName() + ' ' |
m_pMainForm->appendMessages(pDeviceItem->device().deviceTypeName() |
158 |
+ tr("created.")); |
+ ' ' + pDeviceItem->device().deviceName() |
159 |
|
+ ' ' + tr("created.")); |
160 |
// Main session should be marked dirty. |
// Main session should be marked dirty. |
161 |
m_pMainForm->sessionDirty(); |
m_pMainForm->sessionDirty(); |
162 |
} |
} |
170 |
if (pItem == NULL || pItem->rtti() != QSAMPLER_DEVICE_ITEM) |
if (pItem == NULL || pItem->rtti() != QSAMPLER_DEVICE_ITEM) |
171 |
return; |
return; |
172 |
|
|
173 |
qsamplerDevice& device = ((qsamplerDeviceItem *) pItem)->device(); |
const qsamplerDevice& device = ((qsamplerDeviceItem *) pItem)->device(); |
174 |
|
|
175 |
// Prompt user if this is for real... |
// Prompt user if this is for real... |
176 |
qsamplerOptions *pOptions = m_pMainForm->options(); |
qsamplerOptions *pOptions = m_pMainForm->options(); |
177 |
if (pOptions && pOptions->bConfirmRemove) { |
if (pOptions && pOptions->bConfirmRemove) { |
178 |
if (QMessageBox::warning(this, tr("Warning"), |
if (QMessageBox::warning(this, tr("Warning"), |
179 |
tr("Delete %1 device:\n\n" |
tr("Delete %1 device:\n\n" |
180 |
"%2\n\n" |
"%2\n\n" |
181 |
"Are you sure?") |
"Are you sure?") |
182 |
.arg(device.deviceTypeName()) |
.arg(device.deviceTypeName()) |
183 |
.arg(device.deviceName()), |
.arg(device.deviceName()), |
184 |
tr("OK"), tr("Cancel")) > 0) |
tr("OK"), tr("Cancel")) > 0) |
185 |
return; |
return; |
186 |
} |
} |
187 |
|
|
188 |
// Now it depends on the device type... |
// Now it depends on the device type... |
189 |
lscp_status_t ret = LSCP_FAILED; |
lscp_status_t ret = LSCP_FAILED; |
205 |
// Show result. |
// Show result. |
206 |
if (ret == LSCP_OK) { |
if (ret == LSCP_OK) { |
207 |
// Show log message before loosing it. |
// Show log message before loosing it. |
208 |
m_pMainForm->appendMessages(device.deviceName() + ' ' |
m_pMainForm->appendMessages(device.deviceTypeName() |
209 |
+ tr("deleted.")); |
+ ' ' + device.deviceName() |
210 |
|
+ ' ' + tr("deleted.")); |
211 |
// Done. |
// Done. |
212 |
delete pItem; |
delete pItem; |
213 |
// Main session should be marked dirty. |
// Main session should be marked dirty. |
234 |
m_pAudioItems = new qsamplerDeviceItem(DeviceListView, m_pClient, |
m_pAudioItems = new qsamplerDeviceItem(DeviceListView, m_pClient, |
235 |
qsamplerDevice::Audio); |
qsamplerDevice::Audio); |
236 |
if (m_pAudioItems) { |
if (m_pAudioItems) { |
|
m_pAudioItems->setText(0, tr("Audio")); |
|
237 |
piDeviceIDs = qsamplerDevice::getDevices(m_pClient, qsamplerDevice::Audio); |
piDeviceIDs = qsamplerDevice::getDevices(m_pClient, qsamplerDevice::Audio); |
238 |
for (int i = 0; piDeviceIDs && piDeviceIDs[i] >= 0; i++) { |
for (int i = 0; piDeviceIDs && piDeviceIDs[i] >= 0; i++) { |
239 |
new qsamplerDeviceItem(m_pAudioItems, m_pClient, |
new qsamplerDeviceItem(m_pAudioItems, m_pClient, |
245 |
m_pMidiItems = new qsamplerDeviceItem(DeviceListView, m_pClient, |
m_pMidiItems = new qsamplerDeviceItem(DeviceListView, m_pClient, |
246 |
qsamplerDevice::Midi); |
qsamplerDevice::Midi); |
247 |
if (m_pMidiItems) { |
if (m_pMidiItems) { |
|
m_pMidiItems->setText(0, tr("MIDI")); |
|
248 |
piDeviceIDs = qsamplerDevice::getDevices(m_pClient, qsamplerDevice::Midi); |
piDeviceIDs = qsamplerDevice::getDevices(m_pClient, qsamplerDevice::Midi); |
249 |
for (int i = 0; piDeviceIDs && piDeviceIDs[i] >= 0; i++) { |
for (int i = 0; piDeviceIDs && piDeviceIDs[i] >= 0; i++) { |
250 |
new qsamplerDeviceItem(m_pMidiItems, m_pClient, |
new qsamplerDeviceItem(m_pMidiItems, m_pClient, |
282 |
if (m_bNewDevice) { |
if (m_bNewDevice) { |
283 |
m_iDirtySetup++; |
m_iDirtySetup++; |
284 |
device.setDriver(m_pClient, sDriverName); |
device.setDriver(m_pClient, sDriverName); |
285 |
DeviceParamTable->refresh(device); |
DeviceParamTable->refresh(device.params(), m_bNewDevice); |
286 |
m_iDirtySetup--; |
m_iDirtySetup--; |
287 |
// Done. |
// Done. |
288 |
stabilizeForm(); |
stabilizeForm(); |
305 |
m_deviceType = qsamplerDevice::None; |
m_deviceType = qsamplerDevice::None; |
306 |
DeviceNameTextLabel->setText(QString::null); |
DeviceNameTextLabel->setText(QString::null); |
307 |
DeviceParamTable->setNumRows(0); |
DeviceParamTable->setNumRows(0); |
308 |
|
DevicePortComboBox->clear(); |
309 |
|
DevicePortParamTable->setNumRows(0); |
310 |
|
DevicePortComboBox->setEnabled(false); |
311 |
|
DevicePortParamTable->setEnabled(false); |
312 |
stabilizeForm(); |
stabilizeForm(); |
313 |
return; |
return; |
314 |
} |
} |
315 |
|
|
|
m_iDirtySetup++; |
|
316 |
qsamplerDevice& device = ((qsamplerDeviceItem *) pItem)->device(); |
qsamplerDevice& device = ((qsamplerDeviceItem *) pItem)->device(); |
317 |
|
|
318 |
|
m_iDirtySetup++; |
319 |
// Flag whether this is a new device. |
// Flag whether this is a new device. |
320 |
m_bNewDevice = (device.deviceID() < 0); |
m_bNewDevice = (device.deviceID() < 0); |
321 |
|
|
322 |
// Fill the device/driver heading... |
// Fill the device/driver heading... |
323 |
DeviceNameTextLabel->setText(device.deviceTypeName() + ' ' + device.deviceName()); |
QString sPrefix; |
324 |
|
if (!m_bNewDevice) |
325 |
|
sPrefix += device.deviceTypeName() + ' '; |
326 |
|
DeviceNameTextLabel->setText(sPrefix + device.deviceName()); |
327 |
// The driver combobox is only rebuilt if device type has changed... |
// The driver combobox is only rebuilt if device type has changed... |
328 |
if (device.deviceType() != m_deviceType) { |
if (device.deviceType() != m_deviceType) { |
329 |
DriverNameComboBox->clear(); |
DriverNameComboBox->clear(); |
341 |
DriverNameTextLabel->setEnabled(m_bNewDevice); |
DriverNameTextLabel->setEnabled(m_bNewDevice); |
342 |
DriverNameComboBox->setEnabled(m_bNewDevice); |
DriverNameComboBox->setEnabled(m_bNewDevice); |
343 |
// Fill the device parameter table... |
// Fill the device parameter table... |
344 |
DeviceParamTable->refresh(device); |
DeviceParamTable->refresh(device.params(), m_bNewDevice); |
345 |
|
// And now the device port/channel parameter table... |
346 |
|
DevicePortComboBox->clear(); |
347 |
|
DevicePortParamTable->setNumRows(0); |
348 |
|
if (m_bNewDevice) { |
349 |
|
DevicePortComboBox->setEnabled(false); |
350 |
|
DevicePortParamTable->setEnabled(false); |
351 |
|
} else { |
352 |
|
QPixmap pixmap; |
353 |
|
switch (device.deviceType()) { |
354 |
|
case qsamplerDevice::Audio: |
355 |
|
pixmap = QPixmap::fromMimeSource("audio2.png"); |
356 |
|
break; |
357 |
|
case qsamplerDevice::Midi: |
358 |
|
pixmap = QPixmap::fromMimeSource("midi2.png"); |
359 |
|
break; |
360 |
|
case qsamplerDevice::None: |
361 |
|
break; |
362 |
|
} |
363 |
|
qsamplerDevicePortList& ports = device.ports(); |
364 |
|
qsamplerDevicePort *pPort; |
365 |
|
for (pPort = ports.first(); pPort; pPort = ports.next()) { |
366 |
|
DevicePortComboBox->insertItem(pixmap, |
367 |
|
device.deviceTypeName() + ' ' + pPort->portName()); |
368 |
|
} |
369 |
|
bool bEnabled = (ports.count() > 0); |
370 |
|
DevicePortComboBox->setEnabled(bEnabled); |
371 |
|
DevicePortParamTable->setEnabled(bEnabled); |
372 |
|
} |
373 |
// Done. |
// Done. |
374 |
m_iDirtySetup--; |
m_iDirtySetup--; |
375 |
|
|
376 |
|
// Make the device port/channel selection effective. |
377 |
|
selectDevicePort(DevicePortComboBox->currentItem()); |
378 |
|
} |
379 |
|
|
380 |
|
|
381 |
|
// Device port/channel selection slot. |
382 |
|
void qsamplerDeviceForm::selectDevicePort ( int iPort ) |
383 |
|
{ |
384 |
|
if (m_iDirtySetup > 0) |
385 |
|
return; |
386 |
|
|
387 |
|
// |
388 |
|
// Device port/channel selection has changed... |
389 |
|
// |
390 |
|
|
391 |
|
QListViewItem *pItem = DeviceListView->selectedItem(); |
392 |
|
if (pItem == NULL || pItem->rtti() != QSAMPLER_DEVICE_ITEM) |
393 |
|
return; |
394 |
|
|
395 |
|
qsamplerDevice& device = ((qsamplerDeviceItem *) pItem)->device(); |
396 |
|
qsamplerDevicePort *pPort = device.ports().at(iPort); |
397 |
|
if (pPort) { |
398 |
|
m_iDirtySetup++; |
399 |
|
DevicePortParamTable->refresh(pPort->params(), false); |
400 |
|
m_iDirtySetup--; |
401 |
|
} |
402 |
|
// Done. |
403 |
stabilizeForm(); |
stabilizeForm(); |
404 |
} |
} |
405 |
|
|
406 |
|
|
407 |
// parameter value change slot. |
// Device parameter value change slot. |
408 |
void qsamplerDeviceForm::changeValue ( int iRow, int iCol ) |
void qsamplerDeviceForm::changeDeviceParam ( int iRow, int iCol ) |
409 |
{ |
{ |
410 |
if (m_iDirtySetup > 0) |
if (m_iDirtySetup > 0) |
411 |
return; |
return; |
412 |
if (iRow < 0 || iCol < 0) |
if (iRow < 0 || iCol < 0) |
413 |
return; |
return; |
414 |
|
|
415 |
// |
// |
416 |
// Device parameter change... |
// Device parameter change... |
417 |
// |
// |
420 |
if (pItem == NULL || pItem->rtti() != QSAMPLER_DEVICE_ITEM) |
if (pItem == NULL || pItem->rtti() != QSAMPLER_DEVICE_ITEM) |
421 |
return; |
return; |
422 |
|
|
|
m_iDirtySetup++; |
|
423 |
qsamplerDevice& device = ((qsamplerDeviceItem *) pItem)->device(); |
qsamplerDevice& device = ((qsamplerDeviceItem *) pItem)->device(); |
424 |
|
|
425 |
|
m_iDirtySetup++; |
426 |
// Table 1st column has the parameter name; |
// Table 1st column has the parameter name; |
|
qsamplerDeviceParamMap& params = device.params(); |
|
427 |
const QString sParam = DeviceParamTable->text(iRow, 0); |
const QString sParam = DeviceParamTable->text(iRow, 0); |
428 |
const QString sValue = DeviceParamTable->text(iRow, iCol); |
const QString sValue = DeviceParamTable->text(iRow, iCol); |
429 |
params[sParam].value = sValue; |
int iRefresh = 0; |
430 |
|
|
431 |
|
// Set the local device parameter value. |
432 |
|
device.setParam(sParam, sValue); |
433 |
|
|
434 |
// Set proper device parameter, on existing device ... |
// Set proper device parameter, on existing device ... |
435 |
if (device.deviceID() >= 0) { |
if (device.deviceID() >= 0) { |
441 |
lscp_status_t ret = LSCP_FAILED; |
lscp_status_t ret = LSCP_FAILED; |
442 |
switch (device.deviceType()) { |
switch (device.deviceType()) { |
443 |
case qsamplerDevice::Audio: |
case qsamplerDevice::Audio: |
444 |
|
if (sParam == "CHANNELS") iRefresh++; |
445 |
if ((ret = ::lscp_set_audio_device_param(m_pClient, |
if ((ret = ::lscp_set_audio_device_param(m_pClient, |
446 |
device.deviceID(), ¶m)) != LSCP_OK) |
device.deviceID(), ¶m)) != LSCP_OK) |
447 |
m_pMainForm->appendMessagesClient("lscp_set_audio_device_param"); |
m_pMainForm->appendMessagesClient("lscp_set_audio_device_param"); |
448 |
break; |
break; |
449 |
case qsamplerDevice::Midi: |
case qsamplerDevice::Midi: |
450 |
|
if (sParam == "PORTS") iRefresh++; |
451 |
if ((ret = ::lscp_set_midi_device_param(m_pClient, |
if ((ret = ::lscp_set_midi_device_param(m_pClient, |
452 |
device.deviceID(), ¶m)) != LSCP_OK) |
device.deviceID(), ¶m)) != LSCP_OK) |
453 |
m_pMainForm->appendMessagesClient("lscp_set_midi_device_param"); |
m_pMainForm->appendMessagesClient("lscp_set_midi_device_param"); |
457 |
} |
} |
458 |
// Show result. |
// Show result. |
459 |
if (ret == LSCP_OK) { |
if (ret == LSCP_OK) { |
460 |
m_pMainForm->appendMessages(device.deviceName() + ' ' |
m_pMainForm->appendMessages(device.deviceTypeName() |
461 |
+ QString("%1: %2.").arg(sParam).arg(sValue)); |
+ ' ' + device.deviceName() |
462 |
|
+ ' ' + QString("%1: %2.").arg(sParam).arg(sValue)); |
463 |
|
// Special care for specific parameter changes... |
464 |
|
if (iRefresh > 0) |
465 |
|
iRefresh += device.refreshPorts(m_pClient); |
466 |
|
iRefresh += device.refreshDepends(m_pClient, sParam); |
467 |
|
} |
468 |
|
} |
469 |
|
|
470 |
|
// Done. |
471 |
|
m_iDirtySetup--; |
472 |
|
// Finally, we might need refreshing... |
473 |
|
if (iRefresh > 0) |
474 |
|
selectDevice(); |
475 |
|
else |
476 |
|
stabilizeForm(); |
477 |
|
// Main session should be dirtier... |
478 |
|
m_pMainForm->sessionDirty(); |
479 |
|
} |
480 |
|
|
481 |
|
|
482 |
|
// Device port/channel parameter value change slot. |
483 |
|
void qsamplerDeviceForm::changeDevicePortParam ( int iRow, int iCol ) |
484 |
|
{ |
485 |
|
if (m_iDirtySetup > 0) |
486 |
|
return; |
487 |
|
if (iRow < 0 || iCol < 0) |
488 |
|
return; |
489 |
|
|
490 |
|
// |
491 |
|
// Device port/channel parameter change... |
492 |
|
// |
493 |
|
|
494 |
|
QListViewItem *pItem = DeviceListView->selectedItem(); |
495 |
|
if (pItem == NULL || pItem->rtti() != QSAMPLER_DEVICE_ITEM) |
496 |
|
return; |
497 |
|
|
498 |
|
qsamplerDevice& device = ((qsamplerDeviceItem *) pItem)->device(); |
499 |
|
|
500 |
|
int iPort = DevicePortComboBox->currentItem(); |
501 |
|
qsamplerDevicePort *pPort = device.ports().at(iPort); |
502 |
|
if (pPort == NULL) |
503 |
|
return; |
504 |
|
|
505 |
|
m_iDirtySetup++; |
506 |
|
// Table 1st column has the parameter name; |
507 |
|
const QString sParam = DevicePortParamTable->text(iRow, 0); |
508 |
|
const QString sValue = DevicePortParamTable->text(iRow, iCol); |
509 |
|
|
510 |
|
// Set the local device port/channel parameter value. |
511 |
|
pPort->setParam(sParam, sValue); |
512 |
|
|
513 |
|
// Set proper device port/channel parameter, if any... |
514 |
|
if (device.deviceID() >= 0 && pPort->portID() >= 0) { |
515 |
|
// Prepare parameter struct. |
516 |
|
lscp_param_t param; |
517 |
|
param.key = (char *) sParam.latin1(); |
518 |
|
param.value = (char *) sValue.latin1(); |
519 |
|
// Now it depends on the device type... |
520 |
|
lscp_status_t ret = LSCP_FAILED; |
521 |
|
switch (device.deviceType()) { |
522 |
|
case qsamplerDevice::Audio: |
523 |
|
if ((ret = ::lscp_set_audio_channel_param(m_pClient, |
524 |
|
device.deviceID(), pPort->portID(), ¶m)) != LSCP_OK) |
525 |
|
m_pMainForm->appendMessagesClient("lscp_set_audio_channel_param"); |
526 |
|
break; |
527 |
|
case qsamplerDevice::Midi: |
528 |
|
if ((ret = ::lscp_set_midi_port_param(m_pClient, |
529 |
|
device.deviceID(), pPort->portID(), ¶m)) != LSCP_OK) |
530 |
|
m_pMainForm->appendMessagesClient("lscp_set_midi_port_param"); |
531 |
|
break; |
532 |
|
case qsamplerDevice::None: |
533 |
|
break; |
534 |
|
} |
535 |
|
// Show result. |
536 |
|
if (ret == LSCP_OK) { |
537 |
|
m_pMainForm->appendMessages(device.deviceTypeName() |
538 |
|
+ ' ' + device.deviceName() + ' ' + pPort->portName() |
539 |
|
+ ' ' + QString("%1: %2.").arg(sParam).arg(sValue)); |
540 |
} |
} |
541 |
} |
} |
542 |
|
|
548 |
} |
} |
549 |
|
|
550 |
|
|
551 |
|
// Device list view context menu handler. |
552 |
|
void qsamplerDeviceForm::contextMenu ( QListViewItem *pItem, const QPoint& pos, int ) |
553 |
|
{ |
554 |
|
int iItemID; |
555 |
|
|
556 |
|
// Build the device context menu... |
557 |
|
QPopupMenu* pContextMenu = new QPopupMenu(this); |
558 |
|
|
559 |
|
bool bClient = (m_pClient != NULL); |
560 |
|
bool bEnabled = (pItem != NULL); |
561 |
|
iItemID = pContextMenu->insertItem( |
562 |
|
QIconSet(QPixmap::fromMimeSource("deviceCreate.png")), |
563 |
|
tr("&Create device"), this, SLOT(createDevice())); |
564 |
|
pContextMenu->setItemEnabled(iItemID, bEnabled || (bClient && m_bNewDevice)); |
565 |
|
iItemID = pContextMenu->insertItem( |
566 |
|
QIconSet(QPixmap::fromMimeSource("deviceDelete.png")), |
567 |
|
tr("&Delete device"), this, SLOT(deleteDevice())); |
568 |
|
pContextMenu->setItemEnabled(iItemID, bEnabled && !m_bNewDevice); |
569 |
|
pContextMenu->insertSeparator(); |
570 |
|
iItemID = pContextMenu->insertItem( |
571 |
|
QIconSet(QPixmap::fromMimeSource("formRefresh.png")), |
572 |
|
tr("&Refresh"), this, SLOT(refreshDevices())); |
573 |
|
pContextMenu->setItemEnabled(iItemID, bClient); |
574 |
|
|
575 |
|
pContextMenu->exec(pos); |
576 |
|
|
577 |
|
delete pContextMenu; |
578 |
|
} |
579 |
|
|
580 |
|
|
581 |
// Stabilize current form state. |
// Stabilize current form state. |
582 |
void qsamplerDeviceForm::stabilizeForm (void) |
void qsamplerDeviceForm::stabilizeForm (void) |
583 |
{ |
{ |
584 |
QListViewItem *pItem = DeviceListView->selectedItem(); |
QListViewItem *pItem = DeviceListView->selectedItem(); |
585 |
|
bool bClient = (m_pClient != NULL); |
586 |
bool bEnabled = (pItem != NULL); |
bool bEnabled = (pItem != NULL); |
587 |
DeviceNameTextLabel->setEnabled(bEnabled && !m_bNewDevice); |
DeviceNameTextLabel->setEnabled(bEnabled && !m_bNewDevice); |
588 |
DriverNameTextLabel->setEnabled(bEnabled && m_bNewDevice); |
DriverNameTextLabel->setEnabled(bEnabled && m_bNewDevice); |
589 |
DriverNameComboBox->setEnabled(bEnabled && m_bNewDevice); |
DriverNameComboBox->setEnabled(bEnabled && m_bNewDevice); |
590 |
DeviceParamTable->setEnabled(bEnabled); |
DeviceParamTable->setEnabled(bEnabled); |
591 |
CreateDevicePushButton->setEnabled(bEnabled || m_bNewDevice); |
RefreshDevicesPushButton->setEnabled(bClient); |
592 |
|
CreateDevicePushButton->setEnabled(bEnabled || (bClient && m_bNewDevice)); |
593 |
DeleteDevicePushButton->setEnabled(bEnabled && !m_bNewDevice); |
DeleteDevicePushButton->setEnabled(bEnabled && !m_bNewDevice); |
594 |
} |
} |
595 |
|
|
596 |
|
|
597 |
// end of qsamplerDeviceForm.ui.h |
// end of qsamplerDeviceForm.ui.h |
598 |
|
|
599 |
|
|
600 |
|
|