/[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 64 by schoenebeck, Thu May 6 20:06:20 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 343  String LSCPServer::SetMIDIInputPort(Stri Line 343  String LSCPServer::SetMIDIInputPort(Stri
343   */   */
344  String LSCPServer::SetMIDIInputChannel(uint MIDIChannel, uint uiSamplerChannel) {  String LSCPServer::SetMIDIInputChannel(uint MIDIChannel, uint uiSamplerChannel) {
345      dmsg(2,("LSCPServer: SetMIDIInputChannel(MIDIChannel=%d, SamplerChannel=%d)\n", MIDIChannel, uiSamplerChannel));      dmsg(2,("LSCPServer: SetMIDIInputChannel(MIDIChannel=%d, SamplerChannel=%d)\n", MIDIChannel, uiSamplerChannel));
346      return "ERR:0:Not implemented yet.\r\n";      result_t result;
347        try {
348            SamplerChannel* pSamplerChannel = pSampler->GetSamplerChannel(uiSamplerChannel);
349            if (!pSamplerChannel) throw LinuxSamplerException("Index out of bounds");
350            if (!pSamplerChannel->GetMidiInputDevice()) throw LinuxSamplerException("No MIDI input device connected yet");
351            MidiInputDevice::type_t oldtype = pSamplerChannel->GetMidiInputDevice()->Type();
352            pSamplerChannel->SetMidiInputDevice(oldtype, (MidiInputDevice::midi_chan_t) uiSamplerChannel);
353    
354            result.type = result_type_success;
355        }
356        catch (LinuxSamplerException e) {
357             e.PrintMessage();
358             result.type    = result_type_error;
359             result.code    = LSCP_ERR_UNKNOWN;
360             result.message = e.Message();
361        }
362        return ConvertResult(result);
363  }  }
364    
365  /**  /**

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

  ViewVC Help
Powered by ViewVC