/[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 56 by schoenebeck, Tue Apr 27 09:21:58 2004 UTC revision 68 by senkov, Sat May 8 19:03:17 2004 UTC
# Line 118  String LSCPServer::LoadEngine(String Eng Line 118  String LSCPServer::LoadEngine(String Eng
118      dmsg(2,("LSCPServer: LoadEngine(EngineName=%s,SamplerChannel=%d)\n", EngineName.c_str(), uiSamplerChannel));      dmsg(2,("LSCPServer: LoadEngine(EngineName=%s,SamplerChannel=%d)\n", EngineName.c_str(), uiSamplerChannel));
119      result_t result;      result_t result;
120      try {      try {
121          engine_type_t type;          Engine::type_t type;
122          if (EngineName == "gig") type = engine_type_gig;          if (EngineName == "gig") type = Engine::type_gig;
123          else throw LinuxSamplerException("Unknown engine type");          else throw LinuxSamplerException("Unknown engine type");
124          SamplerChannel* pSamplerChannel = pSampler->GetSamplerChannel(uiSamplerChannel);          SamplerChannel* pSamplerChannel = pSampler->GetSamplerChannel(uiSamplerChannel);
125          if (!pSamplerChannel) throw LinuxSamplerException("Index out of bounds");          if (!pSamplerChannel) throw LinuxSamplerException("Index out of bounds");
# Line 283  String LSCPServer::GetBufferFill(fill_re Line 283  String LSCPServer::GetBufferFill(fill_re
283   * Will be called by the parser to change the audio output type on a   * Will be called by the parser to change the audio output type on a
284   * particular sampler channel.   * particular sampler channel.
285   */   */
286  String LSCPServer::SetAudioOutputType(audio_output_type_t AudioOutputType, uint uiSamplerChannel) {  String LSCPServer::SetAudioOutputType(AudioOutputDevice::type_t AudioOutputType, uint uiSamplerChannel) {
287      dmsg(2,("LSCPServer: SetAudioOutputType(AudioOutputType=%d, SamplerChannel=%d)\n", AudioOutputType, uiSamplerChannel));      dmsg(2,("LSCPServer: SetAudioOutputType(AudioOutputType=%d, SamplerChannel=%d)\n", AudioOutputType, uiSamplerChannel));
288      result_t result;      result_t result;
289      try {      try {
# Line 310  String LSCPServer::SetAudioOutputChannel Line 310  String LSCPServer::SetAudioOutputChannel
310      return "ERR:0:Not implemented yet.\r\n";      return "ERR:0:Not implemented yet.\r\n";
311  }  }
312    
313  String LSCPServer::SetMIDIInputType(midi_input_type_t MidiInputType, uint uiSamplerChannel) {  String LSCPServer::SetMIDIInputType(MidiInputDevice::type_t MidiInputType, uint uiSamplerChannel) {
314      dmsg(2,("LSCPServer: SetMIDIInputType(MidiInputType=%d, SamplerChannel=%d)\n", MidiInputType, uiSamplerChannel));      dmsg(2,("LSCPServer: SetMIDIInputType(MidiInputType=%d, SamplerChannel=%d)\n", MidiInputType, uiSamplerChannel));
315      result_t result;      result_t result;
316      try {      try {
# 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 343  String LSCPServer::SetMIDIInputPort(Stri Line 357  String LSCPServer::SetMIDIInputPort(Stri
357   */   */
358  String LSCPServer::SetMIDIInputChannel(uint MIDIChannel, uint uiSamplerChannel) {  String LSCPServer::SetMIDIInputChannel(uint MIDIChannel, uint uiSamplerChannel) {
359      dmsg(2,("LSCPServer: SetMIDIInputChannel(MIDIChannel=%d, SamplerChannel=%d)\n", MIDIChannel, uiSamplerChannel));      dmsg(2,("LSCPServer: SetMIDIInputChannel(MIDIChannel=%d, SamplerChannel=%d)\n", MIDIChannel, uiSamplerChannel));
360      return "ERR:0:Not implemented yet.\r\n";      result_t result;
361        try {
362            SamplerChannel* pSamplerChannel = pSampler->GetSamplerChannel(uiSamplerChannel);
363            if (!pSamplerChannel) throw LinuxSamplerException("Index out of bounds");
364            if (!pSamplerChannel->GetMidiInputDevice()) throw LinuxSamplerException("No MIDI input device connected yet");
365            MidiInputDevice::type_t oldtype = pSamplerChannel->GetMidiInputDevice()->Type();
366            pSamplerChannel->SetMidiInputDevice(oldtype, (MidiInputDevice::midi_chan_t) uiSamplerChannel);
367    
368            result.type = result_type_success;
369        }
370        catch (LinuxSamplerException e) {
371             e.PrintMessage();
372             result.type    = result_type_error;
373             result.code    = LSCP_ERR_UNKNOWN;
374             result.message = e.Message();
375        }
376        return ConvertResult(result);
377  }  }
378    
379  /**  /**

Legend:
Removed from v.56  
changed lines
  Added in v.68

  ViewVC Help
Powered by ViewVC