/[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 1009 by schoenebeck, Thu Jan 4 14:43:02 2007 UTC revision 1026 by schoenebeck, Sun Jan 14 17:10:59 2007 UTC
# Line 1979  String LSCPServer::GetFxSendInfo(uint ui Line 1979  String LSCPServer::GetFxSendInfo(uint ui
1979    
1980          // success          // success
1981          result.Add("NAME", pFxSend->Name());          result.Add("NAME", pFxSend->Name());
1982            result.Add("MIDI_CONTROLLER", pFxSend->MidiController());
1983            result.Add("LEVEL", ToString(pFxSend->Level()));
1984          result.Add("AUDIO_OUTPUT_ROUTING", AudioRouting);          result.Add("AUDIO_OUTPUT_ROUTING", AudioRouting);
1985      } catch (Exception e) {      } catch (Exception e) {
1986          result.Error(e);          result.Error(e);
# Line 2009  String LSCPServer::SetFxSendAudioOutputC Line 2011  String LSCPServer::SetFxSendAudioOutputC
2011      } catch (Exception e) {      } catch (Exception e) {
2012          result.Error(e);          result.Error(e);
2013      }      }
2014        return result.Produce();
2015    }
2016    
2017    String LSCPServer::SetFxSendMidiController(uint uiSamplerChannel, uint FxSendID, uint MidiController) {
2018        dmsg(2,("LSCPServer: SetFxSendMidiController()\n"));
2019        LSCPResultSet result;
2020        try {
2021            SamplerChannel* pSamplerChannel = pSampler->GetSamplerChannel(uiSamplerChannel);
2022            if (!pSamplerChannel) throw Exception("Invalid sampler channel number " + ToString(uiSamplerChannel));
2023    
2024            EngineChannel* pEngineChannel = pSamplerChannel->GetEngineChannel();
2025            if (!pEngineChannel) throw Exception("There is no engine deployed on this sampler channel yet");
2026    
2027            FxSend* pFxSend = NULL;
2028            for (int i = 0; i < pEngineChannel->GetFxSendCount(); i++) {
2029                if (pEngineChannel->GetFxSend(i)->Id() == FxSendID) {
2030                    pFxSend = pEngineChannel->GetFxSend(i);
2031                    break;
2032                }
2033            }
2034            if (!pFxSend) throw Exception("There is no FxSend with that ID on the given sampler channel");
2035    
2036            pFxSend->SetMidiController(MidiController);
2037        } catch (Exception e) {
2038            result.Error(e);
2039        }
2040        return result.Produce();
2041    }
2042    
2043    String LSCPServer::SetFxSendLevel(uint uiSamplerChannel, uint FxSendID, double dLevel) {
2044        dmsg(2,("LSCPServer: SetFxSendLevel()\n"));
2045        LSCPResultSet result;
2046        try {
2047            SamplerChannel* pSamplerChannel = pSampler->GetSamplerChannel(uiSamplerChannel);
2048            if (!pSamplerChannel) throw Exception("Invalid sampler channel number " + ToString(uiSamplerChannel));
2049    
2050            EngineChannel* pEngineChannel = pSamplerChannel->GetEngineChannel();
2051            if (!pEngineChannel) throw Exception("There is no engine deployed on this sampler channel yet");
2052    
2053            FxSend* pFxSend = NULL;
2054            for (int i = 0; i < pEngineChannel->GetFxSendCount(); i++) {
2055                if (pEngineChannel->GetFxSend(i)->Id() == FxSendID) {
2056                    pFxSend = pEngineChannel->GetFxSend(i);
2057                    break;
2058                }
2059            }
2060            if (!pFxSend) throw Exception("There is no FxSend with that ID on the given sampler channel");
2061    
2062            pFxSend->SetLevel((float)dLevel);
2063        } catch (Exception e) {
2064            result.Error(e);
2065        }
2066      return result.Produce();      return result.Produce();
2067  }  }
2068    

Legend:
Removed from v.1009  
changed lines
  Added in v.1026

  ViewVC Help
Powered by ViewVC