/[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 570 by schoenebeck, Mon May 23 17:37:26 2005 UTC revision 660 by schoenebeck, Fri Jun 17 19:49:30 2005 UTC
# Line 33  Line 33 
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    
# Line 190  int LSCPServer::Main() { Line 191  int LSCPServer::Main() {
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++) {
# Line 578  String LSCPServer::GetEngineInfo(String Line 591  String LSCPServer::GetEngineInfo(String
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);
# Line 660  String LSCPServer::GetVoiceCount(uint ui Line 673  String LSCPServer::GetVoiceCount(uint ui
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) {
# Line 680  String LSCPServer::GetStreamCount(uint u Line 694  String LSCPServer::GetStreamCount(uint u
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) {
# Line 700  String LSCPServer::GetBufferFill(fill_re Line 715  String LSCPServer::GetBufferFill(fill_re
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) {
# Line 1391  String LSCPServer::ResetChannel(uint uiS Line 1407  String LSCPServer::ResetChannel(uint uiS
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) {

Legend:
Removed from v.570  
changed lines
  Added in v.660

  ViewVC Help
Powered by ViewVC