3 |
* LinuxSampler - modular, streaming capable sampler * |
* LinuxSampler - modular, streaming capable sampler * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
6 |
* Copyright (C) 2005 - 2010 Christian Schoenebeck * |
* Copyright (C) 2005 - 2013 Christian Schoenebeck * |
7 |
* * |
* * |
8 |
* This library is free software; you can redistribute it and/or modify * |
* This library is free software; you can redistribute it and/or modify * |
9 |
* it under the terms of the GNU General Public License as published by * |
* it under the terms of the GNU General Public License as published by * |
680 |
return count; |
return count; |
681 |
} |
} |
682 |
|
|
683 |
|
int Sampler::GetGlobalMaxVoices() { |
684 |
|
return GLOBAL_MAX_VOICES; // see common/global_private.cpp |
685 |
|
} |
686 |
|
|
687 |
|
int Sampler::GetGlobalMaxStreams() { |
688 |
|
return GLOBAL_MAX_STREAMS; // see common/global_private.cpp |
689 |
|
} |
690 |
|
|
691 |
|
void Sampler::SetGlobalMaxVoices(int n) throw (Exception) { |
692 |
|
if (n < 1) throw Exception("Maximum voices may not be less than 1"); |
693 |
|
GLOBAL_MAX_VOICES = n; // see common/global_private.cpp |
694 |
|
const std::set<Engine*>& engines = EngineFactory::EngineInstances(); |
695 |
|
if (engines.size() > 0) { |
696 |
|
std::set<Engine*>::iterator iter = engines.begin(); |
697 |
|
std::set<Engine*>::iterator end = engines.end(); |
698 |
|
for (; iter != end; ++iter) { |
699 |
|
(*iter)->SetMaxVoices(n); |
700 |
|
} |
701 |
|
} |
702 |
|
} |
703 |
|
|
704 |
|
void Sampler::SetGlobalMaxStreams(int n) throw (Exception) { |
705 |
|
if (n < 0) throw Exception("Maximum disk streams may not be negative"); |
706 |
|
GLOBAL_MAX_STREAMS = n; // see common/global_private.cpp |
707 |
|
const std::set<Engine*>& engines = EngineFactory::EngineInstances(); |
708 |
|
if (engines.size() > 0) { |
709 |
|
std::set<Engine*>::iterator iter = engines.begin(); |
710 |
|
std::set<Engine*>::iterator end = engines.end(); |
711 |
|
for (; iter != end; ++iter) { |
712 |
|
(*iter)->SetMaxDiskStreams(n); |
713 |
|
} |
714 |
|
} |
715 |
|
} |
716 |
|
|
717 |
void Sampler::Reset() { |
void Sampler::Reset() { |
718 |
// delete sampler channels |
// delete sampler channels |
719 |
try { |
try { |
769 |
|
|
770 |
if (LSCPServer::EventSubscribers(events)) |
if (LSCPServer::EventSubscribers(events)) |
771 |
{ |
{ |
772 |
LSCPServer::LockRTNotify(); |
LockGuard lock(LSCPServer::RTNotifyMutex); |
773 |
std::map<uint,SamplerChannel*> channels = GetSamplerChannels(); |
std::map<uint,SamplerChannel*> channels = GetSamplerChannels(); |
774 |
std::map<uint,SamplerChannel*>::iterator iter = channels.begin(); |
std::map<uint,SamplerChannel*>::iterator iter = channels.begin(); |
775 |
for (; iter != channels.end(); iter++) { |
for (; iter != channels.end(); iter++) { |
785 |
|
|
786 |
fireTotalStreamCountChanged(GetDiskStreamCount()); |
fireTotalStreamCountChanged(GetDiskStreamCount()); |
787 |
fireTotalVoiceCountChanged(GetVoiceCount()); |
fireTotalVoiceCountChanged(GetVoiceCount()); |
|
|
|
|
LSCPServer::UnlockRTNotify(); |
|
788 |
} |
} |
789 |
} |
} |
790 |
|
|