50 |
QObject::connect(DevicePortParamTable, SIGNAL(valueChanged(int,int)), |
QObject::connect(DevicePortParamTable, SIGNAL(valueChanged(int,int)), |
51 |
this, SLOT(changeDevicePortParam(int,int))); |
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 |
} |
} |
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 |
} |
} |
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. |
307 |
m_deviceType = qsamplerDevice::None; |
m_deviceType = qsamplerDevice::None; |
308 |
DeviceNameTextLabel->setText(QString::null); |
DeviceNameTextLabel->setText(QString::null); |
309 |
DeviceParamTable->setNumRows(0); |
DeviceParamTable->setNumRows(0); |
310 |
|
DevicePortParamTable->setNumRows(0); |
311 |
DevicePortComboBox->setEnabled(false); |
DevicePortComboBox->setEnabled(false); |
312 |
DevicePortParamTable->setEnabled(false); |
DevicePortParamTable->setEnabled(false); |
313 |
stabilizeForm(); |
stabilizeForm(); |
427 |
// Table 1st column has the parameter name; |
// Table 1st column has the parameter name; |
428 |
const QString sParam = DeviceParamTable->text(iRow, 0); |
const QString sParam = DeviceParamTable->text(iRow, 0); |
429 |
const QString sValue = DeviceParamTable->text(iRow, iCol); |
const QString sValue = DeviceParamTable->text(iRow, iCol); |
430 |
|
int iRefresh = 0; |
431 |
|
|
432 |
// Set the local device parameter value. |
// Set the local device parameter value. |
433 |
device.setParam(sParam, sValue); |
device.setParam(sParam, sValue); |
439 |
param.key = (char *) sParam.latin1(); |
param.key = (char *) sParam.latin1(); |
440 |
param.value = (char *) sValue.latin1(); |
param.value = (char *) sValue.latin1(); |
441 |
// Now it depends on the device type... |
// Now it depends on the device type... |
|
bool bRefresh = false; |
|
442 |
lscp_status_t ret = LSCP_FAILED; |
lscp_status_t ret = LSCP_FAILED; |
443 |
switch (device.deviceType()) { |
switch (device.deviceType()) { |
444 |
case qsamplerDevice::Audio: |
case qsamplerDevice::Audio: |
445 |
bRefresh = (sParam == "CHANNELS"); |
if (sParam == "CHANNELS") iRefresh++; |
446 |
if ((ret = ::lscp_set_audio_device_param(m_pClient, |
if ((ret = ::lscp_set_audio_device_param(m_pClient, |
447 |
device.deviceID(), ¶m)) != LSCP_OK) |
device.deviceID(), ¶m)) != LSCP_OK) |
448 |
m_pMainForm->appendMessagesClient("lscp_set_audio_device_param"); |
m_pMainForm->appendMessagesClient("lscp_set_audio_device_param"); |
449 |
break; |
break; |
450 |
case qsamplerDevice::Midi: |
case qsamplerDevice::Midi: |
451 |
bRefresh = (sParam == "PORTS"); |
if (sParam == "PORTS") iRefresh++; |
452 |
if ((ret = ::lscp_set_midi_device_param(m_pClient, |
if ((ret = ::lscp_set_midi_device_param(m_pClient, |
453 |
device.deviceID(), ¶m)) != LSCP_OK) |
device.deviceID(), ¶m)) != LSCP_OK) |
454 |
m_pMainForm->appendMessagesClient("lscp_set_midi_device_param"); |
m_pMainForm->appendMessagesClient("lscp_set_midi_device_param"); |
458 |
} |
} |
459 |
// Show result. |
// Show result. |
460 |
if (ret == LSCP_OK) { |
if (ret == LSCP_OK) { |
461 |
m_pMainForm->appendMessages(device.deviceName() + ' ' |
m_pMainForm->appendMessages(device.deviceTypeName() |
462 |
+ QString("%1: %2.").arg(sParam).arg(sValue)); |
+ ' ' + device.deviceName() |
463 |
|
+ ' ' + QString("%1: %2.").arg(sParam).arg(sValue)); |
464 |
// Special care for specific parameter changes... |
// Special care for specific parameter changes... |
465 |
if (bRefresh) |
if (iRefresh > 0) |
466 |
device.refresh(m_pClient); |
iRefresh += device.refreshPorts(m_pClient); |
467 |
|
iRefresh += device.refreshDepends(m_pClient, sParam); |
468 |
} |
} |
469 |
} |
} |
470 |
|
|
471 |
// Done. |
// Done. |
472 |
m_iDirtySetup--; |
m_iDirtySetup--; |
473 |
stabilizeForm(); |
// Finally, we might need refreshing... |
474 |
|
if (iRefresh > 0) |
475 |
|
selectDevice(); |
476 |
|
else |
477 |
|
stabilizeForm(); |
478 |
// Main session should be dirtier... |
// Main session should be dirtier... |
479 |
m_pMainForm->sessionDirty(); |
m_pMainForm->sessionDirty(); |
480 |
} |
} |
535 |
} |
} |
536 |
// Show result. |
// Show result. |
537 |
if (ret == LSCP_OK) { |
if (ret == LSCP_OK) { |
538 |
m_pMainForm->appendMessages(device.deviceName() + ' ' |
m_pMainForm->appendMessages(device.deviceTypeName() |
539 |
+ pPort->portName() + ' ' |
+ ' ' + device.deviceName() + ' ' + pPort->portName() |
540 |
+ QString("%1: %2.").arg(sParam).arg(sValue)); |
+ ' ' + QString("%1: %2.").arg(sParam).arg(sValue)); |
541 |
} |
} |
542 |
} |
} |
543 |
|
|