/[svn]/linuxsampler/trunk/src/linuxsampler.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/linuxsampler.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1895 by persson, Sun May 3 12:15:40 2009 UTC revision 2390 by persson, Sat Jan 5 12:31:05 2013 UTC
# Line 3  Line 3 
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-2013 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  *
# Line 23  Line 23 
23    
24  #include <getopt.h>  #include <getopt.h>
25  #include <signal.h>  #include <signal.h>
26    #include <sys/stat.h>
27    
28  #if defined(WIN32)  #if defined(WIN32)
29  // require at least Windows 2000 for the GlobalMemoryStatusEx() call  // require at least Windows 2000 for the GlobalMemoryStatusEx() call
# Line 40  Line 41 
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"
# Line 71  bool tune = true; Line 73  bool tune = true;
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);
# Line 116  int main(int argc, char **argv) { Line 119  int main(int argc, char **argv) {
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-2013 Christian Schoenebeck\n"));
123    
124      #if defined(WIN32)      #if defined(WIN32)
125      #if 0      #if 0
# Line 187  int main(int argc, char **argv) { Line 190  int main(int argc, char **argv) {
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;
# Line 207  int main(int argc, char **argv) { Line 212  int main(int argc, char **argv) {
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) {
# Line 311  void parse_options(int argc, char **argv Line 323  void parse_options(int argc, char **argv
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    
# Line 336  void parse_options(int argc, char **argv Line 349  void parse_options(int argc, char **argv
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
# Line 344  void parse_options(int argc, char **argv Line 358  void parse_options(int argc, char **argv
358                      break;                      break;
359                  case 2: // --profile                  case 2: // --profile
360                      profile = true;                      profile = true;
361                        //FIXME: profiling code is currently broken!
362                        std::cerr << "Option '--profile' is currently not supported, since the profiling code is currently broken!"  << std::endl;
363                        exit(EXIT_FAILURE);
364                      break;                      break;
365                  case 3: // --no-tune                  case 3: // --no-tune
366                      tune = false;                      tune = false;
# Line 425  void parse_options(int argc, char **argv Line 442  void parse_options(int argc, char **argv
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      }      }

Legend:
Removed from v.1895  
changed lines
  Added in v.2390

  ViewVC Help
Powered by ViewVC