--- linuxsampler/trunk/src/network/lscpserver.cpp 2007/01/04 14:43:02 1009 +++ linuxsampler/trunk/src/network/lscpserver.cpp 2007/01/14 17:10:59 1026 @@ -1979,6 +1979,8 @@ // success result.Add("NAME", pFxSend->Name()); + result.Add("MIDI_CONTROLLER", pFxSend->MidiController()); + result.Add("LEVEL", ToString(pFxSend->Level())); result.Add("AUDIO_OUTPUT_ROUTING", AudioRouting); } catch (Exception e) { result.Error(e); @@ -2009,6 +2011,58 @@ } catch (Exception e) { result.Error(e); } + return result.Produce(); +} + +String LSCPServer::SetFxSendMidiController(uint uiSamplerChannel, uint FxSendID, uint MidiController) { + dmsg(2,("LSCPServer: SetFxSendMidiController()\n")); + LSCPResultSet result; + try { + SamplerChannel* pSamplerChannel = pSampler->GetSamplerChannel(uiSamplerChannel); + if (!pSamplerChannel) throw Exception("Invalid sampler channel number " + ToString(uiSamplerChannel)); + + EngineChannel* pEngineChannel = pSamplerChannel->GetEngineChannel(); + if (!pEngineChannel) throw Exception("There is no engine deployed on this sampler channel yet"); + + FxSend* pFxSend = NULL; + for (int i = 0; i < pEngineChannel->GetFxSendCount(); i++) { + if (pEngineChannel->GetFxSend(i)->Id() == FxSendID) { + pFxSend = pEngineChannel->GetFxSend(i); + break; + } + } + if (!pFxSend) throw Exception("There is no FxSend with that ID on the given sampler channel"); + + pFxSend->SetMidiController(MidiController); + } catch (Exception e) { + result.Error(e); + } + return result.Produce(); +} + +String LSCPServer::SetFxSendLevel(uint uiSamplerChannel, uint FxSendID, double dLevel) { + dmsg(2,("LSCPServer: SetFxSendLevel()\n")); + LSCPResultSet result; + try { + SamplerChannel* pSamplerChannel = pSampler->GetSamplerChannel(uiSamplerChannel); + if (!pSamplerChannel) throw Exception("Invalid sampler channel number " + ToString(uiSamplerChannel)); + + EngineChannel* pEngineChannel = pSamplerChannel->GetEngineChannel(); + if (!pEngineChannel) throw Exception("There is no engine deployed on this sampler channel yet"); + + FxSend* pFxSend = NULL; + for (int i = 0; i < pEngineChannel->GetFxSendCount(); i++) { + if (pEngineChannel->GetFxSend(i)->Id() == FxSendID) { + pFxSend = pEngineChannel->GetFxSend(i); + break; + } + } + if (!pFxSend) throw Exception("There is no FxSend with that ID on the given sampler channel"); + + pFxSend->SetLevel((float)dLevel); + } catch (Exception e) { + result.Error(e); + } return result.Produce(); }