25 |
#include <signal.h> |
#include <signal.h> |
26 |
|
|
27 |
#include "Sampler.h" |
#include "Sampler.h" |
28 |
|
#include "engines/EngineFactory.h" |
29 |
#include "drivers/midi/MidiInputDeviceFactory.h" |
#include "drivers/midi/MidiInputDeviceFactory.h" |
30 |
#include "drivers/audio/AudioOutputDeviceFactory.h" |
#include "drivers/audio/AudioOutputDeviceFactory.h" |
31 |
#include "engines/gig/Profiler.h" |
#include "engines/gig/Profiler.h" |
38 |
Sampler* pSampler = NULL; |
Sampler* pSampler = NULL; |
39 |
LSCPServer* pLSCPServer = NULL; |
LSCPServer* pLSCPServer = NULL; |
40 |
pthread_t main_thread; |
pthread_t main_thread; |
41 |
|
bool bPrintStatistics = false; |
42 |
bool profile = false; |
bool profile = false; |
43 |
bool tune = true; |
bool tune = true; |
44 |
|
|
119 |
rtEvents.push_back(LSCPEvent::event_stream_count); |
rtEvents.push_back(LSCPEvent::event_stream_count); |
120 |
rtEvents.push_back(LSCPEvent::event_buffer_fill); |
rtEvents.push_back(LSCPEvent::event_buffer_fill); |
121 |
|
|
122 |
while(true) |
while (true) { |
123 |
{ |
if (bPrintStatistics) { |
124 |
/*printf("Voices: %3.3d (Max: %3.3d) Streams: %3.3d (Max: %3.3d, Unused: %3.3d)\r", |
std::set<Engine*> engines = EngineFactory::EngineInstances(); |
125 |
pEngine->ActiveVoiceCount, pEngine->ActiveVoiceCountMax, |
std::set<Engine*>::iterator itEngine = engines.begin(); |
126 |
pEngine->pDiskThread->ActiveStreamCount, pEngine->pDiskThread->ActiveStreamCountMax, Stream::GetUnusedStreams()); |
for (int i = 0; itEngine != engines.end(); itEngine++, i++) { |
127 |
fflush(stdout);*/ |
Engine* pEngine = *itEngine; |
128 |
|
printf("Engine %d) Voices: %3.3d (Max: %3.3d) Streams: %3.3d (Max: %3.3d)\n", i, |
129 |
|
pEngine->VoiceCount(), pEngine->VoiceCountMax(), |
130 |
|
pEngine->DiskStreamCount(), pEngine->DiskStreamCountMax() |
131 |
|
); |
132 |
|
fflush(stdout); |
133 |
|
} |
134 |
|
} |
135 |
|
|
136 |
sleep(1); |
sleep(1); |
137 |
if (profile) |
if (profile) |
138 |
{ |
{ |
226 |
{"version",0,0,0}, |
{"version",0,0,0}, |
227 |
{"profile",0,0,0}, |
{"profile",0,0,0}, |
228 |
{"no-tune",0,0,0}, |
{"no-tune",0,0,0}, |
229 |
|
{"statistics",0,0,0}, |
230 |
{0,0,0,0} |
{0,0,0,0} |
231 |
}; |
}; |
232 |
|
|
245 |
printf("--version prints version information\n"); |
printf("--version prints version information\n"); |
246 |
printf("--profile profile synthesis algorithms\n"); |
printf("--profile profile synthesis algorithms\n"); |
247 |
printf("--no-tune disable assembly optimization\n"); |
printf("--no-tune disable assembly optimization\n"); |
248 |
|
printf("--statistics prints periodically statistics\n"); |
249 |
exit(EXIT_SUCCESS); |
exit(EXIT_SUCCESS); |
250 |
break; |
break; |
251 |
case 1: // --version |
case 1: // --version |
258 |
case 3: // --no-tune |
case 3: // --no-tune |
259 |
tune = false; |
tune = false; |
260 |
break; |
break; |
261 |
|
case 4: // --statistics |
262 |
|
bPrintStatistics = true; |
263 |
|
break; |
264 |
} |
} |
265 |
} |
} |
266 |
} |
} |