156 |
|
|
157 |
dmsg(1,("LinuxSampler %s\n", VERSION)); |
dmsg(1,("LinuxSampler %s\n", VERSION)); |
158 |
dmsg(1,("Copyright (C) 2003,2004 by Benno Senoner and Christian Schoenebeck\n")); |
dmsg(1,("Copyright (C) 2003,2004 by Benno Senoner and Christian Schoenebeck\n")); |
159 |
dmsg(1,("Copyright (C) 2005-2007 Christian Schoenebeck\n")); |
dmsg(1,("Copyright (C) 2005-2008 Christian Schoenebeck\n")); |
160 |
|
|
161 |
if (tune) { |
if (tune) { |
162 |
// detect and print system / CPU specific features |
// detect and print system / CPU specific features |
196 |
|
|
197 |
printf("LinuxSampler initialization completed. :-)\n\n"); |
printf("LinuxSampler initialization completed. :-)\n\n"); |
198 |
|
|
|
std::list<LSCPEvent::event_t> rtEvents; |
|
|
rtEvents.push_back(LSCPEvent::event_voice_count); |
|
|
rtEvents.push_back(LSCPEvent::event_stream_count); |
|
|
rtEvents.push_back(LSCPEvent::event_buffer_fill); |
|
|
rtEvents.push_back(LSCPEvent::event_total_voice_count); |
|
|
|
|
199 |
while (atomic_read(&running)) { |
while (atomic_read(&running)) { |
200 |
if (bPrintStatistics) { |
if (bPrintStatistics) { |
201 |
const std::set<Engine*>& engines = EngineFactory::EngineInstances(); |
const std::set<Engine*>& engines = EngineFactory::EngineInstances(); |
222 |
} |
} |
223 |
} |
} |
224 |
|
|
225 |
if (LSCPServer::EventSubscribers(rtEvents)) |
pSampler->fireStatistics(); |
|
{ |
|
|
LSCPServer::LockRTNotify(); |
|
|
std::map<uint,SamplerChannel*> channels = pSampler->GetSamplerChannels(); |
|
|
std::map<uint,SamplerChannel*>::iterator iter = channels.begin(); |
|
|
for (; iter != channels.end(); iter++) { |
|
|
SamplerChannel* pSamplerChannel = iter->second; |
|
|
EngineChannel* pEngineChannel = pSamplerChannel->GetEngineChannel(); |
|
|
if (!pEngineChannel) continue; |
|
|
Engine* pEngine = pEngineChannel->GetEngine(); |
|
|
if (!pEngine) continue; |
|
|
pSampler->fireVoiceCountChanged(iter->first, pEngineChannel->GetVoiceCount()); |
|
|
pSampler->fireStreamCountChanged(iter->first, pEngineChannel->GetDiskStreamCount()); |
|
|
pSampler->fireBufferFillChanged(iter->first, pEngine->DiskStreamBufferFillPercentage()); |
|
|
pSampler->fireTotalStreamCountChanged(pSampler->GetDiskStreamCount()); |
|
|
pSampler->fireTotalVoiceCountChanged(pSampler->GetVoiceCount()); |
|
|
} |
|
|
LSCPServer::UnlockRTNotify(); |
|
|
} |
|
226 |
} |
} |
227 |
if (pLSCPServer) pLSCPServer->StopThread(); |
if (pLSCPServer) pLSCPServer->StopThread(); |
228 |
// the delete order here is important: the Sampler |
// the delete order here is important: the Sampler |