/[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 1248 by persson, Fri Jun 22 10:10:06 2007 UTC revision 1297 by iliev, Thu Aug 16 15:55:21 2007 UTC
# Line 526  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 vc = 0;
530            uint sc = 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 537  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                        vc++;
545    
546                        if (itVoice->PlaybackState == Voice::playback_state_disk) {
547                            if ((itVoice->DiskStreamRef).State == Stream::state_active) sc++;
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(vc);
556            pEngineChannel->SetDiskStreamCount(sc);
557      }      }
558    
559      /**      /**
# Line 568  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 1725  namespace LinuxSampler { namespace gig { Line 1744  namespace LinuxSampler { namespace gig {
1744      }      }
1745    
1746      String Engine::Version() {      String Engine::Version() {
1747          String s = "$Revision: 1.77 $";          String s = "$Revision: 1.78 $";
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.1248  
changed lines
  Added in v.1297

  ViewVC Help
Powered by ViewVC