32 |
#include "drivers/audio/AudioOutputDeviceFactory.h" |
#include "drivers/audio/AudioOutputDeviceFactory.h" |
33 |
#include "drivers/midi/MidiInputDeviceFactory.h" |
#include "drivers/midi/MidiInputDeviceFactory.h" |
34 |
#include "drivers/midi/MidiInstrumentMapper.h" |
#include "drivers/midi/MidiInstrumentMapper.h" |
35 |
|
#include "common/Features.h" |
36 |
|
|
37 |
namespace LinuxSampler { |
namespace LinuxSampler { |
38 |
|
|
319 |
} |
} |
320 |
} |
} |
321 |
|
|
322 |
|
void Sampler::fireMidiDeviceToBeDestroyed(MidiInputDevice* pDevice) { |
323 |
|
for (int i = 0; i < llMidiDeviceCountListeners.GetListenerCount(); i++) { |
324 |
|
llMidiDeviceCountListeners.GetListener(i)->MidiDeviceToBeDestroyed(pDevice); |
325 |
|
} |
326 |
|
} |
327 |
|
|
328 |
|
void Sampler::fireMidiDeviceCreated(MidiInputDevice* pDevice) { |
329 |
|
for (int i = 0; i < llMidiDeviceCountListeners.GetListenerCount(); i++) { |
330 |
|
llMidiDeviceCountListeners.GetListener(i)->MidiDeviceCreated(pDevice); |
331 |
|
} |
332 |
|
} |
333 |
|
|
334 |
void Sampler::AddVoiceCountListener(VoiceCountListener* l) { |
void Sampler::AddVoiceCountListener(VoiceCountListener* l) { |
335 |
llVoiceCountListeners.AddListener(l); |
llVoiceCountListeners.AddListener(l); |
336 |
} |
} |
572 |
for (uint i = 0; i < SamplerChannels(); i++) |
for (uint i = 0; i < SamplerChannels(); i++) |
573 |
if (GetSamplerChannel(i)->GetMidiInputDevice() == pDevice) throw Exception("Sampler channel " + ToString(i) + " is still connected to the midi input device."); |
if (GetSamplerChannel(i)->GetMidiInputDevice() == pDevice) throw Exception("Sampler channel " + ToString(i) + " is still connected to the midi input device."); |
574 |
|
|
575 |
|
fireMidiDeviceToBeDestroyed(pDevice); |
576 |
|
|
577 |
// disable device |
// disable device |
578 |
pDevice->StopListen(); |
pDevice->StopListen(); |
579 |
|
|
601 |
} |
} |
602 |
} |
} |
603 |
|
|
604 |
|
fireMidiDeviceCreated(pDevice); |
605 |
fireMidiDeviceCountChanged(MidiInputDevices()); |
fireMidiDeviceCountChanged(MidiInputDevices()); |
606 |
return pDevice; |
return pDevice; |
607 |
} |
} |
681 |
InstrumentEditorFactory::ClosePlugins(); |
InstrumentEditorFactory::ClosePlugins(); |
682 |
} |
} |
683 |
|
|
684 |
|
bool Sampler::EnableDenormalsAreZeroMode() { |
685 |
|
Features::detect(); |
686 |
|
return Features::enableDenormalsAreZeroMode(); |
687 |
|
} |
688 |
|
|
689 |
} // namespace LinuxSampler |
} // namespace LinuxSampler |