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

Diff of /linuxsampler/trunk/src/engines/AbstractEngineChannel.cpp

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

revision 2114 by persson, Tue Aug 10 12:05:19 2010 UTC revision 2127 by persson, Wed Sep 22 18:59:16 2010 UTC
# Line 668  namespace LinuxSampler { Line 668  namespace LinuxSampler {
668       */       */
669      void AbstractEngineChannel::AddGroup(uint group) {      void AbstractEngineChannel::AddGroup(uint group) {
670          if (group) {          if (group) {
671              typedef std::map<uint, RTList<Event>*> map_t;              std::pair<ActiveKeyGroupMap::iterator, bool> p =
672                    ActiveKeyGroups.insert(ActiveKeyGroupMap::value_type(group, 0));
             std::pair<map_t::iterator, bool> p =  
                 ActiveKeyGroups.insert(map_t::value_type(group, 0));  
673              if (p.second) {              if (p.second) {
674                  (*p.first).second = new RTList<Event>(pEngine->pEventPool);                  // If the engine channel is pending deletion (see bug
675                    // #113), pEngine will be null, so we can't use
676                    // pEngine->pEventPool here. Instead we're using a
677                    // specialized RTList that allows specifying the pool
678                    // later.
679                    (*p.first).second = new LazyList<Event>;
680              }              }
681          }          }
682      }      }
# Line 685  namespace LinuxSampler { Line 688  namespace LinuxSampler {
688          dmsg(4,("HandelKeyGroupConflicts KeyGroup=%d\n", KeyGroup));          dmsg(4,("HandelKeyGroupConflicts KeyGroup=%d\n", KeyGroup));
689          if (KeyGroup) {          if (KeyGroup) {
690              // send a release event to all active voices in the group              // send a release event to all active voices in the group
691              RTList<Event>::Iterator itEvent = ActiveKeyGroups[KeyGroup]->allocAppend();              RTList<Event>::Iterator itEvent = ActiveKeyGroups[KeyGroup]->allocAppend(pEngine->pEventPool);
692              *itEvent = *itNoteOnEvent;              *itEvent = *itNoteOnEvent;
693          }          }
694      }      }
# Line 695  namespace LinuxSampler { Line 698  namespace LinuxSampler {
698       * audio thread, after all voices have been rendered.       * audio thread, after all voices have been rendered.
699       */       */
700      void AbstractEngineChannel::ClearGroupEventLists() {      void AbstractEngineChannel::ClearGroupEventLists() {
701          for (std::map<uint,RTList<Event>*>::iterator iter = ActiveKeyGroups.begin();          for (ActiveKeyGroupMap::iterator iter = ActiveKeyGroups.begin();
702               iter != ActiveKeyGroups.end(); iter++) {               iter != ActiveKeyGroups.end(); iter++) {
703              if (iter->second) {              if (iter->second) {
704                  iter->second->clear();                  iter->second->clear();
# Line 709  namespace LinuxSampler { Line 712  namespace LinuxSampler {
712       * Remove all lists with group events.       * Remove all lists with group events.
713       */       */
714      void AbstractEngineChannel::DeleteGroupEventLists() {      void AbstractEngineChannel::DeleteGroupEventLists() {
715          for (std::map<uint,RTList<Event>*>::iterator iter = ActiveKeyGroups.begin();          for (ActiveKeyGroupMap::iterator iter = ActiveKeyGroups.begin();
716               iter != ActiveKeyGroups.end(); iter++) {               iter != ActiveKeyGroups.end(); iter++) {
717              delete iter->second;              delete iter->second;
718          }          }

Legend:
Removed from v.2114  
changed lines
  Added in v.2127

  ViewVC Help
Powered by ViewVC