/[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 325 by senkov, Tue Dec 21 04:54:37 2004 UTC revision 411 by schoenebeck, Sat Feb 26 02:01:14 2005 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 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 71  int main(int argc, char **argv) { Line 72  int main(int argc, char **argv) {
72    
73      dmsg(1,("LinuxSampler %s\n", VERSION));      dmsg(1,("LinuxSampler %s\n", VERSION));
74      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"));
75        dmsg(1,("Copyright (C) 2005 Christian Schoenebeck\n"));
76    
77      if (tune)      if (tune)
78      {      {
# Line 110  int main(int argc, char **argv) { Line 112  int main(int argc, char **argv) {
112    
113      printf("LinuxSampler initialization completed.\n");      printf("LinuxSampler initialization completed.\n");
114    
115      while(true)  {      std::list<LSCPEvent::event_t> rtEvents;
116        rtEvents.push_back(LSCPEvent::event_voice_count);
117        rtEvents.push_back(LSCPEvent::event_stream_count);
118        rtEvents.push_back(LSCPEvent::event_buffer_fill);
119    
120        while(true)
121        {
122        /*printf("Voices: %3.3d (Max: %3.3d) Streams: %3.3d (Max: %3.3d, Unused: %3.3d)\r",        /*printf("Voices: %3.3d (Max: %3.3d) Streams: %3.3d (Max: %3.3d, Unused: %3.3d)\r",
123              pEngine->ActiveVoiceCount, pEngine->ActiveVoiceCountMax,              pEngine->ActiveVoiceCount, pEngine->ActiveVoiceCountMax,
124              pEngine->pDiskThread->ActiveStreamCount, pEngine->pDiskThread->ActiveStreamCountMax, Stream::GetUnusedStreams());              pEngine->pDiskThread->ActiveStreamCount, pEngine->pDiskThread->ActiveStreamCountMax, Stream::GetUnusedStreams());
# Line 126  int main(int argc, char **argv) { Line 134  int main(int argc, char **argv) {
134                        fflush(stdout);                        fflush(stdout);
135                }                }
136        }        }
137          
138          if (LSCPServer::EventSubscribers(rtEvents))
139          {
140                  LSCPServer::LockRTNotify();
141                  std::map<uint,SamplerChannel*> channels = pSampler->GetSamplerChannels();
142                  std::map<uint,SamplerChannel*>::iterator iter = channels.begin();
143                  for (; iter != channels.end(); iter++) {
144                          SamplerChannel* pSamplerChannel = iter->second;
145                          EngineChannel* pEngineChannel = pSamplerChannel->GetEngineChannel();
146                          if (!pEngineChannel) continue;
147                          Engine* pEngine = pEngineChannel->GetEngine();
148                          if (!pEngine) continue;
149                          LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_voice_count, iter->first, pEngine->VoiceCount()));
150                          LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_stream_count, iter->first, pEngine->DiskStreamCount()));
151                          LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_buffer_fill, iter->first, pEngine->DiskStreamBufferFillPercentage()));
152                  }
153                  LSCPServer::UnlockRTNotify();
154          }
155    
156      }      }
157    
158      return EXIT_SUCCESS;      return EXIT_SUCCESS;
# Line 193  void parse_options(int argc, char **argv Line 220  void parse_options(int argc, char **argv
220          };          };
221    
222      while (true) {      while (true) {
223          res = getopt_long_only(argc, argv, "", long_options, &option_index);          /*
224              Stephane Letz : letz@grame.fr
225              getopt_long_only does not exist on OSX : replaced by getopt_long for now.
226            */
227            res = getopt_long(argc, argv, "", long_options, &option_index);
228          if(res == -1) break;          if(res == -1) break;
229          if (res == 0) {          if (res == 0) {
230              switch(option_index) {              switch(option_index) {
# Line 206  void parse_options(int argc, char **argv Line 237  void parse_options(int argc, char **argv
237                      exit(EXIT_SUCCESS);                      exit(EXIT_SUCCESS);
238                      break;                      break;
239                  case 1: // --version                  case 1: // --version
240                      printf("LinuxSampler %s\n", VERSION);                      printf("LinuxSampler %s\n", VERSION);
241                        exit(EXIT_SUCCESS);
242                      break;                      break;
243                  case 2: // --profile                  case 2: // --profile
244                      profile = true;                      profile = true;

Legend:
Removed from v.325  
changed lines
  Added in v.411

  ViewVC Help
Powered by ViewVC