1006 |
} |
} |
1007 |
else if (strcasecmp(pszToken, "MIDI_INPUT_CHANNEL") == 0) { |
else if (strcasecmp(pszToken, "MIDI_INPUT_CHANNEL") == 0) { |
1008 |
pszToken = lscp_strtok(NULL, pszCrlf, &(pch)); |
pszToken = lscp_strtok(NULL, pszCrlf, &(pch)); |
1009 |
if (pszToken) |
if (pszToken) { |
1010 |
pChannelInfo->midi_channel = atoi(lscp_ltrim(pszToken)); |
pszToken = lscp_ltrim(pszToken); |
1011 |
|
if (strcasecmp(pszToken, "ALL") == 0) |
1012 |
|
pChannelInfo->midi_channel = LSCP_MIDI_CHANNEL_ALL; |
1013 |
|
else |
1014 |
|
pChannelInfo->midi_channel = atoi(pszToken); |
1015 |
|
} |
1016 |
} |
} |
1017 |
else if (strcasecmp(pszToken, "VOLUME") == 0) { |
else if (strcasecmp(pszToken, "VOLUME") == 0) { |
1018 |
pszToken = lscp_strtok(NULL, pszCrlf, &(pch)); |
pszToken = lscp_strtok(NULL, pszCrlf, &(pch)); |
1357 |
* |
* |
1358 |
* @param pClient Pointer to client instance structure. |
* @param pClient Pointer to client instance structure. |
1359 |
* @param iSamplerChannel Sampler channel number. |
* @param iSamplerChannel Sampler channel number. |
1360 |
* @param iMidiChannel MIDI channel number to listen (1-16) or |
* @param iMidiChannel MIDI channel address number to listen (0-15) or |
1361 |
* LSCP_MIDI_CHANNEL_ALL (0) to listen on all channels. |
* LSCP_MIDI_CHANNEL_ALL (16) to listen on all channels. |
1362 |
* |
* |
1363 |
* @returns LSCP_OK on success, LSCP_FAILED otherwise. |
* @returns LSCP_OK on success, LSCP_FAILED otherwise. |
1364 |
*/ |
*/ |
1369 |
if (iSamplerChannel < 0 || iMidiChannel < 0 || iMidiChannel > 16) |
if (iSamplerChannel < 0 || iMidiChannel < 0 || iMidiChannel > 16) |
1370 |
return LSCP_FAILED; |
return LSCP_FAILED; |
1371 |
|
|
1372 |
if (iMidiChannel > 0) |
if (iMidiChannel == LSCP_MIDI_CHANNEL_ALL) |
|
sprintf(szQuery, "SET CHANNEL MIDI_INPUT_CHANNEL %d %d\r\n", iSamplerChannel, iMidiChannel); |
|
|
else |
|
1373 |
sprintf(szQuery, "SET CHANNEL MIDI_INPUT_CHANNEL %d ALL\r\n", iSamplerChannel); |
sprintf(szQuery, "SET CHANNEL MIDI_INPUT_CHANNEL %d ALL\r\n", iSamplerChannel); |
1374 |
|
else |
1375 |
|
sprintf(szQuery, "SET CHANNEL MIDI_INPUT_CHANNEL %d %d\r\n", iSamplerChannel, iMidiChannel); |
1376 |
return lscp_client_query(pClient, szQuery); |
return lscp_client_query(pClient, szQuery); |
1377 |
} |
} |
1378 |
|
|