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

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

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

revision 1044 by schoenebeck, Wed Feb 7 21:51:19 2007 UTC revision 1305 by iliev, Mon Aug 27 07:51:28 2007 UTC
# Line 141  namespace LinuxSampler { namespace gig { Line 141  namespace LinuxSampler { namespace gig {
141          if (pEventGenerator) delete pEventGenerator;          if (pEventGenerator) delete pEventGenerator;
142          if (pVoiceStealingQueue) delete pVoiceStealingQueue;          if (pVoiceStealingQueue) delete pVoiceStealingQueue;
143          if (pSysexBuffer) delete pSysexBuffer;          if (pSysexBuffer) delete pSysexBuffer;
144            if (pGlobalEvents) delete pGlobalEvents;
145            if (InstrumentChangeQueue) delete InstrumentChangeQueue;
146            if (InstrumentChangeReplyQueue) delete InstrumentChangeReplyQueue;
147            if (pDimRegionsInUse) delete[] pDimRegionsInUse;
148          Unregister();          Unregister();
149      }      }
150    
# Line 522  namespace LinuxSampler { namespace gig { Line 526  namespace LinuxSampler { namespace gig {
526          if (pEngineChannel->GetMute()) return; // skip if sampler channel is muted          if (pEngineChannel->GetMute()) return; // skip if sampler channel is muted
527          #endif          #endif
528    
529            uint voiceCount = 0;
530            uint streamCount = 0;
531          RTList<uint>::Iterator iuiKey = pEngineChannel->pActiveKeys->first();          RTList<uint>::Iterator iuiKey = pEngineChannel->pActiveKeys->first();
532          RTList<uint>::Iterator end    = pEngineChannel->pActiveKeys->end();          RTList<uint>::Iterator end    = pEngineChannel->pActiveKeys->end();
533          while (iuiKey != end) { // iterate through all active keys          while (iuiKey != end) { // iterate through all active keys
# Line 533  namespace LinuxSampler { namespace gig { Line 539  namespace LinuxSampler { namespace gig {
539              for (; itVoice != itVoicesEnd; ++itVoice) { // iterate through all voices on this key              for (; itVoice != itVoicesEnd; ++itVoice) { // iterate through all voices on this key
540                  // now render current voice                  // now render current voice
541                  itVoice->Render(Samples);                  itVoice->Render(Samples);
542                  if (itVoice->IsActive()) ActiveVoiceCountTemp++; // still active                  if (itVoice->IsActive()) { // still active
543                  else { // voice reached end, is now inactive                      ActiveVoiceCountTemp++;
544                        voiceCount++;
545    
546                        if (itVoice->PlaybackState == Voice::playback_state_disk) {
547                            if ((itVoice->DiskStreamRef).State == Stream::state_active) streamCount++;
548                        }
549                    }  else { // voice reached end, is now inactive
550                      FreeVoice(pEngineChannel, itVoice); // remove voice from the list of active voices                      FreeVoice(pEngineChannel, itVoice); // remove voice from the list of active voices
551                  }                  }
552              }              }
553          }          }
554            
555            pEngineChannel->SetVoiceCount(voiceCount);
556            pEngineChannel->SetDiskStreamCount(streamCount);
557      }      }
558    
559      /**      /**
# Line 564  namespace LinuxSampler { namespace gig { Line 579  namespace LinuxSampler { namespace gig {
579                  LaunchVoice(pEngineChannel, itVoiceStealEvent, itVoiceStealEvent->Param.Note.Layer, itVoiceStealEvent->Param.Note.ReleaseTrigger, false, false);                  LaunchVoice(pEngineChannel, itVoiceStealEvent, itVoiceStealEvent->Param.Note.Layer, itVoiceStealEvent->Param.Note.ReleaseTrigger, false, false);
580              if (itNewVoice) {              if (itNewVoice) {
581                  itNewVoice->Render(Samples);                  itNewVoice->Render(Samples);
582                  if (itNewVoice->IsActive()) ActiveVoiceCountTemp++; // still active                  if (itNewVoice->IsActive()) { // still active
583                  else { // voice reached end, is now inactive                      ActiveVoiceCountTemp++;
584                        pEngineChannel->SetVoiceCount(pEngineChannel->GetVoiceCount() + 1);
585    
586                        if (itNewVoice->PlaybackState == Voice::playback_state_disk) {
587                            if (itNewVoice->DiskStreamRef.State == Stream::state_active) {
588                                pEngineChannel->SetDiskStreamCount(pEngineChannel->GetDiskStreamCount() + 1);
589                            }
590                        }
591                    } else { // voice reached end, is now inactive
592                      FreeVoice(pEngineChannel, itNewVoice); // remove voice from the list of active voices                      FreeVoice(pEngineChannel, itNewVoice); // remove voice from the list of active voices
593                  }                  }
594              }              }
# Line 1524  namespace LinuxSampler { namespace gig { Line 1547  namespace LinuxSampler { namespace gig {
1547                  FxSend* pFxSend = pEngineChannel->GetFxSend(iFxSend);                  FxSend* pFxSend = pEngineChannel->GetFxSend(iFxSend);
1548                  if (pFxSend->MidiController() == itControlChangeEvent->Param.CC.Controller)                  if (pFxSend->MidiController() == itControlChangeEvent->Param.CC.Controller)
1549                      pFxSend->SetLevel(itControlChangeEvent->Param.CC.Value);                      pFxSend->SetLevel(itControlChangeEvent->Param.CC.Value);
1550                        pFxSend->SetInfoChanged(true);
1551              }              }
1552          }          }
1553      }      }
# Line 1720  namespace LinuxSampler { namespace gig { Line 1744  namespace LinuxSampler { namespace gig {
1744      }      }
1745    
1746      String Engine::Version() {      String Engine::Version() {
1747          String s = "$Revision: 1.75 $";          String s = "$Revision: 1.79 $";
1748          return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword          return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword
1749      }      }
1750    

Legend:
Removed from v.1044  
changed lines
  Added in v.1305

  ViewVC Help
Powered by ViewVC