/[svn]/linuxsampler/trunk/src/Sampler.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/Sampler.cpp

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

revision 1761 by iliev, Fri Aug 29 15:42:06 2008 UTC revision 1765 by persson, Sat Sep 6 16:44:42 2008 UTC
# Line 33  Line 33 
33  #include "drivers/midi/MidiInputDeviceFactory.h"  #include "drivers/midi/MidiInputDeviceFactory.h"
34  #include "drivers/midi/MidiInstrumentMapper.h"  #include "drivers/midi/MidiInstrumentMapper.h"
35  #include "common/Features.h"  #include "common/Features.h"
36    #include "network/lscpserver.h"
37    
38  namespace LinuxSampler {  namespace LinuxSampler {
39    
# Line 689  namespace LinuxSampler { Line 690  namespace LinuxSampler {
690          return Features::enableDenormalsAreZeroMode();          return Features::enableDenormalsAreZeroMode();
691      }      }
692    
693        void Sampler::fireStatistics() {
694            static const LSCPEvent::event_t eventsArr[] = {
695                LSCPEvent::event_voice_count, LSCPEvent::event_stream_count,
696                LSCPEvent::event_buffer_fill, LSCPEvent::event_total_voice_count
697            };
698            static const std::list<LSCPEvent::event_t> events(eventsArr, eventsArr + 4);
699    
700            if (LSCPServer::EventSubscribers(events))
701            {
702                LSCPServer::LockRTNotify();
703                std::map<uint,SamplerChannel*> channels = GetSamplerChannels();
704                std::map<uint,SamplerChannel*>::iterator iter = channels.begin();
705                for (; iter != channels.end(); iter++) {
706                    SamplerChannel* pSamplerChannel = iter->second;
707                    EngineChannel* pEngineChannel = pSamplerChannel->GetEngineChannel();
708                    if (!pEngineChannel) continue;
709                    Engine* pEngine = pEngineChannel->GetEngine();
710                    if (!pEngine) continue;
711                    fireVoiceCountChanged(iter->first, pEngineChannel->GetVoiceCount());
712                    fireStreamCountChanged(iter->first, pEngineChannel->GetDiskStreamCount());
713                    fireBufferFillChanged(iter->first, pEngine->DiskStreamBufferFillPercentage());
714                    fireTotalStreamCountChanged(GetDiskStreamCount());
715                    fireTotalVoiceCountChanged(GetVoiceCount());
716                }
717                LSCPServer::UnlockRTNotify();
718            }
719        }
720    
721  } // namespace LinuxSampler  } // namespace LinuxSampler

Legend:
Removed from v.1761  
changed lines
  Added in v.1765

  ViewVC Help
Powered by ViewVC