316 |
// Refresh MIDI device options. |
// Refresh MIDI device options. |
317 |
void qsamplerChannelForm::selectMidiDriver ( const QString& sMidiDriver ) |
void qsamplerChannelForm::selectMidiDriver ( const QString& sMidiDriver ) |
318 |
{ |
{ |
319 |
|
const QString sDriverName = sMidiDriver.upper(); |
320 |
|
|
321 |
MidiDeviceComboBox->clear(); |
MidiDeviceComboBox->clear(); |
322 |
m_audioDevices.clear(); |
m_audioDevices.clear(); |
323 |
|
|
327 |
for (int i = 0; piDeviceIDs && piDeviceIDs[i] >= 0; i++) { |
for (int i = 0; piDeviceIDs && piDeviceIDs[i] >= 0; i++) { |
328 |
qsamplerDevice *pDevice = new qsamplerDevice(m_pChannel->client(), |
qsamplerDevice *pDevice = new qsamplerDevice(m_pChannel->client(), |
329 |
qsamplerDevice::Midi, piDeviceIDs[i]); |
qsamplerDevice::Midi, piDeviceIDs[i]); |
330 |
if (pDevice->driverName() == sMidiDriver) { |
if (pDevice->driverName().upper() == sDriverName) { |
331 |
MidiDeviceComboBox->insertItem(midiPixmap, pDevice->deviceName()); |
MidiDeviceComboBox->insertItem(midiPixmap, pDevice->deviceName()); |
332 |
m_midiDevices.append(pDevice); |
m_midiDevices.append(pDevice); |
333 |
} else { |
} else { |
336 |
} |
} |
337 |
|
|
338 |
bool bEnabled = !m_midiDevices.isEmpty(); |
bool bEnabled = !m_midiDevices.isEmpty(); |
339 |
|
if (!bEnabled) |
340 |
|
MidiDeviceComboBox->insertItem(tr("(New MIDI device)")); |
341 |
MidiDeviceTextLabel->setEnabled(bEnabled); |
MidiDeviceTextLabel->setEnabled(bEnabled); |
342 |
MidiDeviceComboBox->setEnabled(bEnabled); |
MidiDeviceComboBox->setEnabled(bEnabled); |
343 |
optionsChanged(); |
optionsChanged(); |
347 |
// Refresh Audio device options. |
// Refresh Audio device options. |
348 |
void qsamplerChannelForm::selectAudioDriver ( const QString& sAudioDriver ) |
void qsamplerChannelForm::selectAudioDriver ( const QString& sAudioDriver ) |
349 |
{ |
{ |
350 |
|
const QString sDriverName = sAudioDriver.upper(); |
351 |
|
|
352 |
AudioDeviceComboBox->clear(); |
AudioDeviceComboBox->clear(); |
353 |
m_audioDevices.clear(); |
m_audioDevices.clear(); |
354 |
|
|
358 |
for (int i = 0; piDeviceIDs && piDeviceIDs[i] >= 0; i++) { |
for (int i = 0; piDeviceIDs && piDeviceIDs[i] >= 0; i++) { |
359 |
qsamplerDevice *pDevice = new qsamplerDevice(m_pChannel->client(), |
qsamplerDevice *pDevice = new qsamplerDevice(m_pChannel->client(), |
360 |
qsamplerDevice::Audio, piDeviceIDs[i]); |
qsamplerDevice::Audio, piDeviceIDs[i]); |
361 |
if (pDevice->driverName() == sAudioDriver) { |
if (pDevice->driverName().upper() == sDriverName) { |
362 |
AudioDeviceComboBox->insertItem(audioPixmap, pDevice->deviceName()); |
AudioDeviceComboBox->insertItem(audioPixmap, pDevice->deviceName()); |
363 |
m_audioDevices.append(pDevice); |
m_audioDevices.append(pDevice); |
364 |
} else { |
} else { |
367 |
} |
} |
368 |
|
|
369 |
bool bEnabled = !m_audioDevices.isEmpty(); |
bool bEnabled = !m_audioDevices.isEmpty(); |
370 |
|
if (!bEnabled) |
371 |
|
AudioDeviceComboBox->insertItem(tr("(New Audio device)")); |
372 |
AudioDeviceTextLabel->setEnabled(bEnabled); |
AudioDeviceTextLabel->setEnabled(bEnabled); |
373 |
AudioDeviceComboBox->setEnabled(bEnabled); |
AudioDeviceComboBox->setEnabled(bEnabled); |
374 |
optionsChanged(); |
optionsChanged(); |