/[svn]/linuxsampler/trunk/src/engines/gig/EngineChannel.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/gig/EngineChannel.cpp

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

revision 675 by schoenebeck, Wed Jun 22 22:09:28 2005 UTC revision 738 by schoenebeck, Tue Aug 16 17:14:25 2005 UTC
# Line 30  namespace LinuxSampler { namespace gig { Line 30  namespace LinuxSampler { namespace gig {
30          pEngine      = NULL;          pEngine      = NULL;
31          pInstrument  = NULL;          pInstrument  = NULL;
32          pEvents      = NULL; // we allocate when we retrieve the right Engine object          pEvents      = NULL; // we allocate when we retrieve the right Engine object
         pCCEvents    = NULL; // we allocate when we retrieve the right Engine object  
33          pEventQueue  = new RingBuffer<Event>(CONFIG_MAX_EVENTS_PER_FRAGMENT, 0);          pEventQueue  = new RingBuffer<Event>(CONFIG_MAX_EVENTS_PER_FRAGMENT, 0);
34          pActiveKeys  = new Pool<uint>(128);          pActiveKeys  = new Pool<uint>(128);
35          for (uint i = 0; i < 128; i++) {          for (uint i = 0; i < 128; i++) {
# Line 42  namespace LinuxSampler { namespace gig { Line 41  namespace LinuxSampler { namespace gig {
41              pMIDIKeyInfo[i].VoiceTheftsQueued = 0;              pMIDIKeyInfo[i].VoiceTheftsQueued = 0;
42              pMIDIKeyInfo[i].RoundRobinIndex = 0;              pMIDIKeyInfo[i].RoundRobinIndex = 0;
43          }          }
         for (uint i = 0; i < Event::destination_count; i++) {  
             pSynthesisEvents[i] = NULL; // we allocate when we retrieve the right Engine object  
         }  
44          InstrumentIdx  = -1;          InstrumentIdx  = -1;
45          InstrumentStat = -1;          InstrumentStat = -1;
46          AudioDeviceChannelLeft  = -1;          AudioDeviceChannelLeft  = -1;
# Line 261  namespace LinuxSampler { namespace gig { Line 257  namespace LinuxSampler { namespace gig {
257          }          }
258          pEngine = Engine::AcquireEngine(this, pAudioOut);          pEngine = Engine::AcquireEngine(this, pAudioOut);
259          ResetInternal();          ResetInternal();
260          pEvents   = new RTList<Event>(pEngine->pEventPool);          pEvents = new RTList<Event>(pEngine->pEventPool);
         pCCEvents = new RTList<Event>(pEngine->pEventPool);  
         for (uint i = 0; i < Event::destination_count; i++) {  
             pSynthesisEvents[i] = new RTList<Event>(pEngine->pEventPool);  
         }  
261          for (uint i = 0; i < 128; i++) {          for (uint i = 0; i < 128; i++) {
262              pMIDIKeyInfo[i].pActiveVoices = new RTList<Voice>(pEngine->pVoicePool);              pMIDIKeyInfo[i].pActiveVoices = new RTList<Voice>(pEngine->pVoicePool);
263              pMIDIKeyInfo[i].pEvents       = new RTList<Event>(pEngine->pEventPool);              pMIDIKeyInfo[i].pEvents       = new RTList<Event>(pEngine->pEventPool);
# Line 283  namespace LinuxSampler { namespace gig { Line 275  namespace LinuxSampler { namespace gig {
275                  delete pEvents;                  delete pEvents;
276                  pEvents = NULL;                  pEvents = NULL;
277              }              }
             if (pCCEvents) {  
                 delete pCCEvents;  
                 pCCEvents = NULL;  
             }  
278              for (uint i = 0; i < 128; i++) {              for (uint i = 0; i < 128; i++) {
279                  if (pMIDIKeyInfo[i].pActiveVoices) {                  if (pMIDIKeyInfo[i].pActiveVoices) {
280                      delete pMIDIKeyInfo[i].pActiveVoices;                      delete pMIDIKeyInfo[i].pActiveVoices;
# Line 297  namespace LinuxSampler { namespace gig { Line 285  namespace LinuxSampler { namespace gig {
285                      pMIDIKeyInfo[i].pEvents = NULL;                      pMIDIKeyInfo[i].pEvents = NULL;
286                  }                  }
287              }              }
             for (uint i = 0; i < Event::destination_count; i++) {  
                 if (pSynthesisEvents[i]) {  
                     delete pSynthesisEvents[i];  
                     pSynthesisEvents[i] = NULL;  
                 }  
             }  
288              Engine* oldEngine = pEngine;              Engine* oldEngine = pEngine;
289              AudioOutputDevice* oldAudioDevice = pEngine->pAudioOutputDevice;              AudioOutputDevice* oldAudioDevice = pEngine->pAudioOutputDevice;
290              pEngine = NULL;              pEngine = NULL;
# Line 440  namespace LinuxSampler { namespace gig { Line 422  namespace LinuxSampler { namespace gig {
422    
423      void EngineChannel::ClearEventLists() {      void EngineChannel::ClearEventLists() {
424          pEvents->clear();          pEvents->clear();
         pCCEvents->clear();  
         for (uint i = 0; i < Event::destination_count; i++) {  
             pSynthesisEvents[i]->clear();  
         }  
425          // empty MIDI key specific event lists          // empty MIDI key specific event lists
426          {          {
427              RTList<uint>::Iterator iuiKey = pActiveKeys->first();              RTList<uint>::Iterator iuiKey = pActiveKeys->first();

Legend:
Removed from v.675  
changed lines
  Added in v.738

  ViewVC Help
Powered by ViewVC