/[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 207 by schoenebeck, Thu Jul 15 21:51:15 2004 UTC revision 1895 by persson, Sun May 3 12:15:40 2009 UTC
# Line 2  Line 2 
2   *                                                                         *   *                                                                         *
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                         *
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 24 
24  #include <getopt.h>  #include <getopt.h>
25  #include <signal.h>  #include <signal.h>
26    
27    #if defined(WIN32)
28    // require at least Windows 2000 for the GlobalMemoryStatusEx() call
29    #if _WIN32_WINNT < 0x0500
30    #ifdef _WIN32_WINNT
31    #undef _WIN32_WINNT
32    #endif
33    #define _WIN32_WINNT 0x0500
34    #endif
35    #endif
36    
37  #include "Sampler.h"  #include "Sampler.h"
38    #include "common/global_private.h"
39    #include "engines/EngineFactory.h"
40    #include "plugins/InstrumentEditorFactory.h"
41  #include "drivers/midi/MidiInputDeviceFactory.h"  #include "drivers/midi/MidiInputDeviceFactory.h"
42  #include "drivers/audio/AudioOutputDeviceFactory.h"  #include "drivers/audio/AudioOutputDeviceFactory.h"
43    #include "engines/gig/Profiler.h"
44  #include "network/lscpserver.h"  #include "network/lscpserver.h"
45    #include "common/stacktrace.h"
46  #if 0  #include "common/Features.h"
47  #define AUDIO_CHANNELS          2     // stereo  #include "common/atomic.h"
 #define AUDIO_FRAGMENTS         3     // 3 fragments, if it does not work set it to 2  
 #define AUDIO_FRAGMENTSIZE      512   // each fragment has 512 frames  
 #define AUDIO_SAMPLERATE        44100 // Hz  
 #endif  
48    
49  using namespace LinuxSampler;  using namespace LinuxSampler;
50    
51  /*enum patch_format_t {  Sampler*    pSampler    = NULL;
52      patch_format_unknown,  LSCPServer* pLSCPServer = NULL;
53      patch_format_gig,  #if defined(WIN32)
54      patch_format_dls  // inet_aton seems missing under WIN32
55  } patch_format = patch_format_unknown;*/  #ifndef INADDR_NONE
56    #define INADDR_NONE 0xffffffff
57  Sampler*     pSampler         = NULL;  #endif
58  LSCPServer*  pLSCPServer      = NULL;  
59  pthread_t    signalhandlerthread;  int inet_aton(const char *cp, struct in_addr *addr)
60  /*AudioThread* pEngine          = NULL;  {
61  uint         instrument_index = 0;      addr->s_addr = inet_addr(cp);
62  double       volume           = 0.25;      return (addr->s_addr == INADDR_NONE) ? 0 : 1;
63  int          num_fragments    = AUDIO_FRAGMENTS;  }
 int          fragmentsize     = AUDIO_FRAGMENTSIZE;  
 uint         samplerate       = AUDIO_SAMPLERATE;  
 String       input_client;  
 String       alsaout          = "0,0"; // default card  
 String       jack_playback[2] = { "", "" };  
 bool         use_jack         = true;  
 bool         run_server       = false;*/  
64    
65    #else
66    pid_t       main_pid;
67    #endif
68    bool bPrintStatistics = false;
69    bool profile = false;
70    bool tune = true;
71    static bool bShowStackTrace = false;
72    unsigned long int lscp_addr;
73    unsigned short int lscp_port;
74    
75  void parse_options(int argc, char **argv);  void parse_options(int argc, char **argv);
76  void signal_handler(int signal);  void signal_handler(int signal);
77    void kill_app();
78    static atomic_t running = ATOMIC_INIT(1);
79    
80  int main(int argc, char **argv) {  int main(int argc, char **argv) {
81    
82      // setting signal handler for catching SIGINT (thus e.g. <CTRL><C>)      lscp_addr = htonl(LSCP_ADDR);
83      signalhandlerthread = pthread_self();      lscp_port = htons(LSCP_PORT);
84      signal(SIGINT, signal_handler);  
85        #if !defined(WIN32)
86        main_pid = getpid();
87        #endif
88    
89      // parse and assign command line options      // parse and assign command line options
90      //parse_options(argc, argv);      parse_options(argc, argv);
91    
92        // setting signal handler for catching SIGINT (thus e.g. <CTRL><C>)
93        signal(SIGINT, signal_handler);
94    
95      /*if (patch_format != patch_format_gig) {      // initialize the stack trace mechanism with our binary file
96          printf("Sorry only Gigasampler loading migrated in LinuxSampler so far, use --gig to load a .gig file!\n");      // (if requested by command line option)
97          printf("Use 'linuxsampler --help' to see all available options.\n");      if (bShowStackTrace) {
98          return EXIT_FAILURE;          #if defined(WIN32)
99      }*/          // FIXME: sigaction() not supported on WIN32, we ignore it for now
100            #else
101            StackTraceInit(argv[0], -1);
102            // register signal handler for all unusual signals
103            // (we will print the stack trace and exit)
104            struct sigaction sact;
105            sigemptyset(&sact.sa_mask);
106            sact.sa_flags   = 0;
107            sact.sa_handler = signal_handler;
108            sigaction(SIGSEGV, &sact, NULL);
109            sigaction(SIGBUS,  &sact, NULL);
110            sigaction(SIGILL,  &sact, NULL);
111            sigaction(SIGFPE,  &sact, NULL);
112            sigaction(SIGUSR1, &sact, NULL);
113            sigaction(SIGUSR2, &sact, NULL);
114            #endif
115        }
116    
117      dmsg(1,("LinuxSampler %s\n", VERSION));      dmsg(1,("LinuxSampler %s\n", VERSION));
118      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"));
119        dmsg(1,("Copyright (C) 2005-2009 Christian Schoenebeck\n"));
120    
121        #if defined(WIN32)
122        #if 0
123        // some WIN32 memory info code which tries to determine the maximum lockable amount of memory (for debug purposes)
124        SYSTEM_INFO siSysInfo;
125        long physical_memory;
126        GetSystemInfo(&siSysInfo);
127        dmsg(2,("page size=%d\n", siSysInfo.dwPageSize));
128    
129        MEMORYSTATUSEX statex;
130            statex.dwLength = sizeof (statex);
131        GlobalMemoryStatusEx (&statex);
132        dmsg(2, ("There are %*I64d total Kbytes of physical memory.\n",
133              8, statex.ullTotalPhys));
134        dmsg(2, ("There are %*I64d free Kbytes of physical memory.\n",
135              8, statex.ullAvailPhys));
136        physical_memory = statex.ullTotalPhys;
137    
138        HANDLE hProcess = GetCurrentProcess();
139    
140        unsigned long MinimumWorkingSetSize, MaximumWorkingSetSize;
141        unsigned long DefaultMinimumWorkingSetSize, DefaultMaximumWorkingSetSize;
142        unsigned long RequestedMinimumWorkingSetSize, RequestedMaximumWorkingSetSize;
143        int res;
144    
145        res = GetProcessWorkingSetSize(hProcess, &DefaultMinimumWorkingSetSize, &DefaultMaximumWorkingSetSize);
146    
147        RequestedMaximumWorkingSetSize = physical_memory - 2*1024*1024;
148        RequestedMinimumWorkingSetSize = RequestedMaximumWorkingSetSize;
149    
150        for(;;) {
151            dmsg(2,("TRYING VALUES  RequestedMinimumWorkingSetSize=%d, RequestedMaximumWorkingSetSize=%d\n", RequestedMinimumWorkingSetSize, RequestedMaximumWorkingSetSize));
152            res = SetProcessWorkingSetSize(hProcess, RequestedMinimumWorkingSetSize, RequestedMaximumWorkingSetSize);
153            dmsg(2,("AFTER SET: res = %d  RequestedMinimumWorkingSetSize=%d, RequestedMaximumWorkingSetSize=%d\n", res,RequestedMinimumWorkingSetSize, RequestedMaximumWorkingSetSize));
154    
155            res = GetProcessWorkingSetSize(hProcess, &MinimumWorkingSetSize, &MaximumWorkingSetSize);
156            dmsg(2,("AFTER GET: res = %d  MinimumWorkingSetSize=%d, MaximumWorkingSetSize=%d\n", res,MinimumWorkingSetSize, MaximumWorkingSetSize));
157    
158            if( RequestedMinimumWorkingSetSize == MinimumWorkingSetSize ) {
159                dmsg(2,("RequestedMinimumWorkingSetSize == MinimumWorkingSetSize. OK !\n"));
160                break;
161            }
162    
163            RequestedMinimumWorkingSetSize -=  10*1024*1024;
164            if(RequestedMinimumWorkingSetSize < DefaultMinimumWorkingSetSize) break;
165        }
166    
167        dmsg(2,("AFTER GetProcessWorkingSetSize: res = %d  MinimumWorkingSetSize=%d, MaximumWorkingSetSize=%d\n", res,MinimumWorkingSetSize, MaximumWorkingSetSize));
168        #endif
169        #endif // WIN32
170    
171        if (tune) {
172            // detect and print system / CPU specific features
173            Features::detect();
174            dmsg(1,("Detected features: %s\n", Features::featuresAsString().c_str()));
175            // prevent slow denormal FPU modes
176            Features::enableDenormalsAreZeroMode();
177        }
178    
179        dmsg(1,("Automatic Stacktrace: %s\n", (bShowStackTrace) ? "On" : "Off"));
180    
181      // create LinuxSampler instance      // create LinuxSampler instance
182      dmsg(1,("Creating Sampler..."));      dmsg(1,("Creating Sampler..."));
183      pSampler = new Sampler;      pSampler = new Sampler;
184      dmsg(1,("OK\n"));      dmsg(1,("OK\n"));
185    
186        dmsg(1,("Registered sampler engines: %s\n", EngineFactory::AvailableEngineTypesAsString().c_str()));
187      dmsg(1,("Registered MIDI input drivers: %s\n", MidiInputDeviceFactory::AvailableDriversAsString().c_str()));      dmsg(1,("Registered MIDI input drivers: %s\n", MidiInputDeviceFactory::AvailableDriversAsString().c_str()));
188      dmsg(1,("Registered audio output drivers: %s\n", AudioOutputDeviceFactory::AvailableDriversAsString().c_str()));      dmsg(1,("Registered audio output drivers: %s\n", AudioOutputDeviceFactory::AvailableDriversAsString().c_str()));
189        dmsg(1,("Registered instrument editors: %s\n", InstrumentEditorFactory::AvailableEditorsAsString().c_str()));
     // create an audio output device  
    /* bool no_jack = true;  
 #if HAVE_JACK  
     if (use_jack) {  
         dmsg(1,("Creating audio output device (Jack)..."));  
         try {  
             pSampler->CreateAudioOutputDevice(audio_output_type_jack);  
             no_jack = false;  
         }  
         catch (AudioOutputException aoe) {  
             aoe.PrintMessage();  
             dmsg(1,("Trying to create Alsa output device instead.\n"));  
         }  
     }  
 #endif // HAVE_JACK  
     if (no_jack) {  
         dmsg(1,("Creating audio output device (Alsa)..."));  
         try {  
             pSampler->CreateAudioOutputDevice(audio_output_type_alsa);  
         }  
         catch (AudioOutputException aoe) {  
             aoe.PrintMessage();  
             dmsg(1,("Trying to create Alsa output device instead.\n"));  
             return EXIT_FAILURE;  
         }  
     }  
     dmsg(1,("OK\n"));*/  
190    
191      // start LSCP network server      // start LSCP network server
192      dmsg(1,("Starting LSCP network server..."));      struct in_addr addr;
193      pLSCPServer = new LSCPServer(pSampler);      addr.s_addr = lscp_addr;
194        dmsg(1,("Starting LSCP network server (%s:%d)...", inet_ntoa(addr), ntohs(lscp_port)));
195        pLSCPServer = new LSCPServer(pSampler, lscp_addr, lscp_port);
196      pLSCPServer->StartThread();      pLSCPServer->StartThread();
197        pLSCPServer->WaitUntilInitialized();
198      dmsg(1,("OK\n"));      dmsg(1,("OK\n"));
199    
200      printf("LinuxSampler initialization completed.\n");      if (profile)
201        {
202      while(true)  {          dmsg(1,("Calibrating profiler..."));
203        /*printf("Voices: %3.3d (Max: %3.3d) Streams: %3.3d (Max: %3.3d, Unused: %3.3d)\r",          LinuxSampler::gig::Profiler::Calibrate();
204              pEngine->ActiveVoiceCount, pEngine->ActiveVoiceCountMax,          LinuxSampler::gig::Profiler::Reset();
205              pEngine->pDiskThread->ActiveStreamCount, pEngine->pDiskThread->ActiveStreamCountMax, Stream::GetUnusedStreams());          LinuxSampler::gig::Profiler::enable();
206        fflush(stdout);*/          dmsg(1,("OK\n"));
       usleep(500000);  
207      }      }
208    
209        printf("LinuxSampler initialization completed. :-)\n\n");
210    
211        while (atomic_read(&running)) {
212            if (bPrintStatistics) {
213                const std::set<Engine*>& engines = EngineFactory::EngineInstances();
214                std::set<Engine*>::iterator itEngine = engines.begin();
215                for (int i = 0; itEngine != engines.end(); itEngine++, i++) {
216                    Engine* pEngine = *itEngine;
217                    printf("Engine %d) Voices: %3.3d (Max: %3.3d) Streams: %3.3d (Max: %3.3d)\n", i,
218                        pEngine->VoiceCount(), pEngine->VoiceCountMax(),
219                        pEngine->DiskStreamCount(), pEngine->DiskStreamCountMax()
220                    );
221                    fflush(stdout);
222                }
223            }
224    
225            sleep(1);
226            if (profile)
227            {
228                unsigned int samplingFreq = 48000; //FIXME: hardcoded for now
229                unsigned int bv = LinuxSampler::gig::Profiler::GetBogoVoices(samplingFreq);
230                if (bv != 0)
231                {
232                    printf("       BogoVoices: %i         \r", bv);
233                    fflush(stdout);
234                }
235            }
236    
237            pSampler->fireStatistics();
238        }
239        if (pLSCPServer) pLSCPServer->StopThread();
240        // the delete order here is important: the Sampler
241        // destructor sends notifications to the lscpserver
242        if (pSampler) delete pSampler;
243        if (pLSCPServer) delete pLSCPServer;
244        printf("LinuxSampler stopped due to SIGINT.\n");
245      return EXIT_SUCCESS;      return EXIT_SUCCESS;
246  }  }
247    
248  void signal_handler(int signal) {  void signal_handler(int iSignal) {
249      if (pthread_equal(pthread_self(), signalhandlerthread) && signal == SIGINT) {      switch (iSignal) {
250          if (pLSCPServer) {          case SIGINT:
251              pLSCPServer->StopThread();              atomic_set(&running, 0);
252              delete pLSCPServer;              return;
253            #if defined(WIN32)
254            // FIXME: under WIN32 we ignore the signals below due to the missing sigaction call
255            #else
256            case SIGSEGV:
257                std::cerr << ">>> FATAL ERROR: Segmentation fault (SIGSEGV) occured! <<<\n" << std::flush;
258                break;
259            case SIGBUS:
260                std::cerr << ">>> FATAL ERROR: Access to undefined portion of a memory object (SIGBUS) occured! <<<\n" << std::flush;
261                break;
262            case SIGILL:
263                std::cerr << ">>> FATAL ERROR: Illegal instruction (SIGILL) occured! <<<\n" << std::flush;
264                break;
265            case SIGFPE:
266                std::cerr << ">>> FATAL ERROR: Erroneous arithmetic operation (SIGFPE) occured! <<<\n" << std::flush;
267                break;
268            case SIGUSR1:
269                std::cerr << ">>> User defined signal 1 (SIGUSR1) received <<<\n" << std::flush;
270                break;
271            case SIGUSR2:
272                std::cerr << ">>> User defined signal 2 (SIGUSR2) received <<<\n" << std::flush;
273                break;
274            #endif
275            default: { // this should never happen, as we register for the signals we want
276                std::cerr << ">>> FATAL ERROR: Unknown signal received! <<<\n" << std::flush;
277                break;
278          }          }
         if (pSampler) delete pSampler;  
         printf("LinuxSampler stopped due to SIGINT\n");  
         exit(EXIT_SUCCESS);  
279      }      }
280        signal(iSignal, SIG_DFL); // Reinstall default handler to prevent race conditions
281        if (bShowStackTrace) {
282            std::cerr << "Showing stack trace...\n" << std::flush;
283            StackTrace();
284            sleep(2);
285        }
286        std::cerr << "Killing LinuxSampler...\n" << std::flush;
287        kill_app(); // Use abort() if we want to generate a core dump.
288    }
289    
290    void kill_app() {
291        #if defined(WIN32)
292        // FIXME: do we need to do anything at this point under WIN32 ?  is exit(0) ok ?
293        exit(0);
294        #else
295        kill(main_pid, SIGKILL);
296        #endif
297  }  }
298    
299  /*void parse_options(int argc, char **argv) {  void parse_options(int argc, char **argv) {
300      int res;      int res;
301      int option_index = 0;      int option_index = 0;
302      static struct option long_options[] =      static struct option long_options[] =
303          {          {
             {"numfragments",1,0,0},  
             {"fragmentsize",1,0,0},  
             {"volume",1,0,0},  
             {"dls",0,0,0},  
             {"gig",0,0,0},  
             {"instrument",1,0,0},  
             {"inputclient",1,0,0},  
             {"alsaout",1,0,0},  
             {"jackout",1,0,0},  
             {"samplerate",1,0,0},  
             {"server",0,0,0},  
304              {"help",0,0,0},              {"help",0,0,0},
305                {"version",0,0,0},
306                {"profile",0,0,0},
307                {"no-tune",0,0,0},
308                {"statistics",0,0,0},
309                {"instruments-db-location",1,0,0},
310                {"create-instruments-db",1,0,0},
311                {"lscp-addr",1,0,0},
312                {"lscp-port",1,0,0},
313                {"stacktrace",0,0,0},
314              {0,0,0,0}              {0,0,0,0}
315          };          };
316    
317      while (true) {      while (true) {
318          res = getopt_long_only(argc, argv, "", long_options, &option_index);          /*
319              Stephane Letz : letz@grame.fr
320              getopt_long_only does not exist on OSX : replaced by getopt_long for now.
321            */
322            res = getopt_long(argc, argv, "", long_options, &option_index);
323          if(res == -1) break;          if(res == -1) break;
324          if (res == 0) {          if (res == 0) {
325              switch(option_index) {              switch(option_index) {
326                  case 0: // --numfragments                  case 0: // --help
327                      num_fragments = atoi(optarg);                      printf("usage: linuxsampler [OPTIONS]\n\n");
328                      break;                      printf("--help                      prints this message\n");
329                  case 1: // --fragmentsize                      printf("--version                   prints version information\n");
330                      fragmentsize = atoi(optarg);                      printf("--profile                   profile synthesis algorithms\n");
331                        printf("--no-tune                   disable assembly optimization\n");
332                        printf("--statistics                periodically prints statistics\n");
333                        printf("--lscp-addr                 set LSCP address (default: any)\n");
334                        printf("--lscp-port                 set LSCP port (default: 8888)\n");
335                        printf("--create-instruments-db     creates an instruments DB\n");
336                        printf("--instruments-db-location   specifies the instruments DB file\n");
337                        printf("--stacktrace                automatically shows stacktrace if crashes\n");
338                        printf("                            (broken on most systems at the moment)\n");
339                        exit(EXIT_SUCCESS);
340                      break;                      break;
341                  case 2: // --volume                  case 1: // --version
342                      volume = atof(optarg);                      printf("LinuxSampler %s\n", VERSION);
343                        exit(EXIT_SUCCESS);
344                      break;                      break;
345                  case 3: // --dls                  case 2: // --profile
346                      patch_format = patch_format_dls;                      profile = true;
347                      break;                      break;
348                  case 4: // --gig                  case 3: // --no-tune
349                      patch_format = patch_format_gig;                      tune = false;
350                      break;                      break;
351                  case 5: // --instrument                  case 4: // --statistics
352                      instrument_index = atoi(optarg);                      bPrintStatistics = true;
353                      break;                      break;
354                  case 6: // --inputclient                  case 5: // --instruments-db-location
355                      input_client = optarg;  #if HAVE_SQLITE3
356                        try {
357                            if (optarg) {
358                                struct stat statBuf;
359                                int res = stat(optarg, &statBuf);
360    
361                                if (res) {
362                                    std::stringstream ss;
363                                    ss << "Failed to stat `" << optarg << "`: " << strerror(errno);
364                                    throw Exception(ss.str());
365                                }
366    
367                                if (!S_ISREG(statBuf.st_mode)) {
368                                    std::stringstream ss;
369                                    ss << "`" << optarg << "` is not a regular file";
370                                    throw Exception(ss.str());
371                                }
372    
373                                InstrumentsDb::GetInstrumentsDb()->SetDbFile(String(optarg));
374                            }
375                        } catch(Exception e) {
376                            std::cerr << "Could not open instruments DB file: "
377                                      << e.Message() << std::endl;
378                            exit(EXIT_FAILURE);
379                        }
380                      break;                      break;
381                  case 7: // --alsaout  #else
382                      alsaout = optarg;                      std::cerr << "LinuxSampler was not build with ";
383                      use_jack = false; // If this option is specified do not connect to jack                      std::cerr << "instruments database support!\n";
384                        exit(EXIT_FAILURE);
385                      break;                      break;
386                  case 8: { // --jackout  #endif
387                    case 6: // --create-instruments-db
388    #if HAVE_SQLITE3
389                      try {                      try {
390                          String arg(optarg);                          if (optarg) {
391                          // remove outer apostrophes                              std::cout << "Creating instruments database..." << std::endl;
392                          arg = arg.substr(arg.find('\'') + 1, arg.rfind('\'') - (arg.find('\'') + 1));                              InstrumentsDb::CreateInstrumentsDb(String(optarg));
393                          // split in two arguments                              std::cout << "Done" << std::endl;
394                          jack_playback[0] = arg.substr(0, arg.find("\' "));                          }
395                          jack_playback[1] = arg.substr(arg.find("\' ") + 2, arg.size() - (arg.find("\' ") + 2));                      } catch(Exception e) {
396                          // remove inner apostrophes                          std::cerr << e.Message() << std::endl;
                         jack_playback[0] = jack_playback[0].substr(0, jack_playback[0].find('\''));  
                         jack_playback[1] = jack_playback[1].substr(jack_playback[1].find('\'') + 1, jack_playback[1].size() - jack_playback[1].find('\''));  
                         // this is the default but set it up anyway in case alsa_card was also used.  
                         use_jack = true;  
                     }  
                     catch (...) {  
                         fprintf(stderr, "Invalid argument '%s' for parameter --jackout\n", optarg);  
397                          exit(EXIT_FAILURE);                          exit(EXIT_FAILURE);
398                            return;
399                      }                      }
400    
401                        exit(EXIT_SUCCESS);
402                        return;
403    #else
404                        std::cerr << "Failed to create the database. LinuxSampler was ";
405                        std::cerr << "not build with instruments database support!\n";
406                        exit(EXIT_FAILURE);
407                        return;
408    #endif
409                    case 7: { // --lscp-addr
410                        struct in_addr addr;
411                        if (inet_aton(optarg, &addr) == 0)
412                            printf("WARNING: Failed to parse lscp-addr argument, ignoring!\n");
413                        else
414                            lscp_addr = addr.s_addr;
415                      break;                      break;
416                  }                  }
417                  case 9: // --samplerate                  case 8: {// --lscp-port
418                      samplerate = atoi(optarg);                      long unsigned int port = 0;
419                      break;                      if ((sscanf(optarg, "%u", &port) != 1) || (port == 0) || (port > 65535))
420                  case 10: // --server                          printf("WARNING: Failed to parse lscp-port argument, ignoring!\n");
421                      run_server = true;                      else
422                            lscp_port = htons(port);
423                      break;                      break;
424                  case 11: // --help                  }
425                      printf("usage: linuxsampler [OPTIONS] <INSTRUMENTFILE>\n\n");                  case 9: // --stacktrace
426                      printf("--gig              loads a Gigasampler instrument\n");                      bShowStackTrace = true;
                     printf("--dls              loads a DLS instrument\n");  
                     printf("--instrument       index of the instrument in the instrument file if it\n");  
                     printf("                   contains more than one (default: 0)\n");  
                     printf("--numfragments     sets the number of audio fragments\n");  
                     printf("--fragmentsize     sets the fragment size\n");  
                     printf("--volume           sets global volume gain factor (a value > 1.0 means\n");  
                     printf("                   amplification, a value < 1.0 means attenuation,\n");  
                     printf("                   default: 0.25)\n");  
                     printf("--inputclient      connects to an Alsa sequencer input client on startup\n");  
                     printf("                   (e.g. 64:0 to connect to a client with ID 64 and port 0)\n");  
                     printf("--alsaout          connects to the given Alsa sound device on startup\n");  
                     printf("                   (e.g. 0,0 to connect to hw:0,0 or plughw:0,0)\n");  
                     printf("--jackout          connects to the given Jack playback ports on startup\n");  
                     printf("                   (e.g. \"\'alsa_pcm:playback_1\' \'alsa_pcm:playback_2\'\"\n");  
                     printf("                   in case of stereo output)\n");  
                     printf("--samplerate       sets sample rate if supported by audio output system\n");  
                     printf("                   (e.g. 44100)\n");  
                     printf("--server           launch network server for remote control\n");  
                     exit(EXIT_SUCCESS);  
427                      break;                      break;
428              }              }
429          }          }
430      }      }
431  }*/  }

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

  ViewVC Help
Powered by ViewVC