/[svn]/linuxsampler/trunk/src/network/lscpserver.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/network/lscpserver.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1537 by senoner, Mon Dec 3 18:30:47 2007 UTC revision 1551 by schoenebeck, Wed Dec 5 22:05:28 2007 UTC
# Line 127  LSCPServer::LSCPServer(Sampler* pSampler Line 127  LSCPServer::LSCPServer(Sampler* pSampler
127      LSCPEvent::RegisterEvent(LSCPEvent::event_db_instr_info, "DB_INSTRUMENT_INFO");      LSCPEvent::RegisterEvent(LSCPEvent::event_db_instr_info, "DB_INSTRUMENT_INFO");
128      LSCPEvent::RegisterEvent(LSCPEvent::event_db_instrs_job_info, "DB_INSTRUMENTS_JOB_INFO");      LSCPEvent::RegisterEvent(LSCPEvent::event_db_instrs_job_info, "DB_INSTRUMENTS_JOB_INFO");
129      LSCPEvent::RegisterEvent(LSCPEvent::event_misc, "MISCELLANEOUS");      LSCPEvent::RegisterEvent(LSCPEvent::event_misc, "MISCELLANEOUS");
130        LSCPEvent::RegisterEvent(LSCPEvent::event_total_stream_count, "TOTAL_STREAM_COUNT");
131      LSCPEvent::RegisterEvent(LSCPEvent::event_total_voice_count, "TOTAL_VOICE_COUNT");      LSCPEvent::RegisterEvent(LSCPEvent::event_total_voice_count, "TOTAL_VOICE_COUNT");
132      LSCPEvent::RegisterEvent(LSCPEvent::event_global_info, "GLOBAL_INFO");      LSCPEvent::RegisterEvent(LSCPEvent::event_global_info, "GLOBAL_INFO");
133      hSocket = -1;      hSocket = -1;
# Line 188  void LSCPServer::EventHandler::TotalVoic Line 189  void LSCPServer::EventHandler::TotalVoic
189      LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_total_voice_count, NewCount));      LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_total_voice_count, NewCount));
190  }  }
191    
192    void LSCPServer::EventHandler::TotalStreamCountChanged(int NewCount) {
193        LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_total_stream_count, NewCount));
194    }
195    
196  #if HAVE_SQLITE3  #if HAVE_SQLITE3
197  void LSCPServer::DbInstrumentsEventHandler::DirectoryCountChanged(String Dir) {  void LSCPServer::DbInstrumentsEventHandler::DirectoryCountChanged(String Dir) {
198      LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_db_instr_dir_count, InstrumentsDb::toEscapedPath(Dir)));      LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_db_instr_dir_count, InstrumentsDb::toEscapedPath(Dir)));
# Line 284  int LSCPServer::Main() { Line 289  int LSCPServer::Main() {
289      pSampler->AddVoiceCountListener(&eventHandler);      pSampler->AddVoiceCountListener(&eventHandler);
290      pSampler->AddStreamCountListener(&eventHandler);      pSampler->AddStreamCountListener(&eventHandler);
291      pSampler->AddBufferFillListener(&eventHandler);      pSampler->AddBufferFillListener(&eventHandler);
292        pSampler->AddTotalStreamCountListener(&eventHandler);
293      pSampler->AddTotalVoiceCountListener(&eventHandler);      pSampler->AddTotalVoiceCountListener(&eventHandler);
294      pSampler->AddFxSendCountListener(&eventHandler);      pSampler->AddFxSendCountListener(&eventHandler);
295      MidiInstrumentMapper::AddMidiInstrumentCountListener(&eventHandler);      MidiInstrumentMapper::AddMidiInstrumentCountListener(&eventHandler);
# Line 440  void LSCPServer::CloseConnection( std::v Line 446  void LSCPServer::CloseConnection( std::v
446          NotifyMutex.Unlock();          NotifyMutex.Unlock();
447  }  }
448    
449    void LSCPServer::LockRTNotify() {
450        RTNotifyMutex.Lock();
451    }
452    
453    void LSCPServer::UnlockRTNotify() {
454        RTNotifyMutex.Unlock();
455    }
456    
457  int LSCPServer::EventSubscribers( std::list<LSCPEvent::event_t> events ) {  int LSCPServer::EventSubscribers( std::list<LSCPEvent::event_t> events ) {
458          int subs = 0;          int subs = 0;
459          SubscriptionMutex.Lock();          SubscriptionMutex.Lock();
# Line 2347  String LSCPServer::GetServerInfo() { Line 2361  String LSCPServer::GetServerInfo() {
2361  }  }
2362    
2363  /**  /**
2364     * Will be called by the parser to return the current number of all active streams.
2365     */
2366    String LSCPServer::GetTotalStreamCount() {
2367        dmsg(2,("LSCPServer: GetTotalStreamCount()\n"));
2368        LSCPResultSet result;
2369        result.Add(pSampler->GetDiskStreamCount());
2370        return result.Produce();
2371    }
2372    
2373    /**
2374   * Will be called by the parser to return the current number of all active voices.   * Will be called by the parser to return the current number of all active voices.
2375   */   */
2376  String LSCPServer::GetTotalVoiceCount() {  String LSCPServer::GetTotalVoiceCount() {
# Line 2529  void LSCPServer::VerifyFile(String Filen Line 2553  void LSCPServer::VerifyFile(String Filen
2553      if ( win32FileAttributeData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) {      if ( win32FileAttributeData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) {
2554          throw Exception("Directory is specified");          throw Exception("Directory is specified");
2555      }      }
2556      #else          #else
2557      struct stat statBuf;      struct stat statBuf;
2558      int res = stat(Filename.c_str(), &statBuf);      int res = stat(Filename.c_str(), &statBuf);
2559      if (res) {      if (res) {

Legend:
Removed from v.1537  
changed lines
  Added in v.1551

  ViewVC Help
Powered by ViewVC