897 |
return result.Produce(); |
return result.Produce(); |
898 |
} |
} |
899 |
|
|
900 |
|
String LSCPServer::GetMidiInputPortParameterInfo(uint DeviceId, uint PortId, String ParameterName) { |
901 |
|
dmsg(2,("LSCPServer: GetMidiInputPortParameterInfo(DeviceId=%d,PortId=%d,ParameterName=%s)\n",DeviceId,PortId,ParameterName.c_str())); |
902 |
|
LSCPResultSet result; |
903 |
|
try { |
904 |
|
// get audio output device |
905 |
|
std::map<uint,MidiInputDevice*> devices = pSampler->GetMidiInputDevices(); |
906 |
|
if (!devices[DeviceId]) throw LinuxSamplerException("There is no midi input device with index " + ToString(DeviceId) + "."); |
907 |
|
MidiInputDevice* pDevice = devices[DeviceId]; |
908 |
|
|
909 |
|
// get midi port |
910 |
|
MidiInputDevice::MidiInputPort* pPort = pDevice->GetPort(PortId); |
911 |
|
if (!pPort) throw LinuxSamplerException("Midi input device does not have port " + ToString(PortId) + "."); |
912 |
|
|
913 |
|
// get desired port parameter |
914 |
|
std::map<String,DeviceCreationParameter*> parameters = pPort->DeviceParameters(); |
915 |
|
if (!parameters[ParameterName]) throw LinuxSamplerException("Midi port does not provice a parameters '" + ParameterName + "'."); |
916 |
|
DeviceCreationParameter* pParameter = parameters[ParameterName]; |
917 |
|
|
918 |
|
// return all fields of this audio channel parameter |
919 |
|
result.Add("TYPE", pParameter->Type()); |
920 |
|
result.Add("DESCRIPTION", pParameter->Description()); |
921 |
|
result.Add("FIX", pParameter->Fix()); |
922 |
|
result.Add("MULTIPLICITY", pParameter->Multiplicity()); |
923 |
|
if (pParameter->RangeMin()) result.Add("RANGE_MIN", pParameter->RangeMin()); |
924 |
|
if (pParameter->RangeMax()) result.Add("RANGE_MAX", pParameter->RangeMax()); |
925 |
|
if (pParameter->Possibilities()) result.Add("POSSIBILITIES", pParameter->Possibilities()); |
926 |
|
} |
927 |
|
catch (LinuxSamplerException e) { |
928 |
|
result.Error(e); |
929 |
|
} |
930 |
|
return result.Produce(); |
931 |
|
} |
932 |
|
|
933 |
String LSCPServer::GetAudioOutputChannelParameterInfo(uint DeviceId, uint ChannelId, String ParameterName) { |
String LSCPServer::GetAudioOutputChannelParameterInfo(uint DeviceId, uint ChannelId, String ParameterName) { |
934 |
dmsg(2,("LSCPServer: GetAudioOutputChannelParameterInfo(DeviceId=%d,ChannelId=%d,ParameterName=%s)\n",DeviceId,ChannelId,ParameterName.c_str())); |
dmsg(2,("LSCPServer: GetAudioOutputChannelParameterInfo(DeviceId=%d,ChannelId=%d,ParameterName=%s)\n",DeviceId,ChannelId,ParameterName.c_str())); |
935 |
LSCPResultSet result; |
LSCPResultSet result; |