2158 |
return result.Produce(); |
return result.Produce(); |
2159 |
} |
} |
2160 |
|
|
2161 |
|
String LSCPServer::EditSamplerChannelInstrument(uint uiSamplerChannel) { |
2162 |
|
dmsg(2,("LSCPServer: EditSamplerChannelInstrument(SamplerChannel=%d)\n", uiSamplerChannel)); |
2163 |
|
LSCPResultSet result; |
2164 |
|
try { |
2165 |
|
SamplerChannel* pSamplerChannel = pSampler->GetSamplerChannel(uiSamplerChannel); |
2166 |
|
if (!pSamplerChannel) throw Exception("Invalid sampler channel number " + ToString(uiSamplerChannel)); |
2167 |
|
EngineChannel* pEngineChannel = pSamplerChannel->GetEngineChannel(); |
2168 |
|
if (!pEngineChannel) throw Exception("No engine type assigned to sampler channel"); |
2169 |
|
Engine* pEngine = pEngineChannel->GetEngine(); |
2170 |
|
InstrumentManager* pInstrumentManager = pEngine->GetInstrumentManager(); |
2171 |
|
if (!pInstrumentManager) throw Exception("Engine does not provide an instrument manager"); |
2172 |
|
InstrumentManager::instrument_id_t instrumentID; |
2173 |
|
instrumentID.FileName = pEngineChannel->InstrumentFileName(); |
2174 |
|
instrumentID.Index = pEngineChannel->InstrumentIndex(); |
2175 |
|
pInstrumentManager->LaunchInstrumentEditor(instrumentID); |
2176 |
|
} catch (Exception e) { |
2177 |
|
result.Error(e); |
2178 |
|
} |
2179 |
|
return result.Produce(); |
2180 |
|
} |
2181 |
|
|
2182 |
/** |
/** |
2183 |
* Will be called by the parser to reset a particular sampler channel. |
* Will be called by the parser to reset a particular sampler channel. |
2184 |
*/ |
*/ |