3 |
* LinuxSampler - modular, streaming capable sampler * |
* LinuxSampler - modular, streaming capable sampler * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003-2004 by Benno Senoner and Christian Schoenebeck * |
* Copyright (C) 2003-2004 by Benno Senoner and Christian Schoenebeck * |
6 |
* Copyright (C) 2005-2009 Christian Schoenebeck * |
* Copyright (C) 2005-2011 Christian Schoenebeck * |
7 |
* * |
* * |
8 |
* This program is free software; you can redistribute it and/or modify * |
* This program is free software; you can redistribute it and/or modify * |
9 |
* it under the terms of the GNU General Public License as published by * |
* it under the terms of the GNU General Public License as published by * |
41 |
#include "plugins/InstrumentEditorFactory.h" |
#include "plugins/InstrumentEditorFactory.h" |
42 |
#include "drivers/midi/MidiInputDeviceFactory.h" |
#include "drivers/midi/MidiInputDeviceFactory.h" |
43 |
#include "drivers/audio/AudioOutputDeviceFactory.h" |
#include "drivers/audio/AudioOutputDeviceFactory.h" |
44 |
|
#include "effects/EffectFactory.h" |
45 |
#include "engines/gig/Profiler.h" |
#include "engines/gig/Profiler.h" |
46 |
#include "network/lscpserver.h" |
#include "network/lscpserver.h" |
47 |
#include "common/stacktrace.h" |
#include "common/stacktrace.h" |
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); |
119 |
|
|
120 |
dmsg(1,("LinuxSampler %s\n", VERSION)); |
dmsg(1,("LinuxSampler %s\n", VERSION)); |
121 |
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")); |
122 |
dmsg(1,("Copyright (C) 2005-2009 Christian Schoenebeck\n")); |
dmsg(1,("Copyright (C) 2005-2011 Christian Schoenebeck\n")); |
123 |
|
|
124 |
#if defined(WIN32) |
#if defined(WIN32) |
125 |
#if 0 |
#if 0 |
190 |
dmsg(1,("Registered MIDI input drivers: %s\n", MidiInputDeviceFactory::AvailableDriversAsString().c_str())); |
dmsg(1,("Registered MIDI input drivers: %s\n", MidiInputDeviceFactory::AvailableDriversAsString().c_str())); |
191 |
dmsg(1,("Registered audio output drivers: %s\n", AudioOutputDeviceFactory::AvailableDriversAsString().c_str())); |
dmsg(1,("Registered audio output drivers: %s\n", AudioOutputDeviceFactory::AvailableDriversAsString().c_str())); |
192 |
dmsg(1,("Registered instrument editors: %s\n", InstrumentEditorFactory::AvailableEditorsAsString().c_str())); |
dmsg(1,("Registered instrument editors: %s\n", InstrumentEditorFactory::AvailableEditorsAsString().c_str())); |
193 |
|
dmsg(1,("Registered internal effect systems: %s\n", EffectFactory::AvailableEffectSystemsAsString().c_str())); |
194 |
|
dmsg(1,("Registered internal effects: %d\n", EffectFactory::AvailableEffectsCount())); |
195 |
|
|
196 |
// start LSCP network server |
// start LSCP network server |
197 |
struct in_addr addr; |
struct in_addr addr; |
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 |
} |
} |