27 |
|
|
28 |
namespace LinuxSampler { namespace sfz { |
namespace LinuxSampler { namespace sfz { |
29 |
Engine::Format Engine::GetEngineFormat() { return SFZ; } |
Engine::Format Engine::GetEngineFormat() { return SFZ; } |
30 |
|
|
31 |
|
Engine::Engine() { |
32 |
|
pCCPool = new Pool<CCSignalUnit::CC>(GLOBAL_MAX_VOICES * MaxCCPerVoice); |
33 |
|
pSmootherPool = new Pool<Smoother>(GLOBAL_MAX_VOICES * MaxCCPerVoice); |
34 |
|
for (VoiceIterator iterVoice = GetVoicePool()->allocAppend(); iterVoice == GetVoicePool()->last(); iterVoice = GetVoicePool()->allocAppend()) { |
35 |
|
(static_cast<SfzSignalUnitRack*>(iterVoice->pSignalUnitRack))->InitRTLists(); |
36 |
|
} |
37 |
|
GetVoicePool()->clear(); |
38 |
|
} |
39 |
|
|
40 |
|
Engine::~Engine() { |
41 |
|
if (pCCPool) { |
42 |
|
pCCPool->clear(); |
43 |
|
delete pCCPool; |
44 |
|
} |
45 |
|
|
46 |
|
if (pSmootherPool) { |
47 |
|
pSmootherPool->clear(); |
48 |
|
delete pSmootherPool; |
49 |
|
} |
50 |
|
} |
51 |
|
|
52 |
|
void Engine::PostSetMaxVoices(int iVoices) { |
53 |
|
pCCPool->resizePool(iVoices * MaxCCPerVoice); |
54 |
|
pSmootherPool->resizePool(iVoices * MaxCCPerVoice); |
55 |
|
|
56 |
|
for (VoiceIterator iterVoice = GetVoicePool()->allocAppend(); iterVoice == GetVoicePool()->last(); iterVoice = GetVoicePool()->allocAppend()) { |
57 |
|
(static_cast<SfzSignalUnitRack*>(iterVoice->pSignalUnitRack))->InitRTLists(); |
58 |
|
} |
59 |
|
GetVoicePool()->clear(); |
60 |
|
} |
61 |
|
|
62 |
/** |
/** |
63 |
* Reacts on supported control change commands (e.g. pitch bend wheel, |
* Reacts on supported control change commands (e.g. pitch bend wheel, |