/[svn]/linuxsampler/trunk/src/engines/sfz/Engine.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/sfz/Engine.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2243 by persson, Thu Aug 12 15:36:15 2010 UTC revision 2244 by iliev, Thu Aug 18 11:32:33 2011 UTC
# Line 27  Line 27 
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,

Legend:
Removed from v.2243  
changed lines
  Added in v.2244

  ViewVC Help
Powered by ViewVC