25 |
|
|
26 |
#include "Sampler.h" |
#include "Sampler.h" |
27 |
|
|
28 |
|
#include "common/global_private.h" |
29 |
#include "engines/EngineFactory.h" |
#include "engines/EngineFactory.h" |
30 |
#include "engines/EngineChannelFactory.h" |
#include "engines/EngineChannelFactory.h" |
31 |
|
#include "plugins/InstrumentEditorFactory.h" |
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" |
68 |
|
|
69 |
void SamplerChannel::SetEngineType(String EngineType) throw (Exception) { |
void SamplerChannel::SetEngineType(String EngineType) throw (Exception) { |
70 |
dmsg(2,("SamplerChannel: Assigning engine type...")); |
dmsg(2,("SamplerChannel: Assigning engine type...")); |
71 |
|
|
72 |
|
if (pEngineChannel) { |
73 |
|
if (!strcasecmp(pEngineChannel->EngineName().c_str(), EngineType.c_str())) { |
74 |
|
dmsg(2,("OK\n")); |
75 |
|
return; |
76 |
|
} |
77 |
|
} |
78 |
|
|
79 |
// create new engine channel |
// create new engine channel |
80 |
EngineChannel* pNewEngineChannel = EngineChannelFactory::Create(EngineType); |
EngineChannel* pNewEngineChannel = EngineChannelFactory::Create(EngineType); |
340 |
} |
} |
341 |
} |
} |
342 |
|
|
343 |
|
void Sampler::AddTotalStreamCountListener(TotalStreamCountListener* l) { |
344 |
|
llTotalStreamCountListeners.AddListener(l); |
345 |
|
} |
346 |
|
|
347 |
|
void Sampler::RemoveTotalStreamCountListener(TotalStreamCountListener* l) { |
348 |
|
llTotalStreamCountListeners.RemoveListener(l); |
349 |
|
} |
350 |
|
|
351 |
|
void Sampler::fireTotalStreamCountChanged(int NewCount) { |
352 |
|
for (int i = 0; i < llTotalStreamCountListeners.GetListenerCount(); i++) { |
353 |
|
llTotalStreamCountListeners.GetListener(i)->TotalStreamCountChanged(NewCount); |
354 |
|
} |
355 |
|
} |
356 |
|
|
357 |
void Sampler::AddTotalVoiceCountListener(TotalVoiceCountListener* l) { |
void Sampler::AddTotalVoiceCountListener(TotalVoiceCountListener* l) { |
358 |
llTotalVoiceCountListeners.AddListener(l); |
llTotalVoiceCountListeners.AddListener(l); |
359 |
} |
} |
562 |
return pDevice; |
return pDevice; |
563 |
} |
} |
564 |
|
|
565 |
|
int Sampler::GetDiskStreamCount() { |
566 |
|
int count = 0; |
567 |
|
std::set<Engine*>::iterator it = EngineFactory::EngineInstances().begin(); |
568 |
|
|
569 |
|
for(; it != EngineFactory::EngineInstances().end(); it++) { |
570 |
|
count += (*it)->DiskStreamCount(); |
571 |
|
} |
572 |
|
|
573 |
|
return count; |
574 |
|
} |
575 |
|
|
576 |
int Sampler::GetVoiceCount() { |
int Sampler::GetVoiceCount() { |
577 |
int count = 0; |
int count = 0; |
578 |
std::set<Engine*>::iterator it = EngineFactory::EngineInstances().begin(); |
std::set<Engine*>::iterator it = EngineFactory::EngineInstances().begin(); |
632 |
std::cerr << "Sampler::Reset(): Exception occured while trying to delete all MIDI instrument maps, exiting.\n" << std::flush; |
std::cerr << "Sampler::Reset(): Exception occured while trying to delete all MIDI instrument maps, exiting.\n" << std::flush; |
633 |
exit(EXIT_FAILURE); |
exit(EXIT_FAILURE); |
634 |
} |
} |
635 |
|
|
636 |
|
// unload all instrument editor DLLs |
637 |
|
InstrumentEditorFactory::ClosePlugins(); |
638 |
} |
} |
639 |
|
|
640 |
} // namespace LinuxSampler |
} // namespace LinuxSampler |