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