/[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 2324 by persson, Sun Mar 4 09:01:32 2012 UTC revision 2375 by schoenebeck, Thu Oct 4 17:45:22 2012 UTC
# Line 3063  String LSCPServer::GetTotalVoiceCount() Line 3063  String LSCPServer::GetTotalVoiceCount()
3063  String LSCPServer::GetTotalVoiceCountMax() {  String LSCPServer::GetTotalVoiceCountMax() {
3064      dmsg(2,("LSCPServer: GetTotalVoiceCountMax()\n"));      dmsg(2,("LSCPServer: GetTotalVoiceCountMax()\n"));
3065      LSCPResultSet result;      LSCPResultSet result;
3066      result.Add(EngineFactory::EngineInstances().size() * GLOBAL_MAX_VOICES);      result.Add(EngineFactory::EngineInstances().size() * pSampler->GetGlobalMaxVoices());
3067      return result.Produce();      return result.Produce();
3068  }  }
3069    
# Line 3074  String LSCPServer::GetTotalVoiceCountMax Line 3074  String LSCPServer::GetTotalVoiceCountMax
3074  String LSCPServer::GetGlobalMaxVoices() {  String LSCPServer::GetGlobalMaxVoices() {
3075      dmsg(2,("LSCPServer: GetGlobalMaxVoices()\n"));      dmsg(2,("LSCPServer: GetGlobalMaxVoices()\n"));
3076      LSCPResultSet result;      LSCPResultSet result;
3077      result.Add(GLOBAL_MAX_VOICES);      result.Add(pSampler->GetGlobalMaxVoices());
3078      return result.Produce();      return result.Produce();
3079  }  }
3080    
# Line 3086  String LSCPServer::SetGlobalMaxVoices(in Line 3086  String LSCPServer::SetGlobalMaxVoices(in
3086      dmsg(2,("LSCPServer: SetGlobalMaxVoices(%d)\n", iVoices));      dmsg(2,("LSCPServer: SetGlobalMaxVoices(%d)\n", iVoices));
3087      LSCPResultSet result;      LSCPResultSet result;
3088      try {      try {
3089          if (iVoices < 1) throw Exception("Maximum voices may not be less than 1");          pSampler->SetGlobalMaxVoices(iVoices);
3090          GLOBAL_MAX_VOICES = iVoices; // see common/global_private.cpp          LSCPServer::SendLSCPNotify(
3091          const std::set<Engine*>& engines = EngineFactory::EngineInstances();              LSCPEvent(LSCPEvent::event_global_info, "VOICES", pSampler->GetGlobalMaxVoices())
3092          if (engines.size() > 0) {          );
             std::set<Engine*>::iterator iter = engines.begin();  
             std::set<Engine*>::iterator end  = engines.end();  
             for (; iter != end; ++iter) {  
                 (*iter)->SetMaxVoices(iVoices);  
             }  
         }  
         LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_global_info, "VOICES", GLOBAL_MAX_VOICES));  
3093      } catch (Exception e) {      } catch (Exception e) {
3094          result.Error(e);          result.Error(e);
3095      }      }
# Line 3110  String LSCPServer::SetGlobalMaxVoices(in Line 3103  String LSCPServer::SetGlobalMaxVoices(in
3103  String LSCPServer::GetGlobalMaxStreams() {  String LSCPServer::GetGlobalMaxStreams() {
3104      dmsg(2,("LSCPServer: GetGlobalMaxStreams()\n"));      dmsg(2,("LSCPServer: GetGlobalMaxStreams()\n"));
3105      LSCPResultSet result;      LSCPResultSet result;
3106      result.Add(GLOBAL_MAX_STREAMS);      result.Add(pSampler->GetGlobalMaxStreams());
3107      return result.Produce();      return result.Produce();
3108  }  }
3109    
# Line 3122  String LSCPServer::SetGlobalMaxStreams(i Line 3115  String LSCPServer::SetGlobalMaxStreams(i
3115      dmsg(2,("LSCPServer: SetGlobalMaxStreams(%d)\n", iStreams));      dmsg(2,("LSCPServer: SetGlobalMaxStreams(%d)\n", iStreams));
3116      LSCPResultSet result;      LSCPResultSet result;
3117      try {      try {
3118          if (iStreams < 0) throw Exception("Maximum disk streams may not be negative");          pSampler->SetGlobalMaxStreams(iStreams);
3119          GLOBAL_MAX_STREAMS = iStreams; // see common/global_private.cpp          LSCPServer::SendLSCPNotify(
3120          const std::set<Engine*>& engines = EngineFactory::EngineInstances();              LSCPEvent(LSCPEvent::event_global_info, "STREAMS", pSampler->GetGlobalMaxStreams())
3121          if (engines.size() > 0) {          );
             std::set<Engine*>::iterator iter = engines.begin();  
             std::set<Engine*>::iterator end  = engines.end();  
             for (; iter != end; ++iter) {  
                 (*iter)->SetMaxDiskStreams(iStreams);  
             }  
         }  
         LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_global_info, "STREAMS", GLOBAL_MAX_STREAMS));  
3122      } catch (Exception e) {      } catch (Exception e) {
3123          result.Error(e);          result.Error(e);
3124      }      }

Legend:
Removed from v.2324  
changed lines
  Added in v.2375

  ViewVC Help
Powered by ViewVC