--- linuxsampler/trunk/src/network/lscpserver.cpp 2007/12/03 18:30:47 1537 +++ linuxsampler/trunk/src/network/lscpserver.cpp 2007/12/04 18:09:26 1541 @@ -127,6 +127,7 @@ LSCPEvent::RegisterEvent(LSCPEvent::event_db_instr_info, "DB_INSTRUMENT_INFO"); LSCPEvent::RegisterEvent(LSCPEvent::event_db_instrs_job_info, "DB_INSTRUMENTS_JOB_INFO"); LSCPEvent::RegisterEvent(LSCPEvent::event_misc, "MISCELLANEOUS"); + LSCPEvent::RegisterEvent(LSCPEvent::event_total_stream_count, "TOTAL_STREAM_COUNT"); LSCPEvent::RegisterEvent(LSCPEvent::event_total_voice_count, "TOTAL_VOICE_COUNT"); LSCPEvent::RegisterEvent(LSCPEvent::event_global_info, "GLOBAL_INFO"); hSocket = -1; @@ -188,6 +189,10 @@ LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_total_voice_count, NewCount)); } +void LSCPServer::EventHandler::TotalStreamCountChanged(int NewCount) { + LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_total_stream_count, NewCount)); +} + #if HAVE_SQLITE3 void LSCPServer::DbInstrumentsEventHandler::DirectoryCountChanged(String Dir) { LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_db_instr_dir_count, InstrumentsDb::toEscapedPath(Dir))); @@ -284,6 +289,7 @@ pSampler->AddVoiceCountListener(&eventHandler); pSampler->AddStreamCountListener(&eventHandler); pSampler->AddBufferFillListener(&eventHandler); + pSampler->AddTotalStreamCountListener(&eventHandler); pSampler->AddTotalVoiceCountListener(&eventHandler); pSampler->AddFxSendCountListener(&eventHandler); MidiInstrumentMapper::AddMidiInstrumentCountListener(&eventHandler); @@ -2346,6 +2352,16 @@ return result.Produce(); } +/** + * Will be called by the parser to return the current number of all active streams. + */ +String LSCPServer::GetTotalStreamCount() { + dmsg(2,("LSCPServer: GetTotalStreamCount()\n")); + LSCPResultSet result; + result.Add(pSampler->GetDiskStreamCount()); + return result.Produce(); +} + /** * Will be called by the parser to return the current number of all active voices. */