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 |
/** |
/** |