/[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 667 by senkov, Sun Jun 19 21:22:34 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 222  void parse_options(int argc, char **argv Line 229  void parse_options(int argc, char **argv
229              {"profile",0,0,0},              {"profile",0,0,0},
230              {"no-tune",0,0,0},              {"no-tune",0,0,0},
231              {"statistics",0,0,0},              {"statistics",0,0,0},
232                {"lscp-addr",1,0,0},
233                {"lscp-port",1,0,0},
234              {0,0,0,0}              {0,0,0,0}
235          };          };
236    
# Line 240  void parse_options(int argc, char **argv Line 249  void parse_options(int argc, char **argv
249                      printf("--version          prints version information\n");                      printf("--version          prints version information\n");
250                      printf("--profile          profile synthesis algorithms\n");                      printf("--profile          profile synthesis algorithms\n");
251                      printf("--no-tune          disable assembly optimization\n");                      printf("--no-tune          disable assembly optimization\n");
252                      printf("--statistics       prints periodically statistics\n");                      printf("--statistics       periodically prints statistics\n");
253                        printf("--lscp-addr        set LSCP address (default: any)\n");
254                        printf("--lscp-port        set LSCP port (default: 8888)\n");
255                      exit(EXIT_SUCCESS);                      exit(EXIT_SUCCESS);
256                      break;                      break;
257                  case 1: // --version                  case 1: // --version
# Line 256  void parse_options(int argc, char **argv Line 267  void parse_options(int argc, char **argv
267                  case 4: // --statistics                  case 4: // --statistics
268                      bPrintStatistics = true;                      bPrintStatistics = true;
269                      break;                      break;
270                    case 5: // --lscp-addr
271                        struct in_addr addr;
272                        if (inet_aton(optarg, &addr) == 0)
273                                printf("WARNING: Failed to parse lscp-addr argument, ignoring!\n");
274                        else
275                                lscp_addr = addr.s_addr;
276                        break;
277                    case 6: // --lscp-port
278                        long unsigned int port = 0;
279                        if ((sscanf(optarg, "%u", &port) != 1) || (port == 0) || (port > 65535))
280                                printf("WARNING: Failed to parse lscp-port argument, ignoring!\n");
281                        else
282                                lscp_port = htons(port);
283                        break;
284              }              }
285          }          }
286      }      }

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

  ViewVC Help
Powered by ViewVC