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

Legend:
Removed from v.31  
changed lines
  Added in v.1830

  ViewVC Help
Powered by ViewVC