/[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 64 by schoenebeck, Thu May 6 20:06:20 2004 UTC revision 79 by senkov, Sat May 22 06:33:55 2004 UTC
# Line 332  String LSCPServer::SetMIDIInputType(Midi Line 332  String LSCPServer::SetMIDIInputType(Midi
332   * Will be called by the parser to change the MIDI input port on which the   * Will be called by the parser to change the MIDI input port on which the
333   * engine of a particular sampler channel should listen to.   * engine of a particular sampler channel should listen to.
334   */   */
335  String LSCPServer::SetMIDIInputPort(String MIDIInputPort, uint uiSamplerchannel) {  String LSCPServer::SetMIDIInputPort(String MIDIInputPort, uint uiSamplerChannel) {
336      dmsg(2,("LSCPServer: SetMIDIInputPort(MIDIInputPort=%s, Samplerchannel=%d)\n", MIDIInputPort.c_str(), uiSamplerchannel));      dmsg(2,("LSCPServer: SetMIDIInputPort(MIDIInputPort=%s, Samplerchannel=%d)\n", MIDIInputPort.c_str(), uiSamplerChannel));
337      return "ERR:0:Not implemented yet.\r\n";      result_t result;
338        try {
339            SamplerChannel* pSamplerChannel = pSampler->GetSamplerChannel(uiSamplerChannel);
340            if (!pSamplerChannel) throw LinuxSamplerException("Index out of bounds");
341            if (!pSamplerChannel->GetMidiInputDevice()) throw LinuxSamplerException("No MIDI input device connected yet");
342            pSamplerChannel->GetMidiInputDevice()->SetInputPort(MIDIInputPort.c_str());
343            result.type = result_type_success;
344        }
345        catch (LinuxSamplerException e) {
346             e.PrintMessage();
347             result.type    = result_type_error;
348             result.code    = LSCP_ERR_UNKNOWN;
349             result.message = e.Message();
350        }
351        return ConvertResult(result);
352  }  }
353    
354  /**  /**
# Line 349  String LSCPServer::SetMIDIInputChannel(u Line 363  String LSCPServer::SetMIDIInputChannel(u
363          if (!pSamplerChannel) throw LinuxSamplerException("Index out of bounds");          if (!pSamplerChannel) throw LinuxSamplerException("Index out of bounds");
364          if (!pSamplerChannel->GetMidiInputDevice()) throw LinuxSamplerException("No MIDI input device connected yet");          if (!pSamplerChannel->GetMidiInputDevice()) throw LinuxSamplerException("No MIDI input device connected yet");
365          MidiInputDevice::type_t oldtype = pSamplerChannel->GetMidiInputDevice()->Type();          MidiInputDevice::type_t oldtype = pSamplerChannel->GetMidiInputDevice()->Type();
366          pSamplerChannel->SetMidiInputDevice(oldtype, (MidiInputDevice::midi_chan_t) uiSamplerChannel);          pSamplerChannel->SetMidiInputDevice(oldtype, (MidiInputDevice::midi_chan_t) MIDIChannel);
367    
368          result.type = result_type_success;          result.type = result_type_success;
369      }      }

Legend:
Removed from v.64  
changed lines
  Added in v.79

  ViewVC Help
Powered by ViewVC