459 |
m_iAudioDevice = pChannelInfo->audio_device; |
m_iAudioDevice = pChannelInfo->audio_device; |
460 |
m_fVolume = pChannelInfo->volume; |
m_fVolume = pChannelInfo->volume; |
461 |
// Some sanity checks. |
// Some sanity checks. |
462 |
if (m_sEngineName == "NONE") |
if (m_sEngineName == "NONE" || m_sEngineName.isEmpty()) |
463 |
m_sEngineName = QString::null; |
m_sEngineName = QString::null; |
464 |
if (m_sInstrumentFile == "NONE") { |
if (m_sInstrumentFile == "NONE" || m_sInstrumentFile.isEmpty()) { |
465 |
m_sInstrumentFile = QString::null; |
m_sInstrumentFile = QString::null; |
466 |
m_sInstrumentName = QString::null; |
m_sInstrumentName = QString::null; |
467 |
} |
} |
468 |
|
|
469 |
|
// FIXME: DEPRECATED... |
470 |
|
lscp_device_info_t *pDeviceInfo; |
471 |
|
const QString sNone = QObject::tr("(none)"); |
472 |
|
// Audio device driver type. |
473 |
|
pDeviceInfo = ::lscp_get_audio_device_info(client(), m_iAudioDevice); |
474 |
|
if (pDeviceInfo == NULL) { |
475 |
|
appendMessagesClient("lscp_get_audio_device_info"); |
476 |
|
m_sAudioDriver = sNone; |
477 |
|
} else { |
478 |
|
m_sAudioDriver = pDeviceInfo->driver; |
479 |
|
} |
480 |
|
// MIDI device driver type. |
481 |
|
pDeviceInfo = ::lscp_get_midi_device_info(client(), m_iMidiDevice); |
482 |
|
if (pDeviceInfo == NULL) { |
483 |
|
appendMessagesClient("lscp_get_midi_device_info"); |
484 |
|
m_sMidiDriver = sNone; |
485 |
|
} else { |
486 |
|
m_sMidiDriver = pDeviceInfo->driver; |
487 |
|
} |
488 |
|
|
489 |
return true; |
return true; |
490 |
} |
} |
572 |
|
|
573 |
QFile file(sInstrumentFile); |
QFile file(sInstrumentFile); |
574 |
if (file.open(IO_ReadOnly)) { |
if (file.open(IO_ReadOnly)) { |
575 |
char achHeader[4]; |
char achHeader[16]; |
576 |
if (file.readBlock(achHeader, 4)) { |
if (file.readBlock(achHeader, 16)) { |
577 |
bResult = (achHeader[0] == 'R' |
bResult = (::memcmp(&achHeader[0], "RIFF", 4) == 0 |
578 |
&& achHeader[1] == 'I' |
&& ::memcmp(&achHeader[8], "DLS LIST", 8) == 0); |
|
&& achHeader[2] == 'F' |
|
|
&& achHeader[3] == 'F'); |
|
579 |
} |
} |
580 |
file.close(); |
file.close(); |
581 |
} |
} |