/[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 527 by capela, Mon May 9 11:59:58 2005 UTC revision 620 by schoenebeck, Wed Jun 8 23:16:13 2005 UTC
# Line 62  Mutex LSCPServer::RTNotifyMutex = Mutex( Line 62  Mutex LSCPServer::RTNotifyMutex = Mutex(
62    
63  LSCPServer::LSCPServer(Sampler* pSampler) : Thread(true, false, 0, -4) {  LSCPServer::LSCPServer(Sampler* pSampler) : Thread(true, false, 0, -4) {
64      this->pSampler = pSampler;      this->pSampler = pSampler;
65      LSCPEvent::RegisterEvent(LSCPEvent::event_channels, "CHANNELS");      LSCPEvent::RegisterEvent(LSCPEvent::event_channel_count, "CHANNEL_COUNT");
66      LSCPEvent::RegisterEvent(LSCPEvent::event_voice_count, "VOICE_COUNT");      LSCPEvent::RegisterEvent(LSCPEvent::event_voice_count, "VOICE_COUNT");
67      LSCPEvent::RegisterEvent(LSCPEvent::event_stream_count, "STREAM_COUNT");      LSCPEvent::RegisterEvent(LSCPEvent::event_stream_count, "STREAM_COUNT");
68      LSCPEvent::RegisterEvent(LSCPEvent::event_buffer_fill, "BUFFER_FILL");      LSCPEvent::RegisterEvent(LSCPEvent::event_buffer_fill, "BUFFER_FILL");
69      LSCPEvent::RegisterEvent(LSCPEvent::event_info, "INFO");      LSCPEvent::RegisterEvent(LSCPEvent::event_channel_info, "CHANNEL_INFO");
70      LSCPEvent::RegisterEvent(LSCPEvent::event_misc, "MISCELLANEOUS");      LSCPEvent::RegisterEvent(LSCPEvent::event_misc, "MISCELLANEOUS");
71      hSocket = -1;      hSocket = -1;
72  }  }
# Line 660  String LSCPServer::GetVoiceCount(uint ui Line 660  String LSCPServer::GetVoiceCount(uint ui
660          if (!pSamplerChannel) throw LinuxSamplerException("Invalid sampler channel number " + ToString(uiSamplerChannel));          if (!pSamplerChannel) throw LinuxSamplerException("Invalid sampler channel number " + ToString(uiSamplerChannel));
661          EngineChannel* pEngineChannel = pSamplerChannel->GetEngineChannel();          EngineChannel* pEngineChannel = pSamplerChannel->GetEngineChannel();
662          if (!pEngineChannel) throw LinuxSamplerException("No engine loaded on sampler channel");          if (!pEngineChannel) throw LinuxSamplerException("No engine loaded on sampler channel");
663            if (!pEngineChannel->GetEngine()) throw LinuxSamplerException("No audio output device connected to sampler channel");
664          result.Add(pEngineChannel->GetEngine()->VoiceCount());          result.Add(pEngineChannel->GetEngine()->VoiceCount());
665      }      }
666      catch (LinuxSamplerException e) {      catch (LinuxSamplerException e) {
# Line 680  String LSCPServer::GetStreamCount(uint u Line 681  String LSCPServer::GetStreamCount(uint u
681          if (!pSamplerChannel) throw LinuxSamplerException("Invalid sampler channel number " + ToString(uiSamplerChannel));          if (!pSamplerChannel) throw LinuxSamplerException("Invalid sampler channel number " + ToString(uiSamplerChannel));
682          EngineChannel* pEngineChannel = pSamplerChannel->GetEngineChannel();          EngineChannel* pEngineChannel = pSamplerChannel->GetEngineChannel();
683          if (!pEngineChannel) throw LinuxSamplerException("No engine type assigned to sampler channel");          if (!pEngineChannel) throw LinuxSamplerException("No engine type assigned to sampler channel");
684            if (!pEngineChannel->GetEngine()) throw LinuxSamplerException("No audio output device connected to sampler channel");
685          result.Add(pEngineChannel->GetEngine()->DiskStreamCount());          result.Add(pEngineChannel->GetEngine()->DiskStreamCount());
686      }      }
687      catch (LinuxSamplerException e) {      catch (LinuxSamplerException e) {
# Line 700  String LSCPServer::GetBufferFill(fill_re Line 702  String LSCPServer::GetBufferFill(fill_re
702          if (!pSamplerChannel) throw LinuxSamplerException("Invalid sampler channel number " + ToString(uiSamplerChannel));          if (!pSamplerChannel) throw LinuxSamplerException("Invalid sampler channel number " + ToString(uiSamplerChannel));
703          EngineChannel* pEngineChannel = pSamplerChannel->GetEngineChannel();          EngineChannel* pEngineChannel = pSamplerChannel->GetEngineChannel();
704          if (!pEngineChannel) throw LinuxSamplerException("No engine type assigned to sampler channel");          if (!pEngineChannel) throw LinuxSamplerException("No engine type assigned to sampler channel");
705            if (!pEngineChannel->GetEngine()) throw LinuxSamplerException("No audio output device connected to sampler channel");
706          if (!pEngineChannel->GetEngine()->DiskStreamSupported()) result.Add("NA");          if (!pEngineChannel->GetEngine()->DiskStreamSupported()) result.Add("NA");
707          else {          else {
708              switch (ResponseType) {              switch (ResponseType) {
# Line 1391  String LSCPServer::ResetChannel(uint uiS Line 1394  String LSCPServer::ResetChannel(uint uiS
1394          if (!pSamplerChannel) throw LinuxSamplerException("Invalid sampler channel number " + ToString(uiSamplerChannel));          if (!pSamplerChannel) throw LinuxSamplerException("Invalid sampler channel number " + ToString(uiSamplerChannel));
1395          EngineChannel* pEngineChannel = pSamplerChannel->GetEngineChannel();          EngineChannel* pEngineChannel = pSamplerChannel->GetEngineChannel();
1396          if (!pEngineChannel) throw LinuxSamplerException("No engine type assigned to sampler channel");          if (!pEngineChannel) throw LinuxSamplerException("No engine type assigned to sampler channel");
1397            if (!pEngineChannel->GetEngine()) throw LinuxSamplerException("No audio output device connected to sampler channel");
1398          pEngineChannel->GetEngine()->Reset();          pEngineChannel->GetEngine()->Reset();
1399      }      }
1400      catch (LinuxSamplerException e) {      catch (LinuxSamplerException e) {
# Line 1409  String LSCPServer::ResetSampler() { Line 1413  String LSCPServer::ResetSampler() {
1413      return result.Produce();      return result.Produce();
1414  }  }
1415    
1416    /**
1417     * Will be called by the parser to return general informations about this
1418     * sampler.
1419     */
1420    String LSCPServer::GetServerInfo() {
1421        dmsg(2,("LSCPServer: GetServerInfo()\n"));
1422        LSCPResultSet result;
1423        result.Add("DESCRIPTION", "LinuxSampler - modular, streaming capable sampler");
1424        result.Add("VERSION", VERSION);
1425        result.Add("PROTOCOL_VERSION", "1.0");
1426        return result.Produce();
1427    }
1428    
1429  /**  /**
1430   * Will be called by the parser to subscribe a client (frontend) on the   * Will be called by the parser to subscribe a client (frontend) on the
1431   * server for receiving event messages.   * server for receiving event messages.

Legend:
Removed from v.527  
changed lines
  Added in v.620

  ViewVC Help
Powered by ViewVC