/[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 79 by senkov, Sat May 22 06:33:55 2004 UTC revision 113 by senkov, Sun Jun 6 20:59:49 2004 UTC
# Line 21  Line 21 
21   ***************************************************************************/   ***************************************************************************/
22    
23  #include "lscpserver.h"  #include "lscpserver.h"
24    #include "lscpresultset.h"
25    
26  #include "../engines/gig/Engine.h"  #include "../engines/gig/Engine.h"
27    
# Line 199  String LSCPServer::GetEngineInfo(String Line 200  String LSCPServer::GetEngineInfo(String
200   */   */
201  String LSCPServer::GetChannelInfo(uint uiSamplerChannel) {  String LSCPServer::GetChannelInfo(uint uiSamplerChannel) {
202      dmsg(2,("LSCPServer: GetChannelInfo(SamplerChannel=%d)\n", uiSamplerChannel));      dmsg(2,("LSCPServer: GetChannelInfo(SamplerChannel=%d)\n", uiSamplerChannel));
203      return "ERR:0:Not implemented yet.\r\n";      try {
204            LSCPResultSet result;
205            SamplerChannel* pSamplerChannel = pSampler->GetSamplerChannel(uiSamplerChannel);
206            if (!pSamplerChannel) throw LinuxSamplerException("Index out of bounds");
207            Engine* pEngine = pSamplerChannel->GetEngine();
208            if (pEngine) {
209                result.Add("ENGINE_NAME", pEngine->EngineName());
210                result.Add("VOLUME", pEngine->Volume());
211            }
212            //Some hardcoded stuff for now to make GUI look good
213            result.Add("AUDIO_OUTPUT_DEVICE", "0");
214            result.Add("AUDIO_OUTPUT_CHANNELS", "2");
215            result.Add("AUDIO_OUTPUT_ROUTING", "0,1");
216    
217            if (pEngine) {
218                int iIdx = pEngine->InstrumentIndex();
219                if (iIdx != -1) {
220                    result.Add("INSTRUMENT_FILE", pEngine->InstrumentFileName());
221                    result.Add("INSTRUMENT_NR", iIdx);
222                }
223            }
224            //Some hardcoded stuff for now to make GUI look good
225            result.Add("MIDI_INPUT_DEVICE", "0");
226            result.Add("MIDI_INPUT_PORT", "0");
227            result.Add("MIDI_INPUT_CHANNEL", "1");
228    
229            return result.Produce();
230        }
231        catch (LinuxSamplerException e) {
232             result_t result;
233             e.PrintMessage();
234             result.type    = result_type_error;
235             result.code    = LSCP_ERR_UNKNOWN;
236             result.message = e.Message();
237             return ConvertResult(result);
238        }
239  }  }
240    
241  /**  /**

Legend:
Removed from v.79  
changed lines
  Added in v.113

  ViewVC Help
Powered by ViewVC