/[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 579 by schoenebeck, Tue May 24 19:20:20 2005 UTC revision 770 by schoenebeck, Sun Sep 11 15:56:29 2005 UTC
# Line 41  pthread_t   main_thread; Line 41  pthread_t   main_thread;
41  bool bPrintStatistics = false;  bool bPrintStatistics = false;
42  bool profile = false;  bool profile = false;
43  bool tune = true;  bool tune = true;
44    unsigned long int lscp_addr;
45    unsigned short int lscp_port;
46    
47  void parse_options(int argc, char **argv);  void parse_options(int argc, char **argv);
48  void signal_handler(int signal);  void signal_handler(int signal);
# Line 69  int main(int argc, char **argv) { Line 71  int main(int argc, char **argv) {
71      sigaction(SIGUSR1, &sact, NULL);      sigaction(SIGUSR1, &sact, NULL);
72      sigaction(SIGUSR2, &sact, NULL);      sigaction(SIGUSR2, &sact, NULL);
73    
74        lscp_addr = htonl(LSCP_ADDR);
75        lscp_port = htons(LSCP_PORT);
76    
77      // parse and assign command line options      // parse and assign command line options
78      parse_options(argc, argv);      parse_options(argc, argv);
79    
# Line 93  int main(int argc, char **argv) { Line 98  int main(int argc, char **argv) {
98      dmsg(1,("Registered audio output drivers: %s\n", AudioOutputDeviceFactory::AvailableDriversAsString().c_str()));      dmsg(1,("Registered audio output drivers: %s\n", AudioOutputDeviceFactory::AvailableDriversAsString().c_str()));
99    
100      // start LSCP network server      // start LSCP network server
101      dmsg(1,("Starting LSCP network server (on TCP port %d)...", LSCP_PORT));      struct in_addr addr;
102      pLSCPServer = new LSCPServer(pSampler);      addr.s_addr = lscp_addr;
103        dmsg(1,("Starting LSCP network server (%s:%d)...", inet_ntoa(addr), ntohs(lscp_port)));
104        pLSCPServer = new LSCPServer(pSampler, lscp_addr, lscp_port);
105      pLSCPServer->StartThread();      pLSCPServer->StartThread();
106      pLSCPServer->WaitUntilInitialized();      pLSCPServer->WaitUntilInitialized();
107      dmsg(1,("OK\n"));      dmsg(1,("OK\n"));
# Line 104  int main(int argc, char **argv) { Line 111  int main(int argc, char **argv) {
111          dmsg(1,("Calibrating profiler..."));          dmsg(1,("Calibrating profiler..."));
112          gig::Profiler::Calibrate();          gig::Profiler::Calibrate();
113          gig::Profiler::Reset();          gig::Profiler::Reset();
114            gig::Profiler::enable();
115          dmsg(1,("OK\n"));          dmsg(1,("OK\n"));
116      }      }
117    
# Line 222  void parse_options(int argc, char **argv Line 230  void parse_options(int argc, char **argv
230              {"profile",0,0,0},              {"profile",0,0,0},
231              {"no-tune",0,0,0},              {"no-tune",0,0,0},
232              {"statistics",0,0,0},              {"statistics",0,0,0},
233                {"lscp-addr",1,0,0},
234                {"lscp-port",1,0,0},
235              {0,0,0,0}              {0,0,0,0}
236          };          };
237    
# Line 240  void parse_options(int argc, char **argv Line 250  void parse_options(int argc, char **argv
250                      printf("--version          prints version information\n");                      printf("--version          prints version information\n");
251                      printf("--profile          profile synthesis algorithms\n");                      printf("--profile          profile synthesis algorithms\n");
252                      printf("--no-tune          disable assembly optimization\n");                      printf("--no-tune          disable assembly optimization\n");
253                      printf("--statistics       prints periodically statistics\n");                      printf("--statistics       periodically prints statistics\n");
254                        printf("--lscp-addr        set LSCP address (default: any)\n");
255                        printf("--lscp-port        set LSCP port (default: 8888)\n");
256                      exit(EXIT_SUCCESS);                      exit(EXIT_SUCCESS);
257                      break;                      break;
258                  case 1: // --version                  case 1: // --version
# Line 256  void parse_options(int argc, char **argv Line 268  void parse_options(int argc, char **argv
268                  case 4: // --statistics                  case 4: // --statistics
269                      bPrintStatistics = true;                      bPrintStatistics = true;
270                      break;                      break;
271                    case 5: // --lscp-addr
272                        struct in_addr addr;
273                        if (inet_aton(optarg, &addr) == 0)
274                                printf("WARNING: Failed to parse lscp-addr argument, ignoring!\n");
275                        else
276                                lscp_addr = addr.s_addr;
277                        break;
278                    case 6: // --lscp-port
279                        long unsigned int port = 0;
280                        if ((sscanf(optarg, "%u", &port) != 1) || (port == 0) || (port > 65535))
281                                printf("WARNING: Failed to parse lscp-port argument, ignoring!\n");
282                        else
283                                lscp_port = htons(port);
284                        break;
285              }              }
286          }          }
287      }      }

Legend:
Removed from v.579  
changed lines
  Added in v.770

  ViewVC Help
Powered by ViewVC