550 |
for (; iter != mAudioOutputDevices.end(); iter++) { |
for (; iter != mAudioOutputDevices.end(); iter++) { |
551 |
if (iter->second == pDevice) { |
if (iter->second == pDevice) { |
552 |
// check if there are still sampler engines connected to this device |
// check if there are still sampler engines connected to this device |
553 |
for (uint i = 0; i < SamplerChannels(); i++) |
for (SamplerChannelMap::iterator iterChan = mSamplerChannels.begin(); |
554 |
if (GetSamplerChannel(i)->GetAudioOutputDevice() == pDevice) throw Exception("Sampler channel " + ToString(i) + " is still connected to the audio output device."); |
iterChan != mSamplerChannels.end(); iterChan++) |
555 |
|
if (iterChan->second->GetAudioOutputDevice() == pDevice) throw Exception("Sampler channel " + ToString(iterChan->first) + " is still connected to the audio output device."); |
556 |
|
|
557 |
// disable device |
// disable device |
558 |
pDevice->Stop(); |
pDevice->Stop(); |
574 |
for (; iter != mMidiInputDevices.end(); iter++) { |
for (; iter != mMidiInputDevices.end(); iter++) { |
575 |
if (iter->second == pDevice) { |
if (iter->second == pDevice) { |
576 |
// check if there are still sampler engines connected to this device |
// check if there are still sampler engines connected to this device |
577 |
for (uint i = 0; i < SamplerChannels(); i++) |
for (SamplerChannelMap::iterator iterChan = mSamplerChannels.begin(); |
578 |
if (GetSamplerChannel(i)->GetMidiInputDevice() == pDevice) throw Exception("Sampler channel " + ToString(i) + " is still connected to the midi input device."); |
iterChan != mSamplerChannels.end(); iterChan++) |
579 |
|
if (iterChan->second->GetMidiInputDevice() == pDevice) throw Exception("Sampler channel " + ToString(iterChan->first) + " is still connected to the midi input device."); |
580 |
|
|
581 |
fireMidiDeviceToBeDestroyed(pDevice); |
fireMidiDeviceToBeDestroyed(pDevice); |
582 |
|
|