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 |
|
|
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 |
|
|
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 |
} |
} |
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 |
|
|
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 |
} |
} |