110 |
|
|
111 |
printf("LinuxSampler initialization completed.\n"); |
printf("LinuxSampler initialization completed.\n"); |
112 |
|
|
113 |
while(true) { |
std::list<LSCPEvent::event_t> rtEvents; |
114 |
|
rtEvents.push_back(LSCPEvent::event_voice_count); |
115 |
|
rtEvents.push_back(LSCPEvent::event_stream_count); |
116 |
|
rtEvents.push_back(LSCPEvent::event_buffer_fill); |
117 |
|
|
118 |
|
while(true) |
119 |
|
{ |
120 |
/*printf("Voices: %3.3d (Max: %3.3d) Streams: %3.3d (Max: %3.3d, Unused: %3.3d)\r", |
/*printf("Voices: %3.3d (Max: %3.3d) Streams: %3.3d (Max: %3.3d, Unused: %3.3d)\r", |
121 |
pEngine->ActiveVoiceCount, pEngine->ActiveVoiceCountMax, |
pEngine->ActiveVoiceCount, pEngine->ActiveVoiceCountMax, |
122 |
pEngine->pDiskThread->ActiveStreamCount, pEngine->pDiskThread->ActiveStreamCountMax, Stream::GetUnusedStreams()); |
pEngine->pDiskThread->ActiveStreamCount, pEngine->pDiskThread->ActiveStreamCountMax, Stream::GetUnusedStreams()); |
132 |
fflush(stdout); |
fflush(stdout); |
133 |
} |
} |
134 |
} |
} |
135 |
|
|
136 |
|
if (LSCPServer::EventSubscribers(rtEvents)) |
137 |
|
{ |
138 |
|
LSCPServer::LockRTNotify(); |
139 |
|
std::map<uint,SamplerChannel*> channels = pSampler->GetSamplerChannels(); |
140 |
|
std::map<uint,SamplerChannel*>::iterator iter = channels.begin(); |
141 |
|
for (; iter != channels.end(); iter++) { |
142 |
|
SamplerChannel* pSamplerChannel = iter->second; |
143 |
|
Engine* pEngine = pSamplerChannel->GetEngine(); |
144 |
|
if (!pEngine) continue; |
145 |
|
LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_voice_count, iter->first, pEngine->VoiceCount())); |
146 |
|
LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_stream_count, iter->first, pEngine->DiskStreamCount())); |
147 |
|
LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_buffer_fill, iter->first, pEngine->DiskStreamBufferFillPercentage())); |
148 |
|
} |
149 |
|
LSCPServer::UnlockRTNotify(); |
150 |
|
} |
151 |
|
|
152 |
} |
} |
153 |
|
|
154 |
return EXIT_SUCCESS; |
return EXIT_SUCCESS; |
216 |
}; |
}; |
217 |
|
|
218 |
while (true) { |
while (true) { |
219 |
res = getopt_long_only(argc, argv, "", long_options, &option_index); |
/* |
220 |
|
Stephane Letz : letz@grame.fr |
221 |
|
getopt_long_only does not exist on OSX : replaced by getopt_long for now. |
222 |
|
*/ |
223 |
|
res = getopt_long(argc, argv, "", long_options, &option_index); |
224 |
if(res == -1) break; |
if(res == -1) break; |
225 |
if (res == 0) { |
if (res == 0) { |
226 |
switch(option_index) { |
switch(option_index) { |