73 |
static bool bShowStackTrace = false; |
static bool bShowStackTrace = false; |
74 |
unsigned long int lscp_addr; |
unsigned long int lscp_addr; |
75 |
unsigned short int lscp_port; |
unsigned short int lscp_port; |
76 |
|
String ExecAfterInit; |
77 |
|
|
78 |
void parse_options(int argc, char **argv); |
void parse_options(int argc, char **argv); |
79 |
void signal_handler(int signal); |
void signal_handler(int signal); |
212 |
} |
} |
213 |
|
|
214 |
printf("LinuxSampler initialization completed. :-)\n\n"); |
printf("LinuxSampler initialization completed. :-)\n\n"); |
215 |
|
|
216 |
|
if (ExecAfterInit != "") { |
217 |
|
printf("Executing command: %s\n\n", ExecAfterInit.c_str()); |
218 |
|
if (system(ExecAfterInit.c_str()) == -1) { |
219 |
|
std::cerr << "Failed to execute the command" << std::endl; |
220 |
|
} |
221 |
|
} |
222 |
|
|
223 |
while (atomic_read(&running)) { |
while (atomic_read(&running)) { |
224 |
if (bPrintStatistics) { |
if (bPrintStatistics) { |
323 |
{"lscp-addr",1,0,0}, |
{"lscp-addr",1,0,0}, |
324 |
{"lscp-port",1,0,0}, |
{"lscp-port",1,0,0}, |
325 |
{"stacktrace",0,0,0}, |
{"stacktrace",0,0,0}, |
326 |
|
{"exec-after-init",1,0,0}, |
327 |
{0,0,0,0} |
{0,0,0,0} |
328 |
}; |
}; |
329 |
|
|
349 |
printf("--instruments-db-location specifies the instruments DB file\n"); |
printf("--instruments-db-location specifies the instruments DB file\n"); |
350 |
printf("--stacktrace automatically shows stacktrace if crashes\n"); |
printf("--stacktrace automatically shows stacktrace if crashes\n"); |
351 |
printf(" (broken on most systems at the moment)\n"); |
printf(" (broken on most systems at the moment)\n"); |
352 |
|
printf("--exec-after-init executes a command after initialization\n"); |
353 |
exit(EXIT_SUCCESS); |
exit(EXIT_SUCCESS); |
354 |
break; |
break; |
355 |
case 1: // --version |
case 1: // --version |
442 |
case 9: // --stacktrace |
case 9: // --stacktrace |
443 |
bShowStackTrace = true; |
bShowStackTrace = true; |
444 |
break; |
break; |
445 |
|
case 10: // --exec-after-init |
446 |
|
ExecAfterInit = optarg; |
447 |
|
break; |
448 |
} |
} |
449 |
} |
} |
450 |
} |
} |