--- linuxsampler/trunk/src/network/lscpserver.cpp 2005/07/21 08:38:15 707 +++ linuxsampler/trunk/src/network/lscpserver.cpp 2005/09/23 06:58:26 778 @@ -72,6 +72,7 @@ LSCPEvent::RegisterEvent(LSCPEvent::event_buffer_fill, "BUFFER_FILL"); LSCPEvent::RegisterEvent(LSCPEvent::event_channel_info, "CHANNEL_INFO"); LSCPEvent::RegisterEvent(LSCPEvent::event_misc, "MISCELLANEOUS"); + LSCPEvent::RegisterEvent(LSCPEvent::event_total_voice_count, "TOTAL_VOICE_COUNT"); hSocket = -1; } @@ -1545,6 +1546,26 @@ return result.Produce(); } +/** + * Will be called by the parser to return the current number of all active voices. + */ +String LSCPServer::GetTotalVoiceCount() { + dmsg(2,("LSCPServer: GetTotalVoiceCount()\n")); + LSCPResultSet result; + result.Add(pSampler->GetVoiceCount()); + return result.Produce(); +} + +/** + * Will be called by the parser to return the maximum number of voices. + */ +String LSCPServer::GetTotalVoiceCountMax() { + dmsg(2,("LSCPServer: GetTotalVoiceCountMax()\n")); + LSCPResultSet result; + result.Add(EngineFactory::EngineInstances().size() * CONFIG_MAX_VOICES); + return result.Produce(); +} + /** * Will be called by the parser to subscribe a client (frontend) on the * server for receiving event messages.