/[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 137 by capela, Sun Jun 20 16:49:47 2004 UTC revision 142 by senkov, Tue Jun 22 00:02:17 2004 UTC
# Line 420  String LSCPServer::GetAudioOutputDeviceC Line 420  String LSCPServer::GetAudioOutputDeviceC
420      LSCPResultSet result;      LSCPResultSet result;
421      try {      try {
422          uint count = pSampler->AudioOutputDevices();          uint count = pSampler->AudioOutputDevices();
423          result = count; // success          result.Add(count); // success
424      }      }
425      catch (LinuxSamplerException e) {      catch (LinuxSamplerException e) {
426          result.Error(e);          result.Error(e);
# Line 634  String LSCPServer::SetMIDIInputChannel(u Line 634  String LSCPServer::SetMIDIInputChannel(u
634      return result.Produce();      return result.Produce();
635  }  }
636    
637  String LSCPServer::SetAudioOutputDevice(uint AudioDeviceId, uint SamplerChannel) {  String LSCPServer::SetAudioOutputDevice(uint AudioDeviceId, uint uiSamplerChannel) {
638      LSCPResultSet result;      LSCPResultSet result;
639      try {      try {
640          throw LinuxSamplerException("Command not yet implemented");          SamplerChannel* pSamplerChannel = pSampler->GetSamplerChannel(uiSamplerChannel);
641            if (!pSamplerChannel) throw LinuxSamplerException("Invalid channel number " + ToString(uiSamplerChannel));
642            Engine* pEngine = pSamplerChannel->GetEngine();
643            if (!pEngine) throw LinuxSamplerException("No engine loaded on channel");
644            std::map<uint, AudioOutputDevice*> devices = pSampler->GetAudioOutputDevices();
645            if (!devices[AudioDeviceId]) throw LinuxSamplerException("There is no audio output device with index " + ToString(AudioDeviceId));
646            AudioOutputDevice* pDevice = devices[AudioDeviceId];
647            pSamplerChannel->SetAudioOutputDevice(pDevice);
648      }      }
649      catch (LinuxSamplerException e) {      catch (LinuxSamplerException e) {
650           result.Error(e);           result.Error(e);

Legend:
Removed from v.137  
changed lines
  Added in v.142

  ViewVC Help
Powered by ViewVC