/[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 1764 by persson, Sat Sep 6 14:55:18 2008 UTC revision 1789 by iliev, Sat Nov 1 19:01:27 2008 UTC
# Line 291  namespace LinuxSampler { namespace gig { Line 291  namespace LinuxSampler { namespace gig {
291          // make sure that the engine does not get any sysex messages          // make sure that the engine does not get any sysex messages
292          // while it's reseting          // while it's reseting
293          bool sysexDisabled = MidiInputPort::RemoveSysexListener(this);          bool sysexDisabled = MidiInputPort::RemoveSysexListener(this);
294          ActiveVoiceCount    = 0;          SetVoiceCount(0);
295          ActiveVoiceCountMax = 0;          ActiveVoiceCountMax = 0;
296    
297          // reset voice stealing parameters          // reset voice stealing parameters
# Line 686  namespace LinuxSampler { namespace gig { Line 686  namespace LinuxSampler { namespace gig {
686          pVoiceStealingQueue->clear();          pVoiceStealingQueue->clear();
687    
688          // just some statistics about this engine instance          // just some statistics about this engine instance
689          ActiveVoiceCount = ActiveVoiceCountTemp;          SetVoiceCount(ActiveVoiceCountTemp);
690          if (ActiveVoiceCount > ActiveVoiceCountMax) ActiveVoiceCountMax = ActiveVoiceCount;          if (VoiceCount() > ActiveVoiceCountMax) ActiveVoiceCountMax = VoiceCount();
691    
692          // in case regions were previously suspended and we killed voices          // in case regions were previously suspended and we killed voices
693          // with disk streams due to that, check if those streams have finally          // with disk streams due to that, check if those streams have finally
# Line 786  namespace LinuxSampler { namespace gig { Line 786  namespace LinuxSampler { namespace gig {
786                      voiceCount++;                      voiceCount++;
787    
788                      if (itVoice->PlaybackState == Voice::playback_state_disk) {                      if (itVoice->PlaybackState == Voice::playback_state_disk) {
789                          if ((itVoice->DiskStreamRef).State == Stream::state_active) streamCount++;                          if ((itVoice->DiskStreamRef).State != Stream::state_unused) streamCount++;
790                      }                      }
791                  }  else { // voice reached end, is now inactive                  }  else { // voice reached end, is now inactive
792                      FreeVoice(pEngineChannel, itVoice); // remove voice from the list of active voices                      FreeVoice(pEngineChannel, itVoice); // remove voice from the list of active voices
# Line 827  namespace LinuxSampler { namespace gig { Line 827  namespace LinuxSampler { namespace gig {
827                      pEngineChannel->SetVoiceCount(pEngineChannel->GetVoiceCount() + 1);                      pEngineChannel->SetVoiceCount(pEngineChannel->GetVoiceCount() + 1);
828    
829                      if (itNewVoice->PlaybackState == Voice::playback_state_disk) {                      if (itNewVoice->PlaybackState == Voice::playback_state_disk) {
830                          if (itNewVoice->DiskStreamRef.State == Stream::state_active) {                          if (itNewVoice->DiskStreamRef.State != Stream::state_unused) {
831                              pEngineChannel->SetDiskStreamCount(pEngineChannel->GetDiskStreamCount() + 1);                              pEngineChannel->SetDiskStreamCount(pEngineChannel->GetDiskStreamCount() + 1);
832                          }                          }
833                      }                      }
# Line 2100  namespace LinuxSampler { namespace gig { Line 2100  namespace LinuxSampler { namespace gig {
2100      }      }
2101    
2102      uint Engine::VoiceCount() {      uint Engine::VoiceCount() {
2103          return ActiveVoiceCount;          return atomic_read(&ActiveVoiceCount);
2104        }
2105    
2106        void Engine::SetVoiceCount(uint Count) {
2107            atomic_set(&ActiveVoiceCount, Count);
2108      }      }
2109    
2110      uint Engine::VoiceCountMax() {      uint Engine::VoiceCountMax() {
# Line 2112  namespace LinuxSampler { namespace gig { Line 2116  namespace LinuxSampler { namespace gig {
2116      }      }
2117    
2118      uint Engine::DiskStreamCount() {      uint Engine::DiskStreamCount() {
2119          return (pDiskThread) ? pDiskThread->ActiveStreamCount : 0;          return (pDiskThread) ? pDiskThread->GetActiveStreamCount() : 0;
2120      }      }
2121    
2122      uint Engine::DiskStreamCountMax() {      uint Engine::DiskStreamCountMax() {
# Line 2136  namespace LinuxSampler { namespace gig { Line 2140  namespace LinuxSampler { namespace gig {
2140      }      }
2141    
2142      String Engine::Version() {      String Engine::Version() {
2143          String s = "$Revision: 1.97 $";          String s = "$Revision: 1.98 $";
2144          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
2145      }      }
2146    

Legend:
Removed from v.1764  
changed lines
  Added in v.1789

  ViewVC Help
Powered by ViewVC