/[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 361 by schoenebeck, Wed Feb 9 01:22:18 2005 UTC
# Line 110  int main(int argc, char **argv) { Line 110  int main(int argc, char **argv) {
110    
111      printf("LinuxSampler initialization completed.\n");      printf("LinuxSampler initialization completed.\n");
112    
113      while(true)  {      std::list<LSCPEvent::event_t> rtEvents;
114        rtEvents.push_back(LSCPEvent::event_voice_count);
115        rtEvents.push_back(LSCPEvent::event_stream_count);
116        rtEvents.push_back(LSCPEvent::event_buffer_fill);
117    
118        while(true)
119        {
120        /*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",
121              pEngine->ActiveVoiceCount, pEngine->ActiveVoiceCountMax,              pEngine->ActiveVoiceCount, pEngine->ActiveVoiceCountMax,
122              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 132  int main(int argc, char **argv) {
132                        fflush(stdout);                        fflush(stdout);
133                }                }
134        }        }
135          
136          if (LSCPServer::EventSubscribers(rtEvents))
137          {
138                  LSCPServer::LockRTNotify();
139                  std::map<uint,SamplerChannel*> channels = pSampler->GetSamplerChannels();
140                  std::map<uint,SamplerChannel*>::iterator iter = channels.begin();
141                  for (; iter != channels.end(); iter++) {
142                          SamplerChannel* pSamplerChannel = iter->second;
143                          Engine* pEngine = pSamplerChannel->GetEngine();
144                          if (!pEngine) continue;
145                          LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_voice_count, iter->first, pEngine->VoiceCount()));
146                          LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_stream_count, iter->first, pEngine->DiskStreamCount()));
147                          LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_buffer_fill, iter->first, pEngine->DiskStreamBufferFillPercentage()));
148                  }
149                  LSCPServer::UnlockRTNotify();
150          }
151    
152      }      }
153    
154      return EXIT_SUCCESS;      return EXIT_SUCCESS;
# Line 193  void parse_options(int argc, char **argv Line 216  void parse_options(int argc, char **argv
216          };          };
217    
218      while (true) {      while (true) {
219          res = getopt_long_only(argc, argv, "", long_options, &option_index);          /*
220              Stephane Letz : letz@grame.fr
221              getopt_long_only does not exist on OSX : replaced by getopt_long for now.
222            */
223            res = getopt_long(argc, argv, "", long_options, &option_index);
224          if(res == -1) break;          if(res == -1) break;
225          if (res == 0) {          if (res == 0) {
226              switch(option_index) {              switch(option_index) {
# Line 206  void parse_options(int argc, char **argv Line 233  void parse_options(int argc, char **argv
233                      exit(EXIT_SUCCESS);                      exit(EXIT_SUCCESS);
234                      break;                      break;
235                  case 1: // --version                  case 1: // --version
236                      printf("LinuxSampler %s\n", VERSION);                      printf("LinuxSampler %s\n", VERSION);
237                        exit(EXIT_SUCCESS);
238                      break;                      break;
239                  case 2: // --profile                  case 2: // --profile
240                      profile = true;                      profile = true;

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

  ViewVC Help
Powered by ViewVC