33 |
#endif |
#endif |
34 |
|
|
35 |
#include "../engines/EngineFactory.h" |
#include "../engines/EngineFactory.h" |
36 |
|
#include "../engines/EngineChannelFactory.h" |
37 |
#include "../drivers/audio/AudioOutputDeviceFactory.h" |
#include "../drivers/audio/AudioOutputDeviceFactory.h" |
38 |
#include "../drivers/midi/MidiInputDeviceFactory.h" |
#include "../drivers/midi/MidiInputDeviceFactory.h" |
39 |
|
|
191 |
} |
} |
192 |
} |
} |
193 |
|
|
194 |
|
// check if some engine channel's parameter / status changed, if so notify the respective LSCP event subscribers |
195 |
|
{ |
196 |
|
std::set<EngineChannel*> engineChannels = EngineChannelFactory::EngineChannelInstances(); |
197 |
|
std::set<EngineChannel*>::iterator itEngineChannel = engineChannels.begin(); |
198 |
|
std::set<EngineChannel*>::iterator itEnd = engineChannels.end(); |
199 |
|
for (; itEngineChannel != itEnd; ++itEngineChannel) { |
200 |
|
if ((*itEngineChannel)->StatusChanged()) { |
201 |
|
SendLSCPNotify(LSCPEvent(LSCPEvent::event_channel_info, (*itEngineChannel)->iSamplerChannelIndex)); |
202 |
|
} |
203 |
|
} |
204 |
|
} |
205 |
|
|
206 |
//Now let's deliver late notifies (if any) |
//Now let's deliver late notifies (if any) |
207 |
NotifyBufferMutex.Lock(); |
NotifyBufferMutex.Lock(); |
208 |
for (std::map<int,String>::iterator iterNotify = bufferedNotifies.begin(); iterNotify != bufferedNotifies.end(); iterNotify++) { |
for (std::map<int,String>::iterator iterNotify = bufferedNotifies.begin(); iterNotify != bufferedNotifies.end(); iterNotify++) { |
591 |
Engine* pEngine = EngineFactory::Create(EngineName); |
Engine* pEngine = EngineFactory::Create(EngineName); |
592 |
result.Add("DESCRIPTION", pEngine->Description()); |
result.Add("DESCRIPTION", pEngine->Description()); |
593 |
result.Add("VERSION", pEngine->Version()); |
result.Add("VERSION", pEngine->Version()); |
594 |
delete pEngine; |
EngineFactory::Destroy(pEngine); |
595 |
} |
} |
596 |
catch (LinuxSamplerException e) { |
catch (LinuxSamplerException e) { |
597 |
result.Error(e); |
result.Error(e); |
673 |
if (!pSamplerChannel) throw LinuxSamplerException("Invalid sampler channel number " + ToString(uiSamplerChannel)); |
if (!pSamplerChannel) throw LinuxSamplerException("Invalid sampler channel number " + ToString(uiSamplerChannel)); |
674 |
EngineChannel* pEngineChannel = pSamplerChannel->GetEngineChannel(); |
EngineChannel* pEngineChannel = pSamplerChannel->GetEngineChannel(); |
675 |
if (!pEngineChannel) throw LinuxSamplerException("No engine loaded on sampler channel"); |
if (!pEngineChannel) throw LinuxSamplerException("No engine loaded on sampler channel"); |
676 |
|
if (!pEngineChannel->GetEngine()) throw LinuxSamplerException("No audio output device connected to sampler channel"); |
677 |
result.Add(pEngineChannel->GetEngine()->VoiceCount()); |
result.Add(pEngineChannel->GetEngine()->VoiceCount()); |
678 |
} |
} |
679 |
catch (LinuxSamplerException e) { |
catch (LinuxSamplerException e) { |
694 |
if (!pSamplerChannel) throw LinuxSamplerException("Invalid sampler channel number " + ToString(uiSamplerChannel)); |
if (!pSamplerChannel) throw LinuxSamplerException("Invalid sampler channel number " + ToString(uiSamplerChannel)); |
695 |
EngineChannel* pEngineChannel = pSamplerChannel->GetEngineChannel(); |
EngineChannel* pEngineChannel = pSamplerChannel->GetEngineChannel(); |
696 |
if (!pEngineChannel) throw LinuxSamplerException("No engine type assigned to sampler channel"); |
if (!pEngineChannel) throw LinuxSamplerException("No engine type assigned to sampler channel"); |
697 |
|
if (!pEngineChannel->GetEngine()) throw LinuxSamplerException("No audio output device connected to sampler channel"); |
698 |
result.Add(pEngineChannel->GetEngine()->DiskStreamCount()); |
result.Add(pEngineChannel->GetEngine()->DiskStreamCount()); |
699 |
} |
} |
700 |
catch (LinuxSamplerException e) { |
catch (LinuxSamplerException e) { |
715 |
if (!pSamplerChannel) throw LinuxSamplerException("Invalid sampler channel number " + ToString(uiSamplerChannel)); |
if (!pSamplerChannel) throw LinuxSamplerException("Invalid sampler channel number " + ToString(uiSamplerChannel)); |
716 |
EngineChannel* pEngineChannel = pSamplerChannel->GetEngineChannel(); |
EngineChannel* pEngineChannel = pSamplerChannel->GetEngineChannel(); |
717 |
if (!pEngineChannel) throw LinuxSamplerException("No engine type assigned to sampler channel"); |
if (!pEngineChannel) throw LinuxSamplerException("No engine type assigned to sampler channel"); |
718 |
|
if (!pEngineChannel->GetEngine()) throw LinuxSamplerException("No audio output device connected to sampler channel"); |
719 |
if (!pEngineChannel->GetEngine()->DiskStreamSupported()) result.Add("NA"); |
if (!pEngineChannel->GetEngine()->DiskStreamSupported()) result.Add("NA"); |
720 |
else { |
else { |
721 |
switch (ResponseType) { |
switch (ResponseType) { |
1407 |
if (!pSamplerChannel) throw LinuxSamplerException("Invalid sampler channel number " + ToString(uiSamplerChannel)); |
if (!pSamplerChannel) throw LinuxSamplerException("Invalid sampler channel number " + ToString(uiSamplerChannel)); |
1408 |
EngineChannel* pEngineChannel = pSamplerChannel->GetEngineChannel(); |
EngineChannel* pEngineChannel = pSamplerChannel->GetEngineChannel(); |
1409 |
if (!pEngineChannel) throw LinuxSamplerException("No engine type assigned to sampler channel"); |
if (!pEngineChannel) throw LinuxSamplerException("No engine type assigned to sampler channel"); |
1410 |
|
if (!pEngineChannel->GetEngine()) throw LinuxSamplerException("No audio output device connected to sampler channel"); |
1411 |
pEngineChannel->GetEngine()->Reset(); |
pEngineChannel->GetEngine()->Reset(); |
1412 |
} |
} |
1413 |
catch (LinuxSamplerException e) { |
catch (LinuxSamplerException e) { |
1434 |
dmsg(2,("LSCPServer: GetServerInfo()\n")); |
dmsg(2,("LSCPServer: GetServerInfo()\n")); |
1435 |
LSCPResultSet result; |
LSCPResultSet result; |
1436 |
result.Add("DESCRIPTION", "LinuxSampler - modular, streaming capable sampler"); |
result.Add("DESCRIPTION", "LinuxSampler - modular, streaming capable sampler"); |
1437 |
result.Add("VERSION", VERSION); |
result.Add("VERSION", VERSION); |
1438 |
|
result.Add("PROTOCOL_VERSION", "1.0"); |
1439 |
return result.Produce(); |
return result.Produce(); |
1440 |
} |
} |
1441 |
|
|