641 |
} |
} |
642 |
|
|
643 |
|
|
644 |
|
/** |
645 |
|
* Getting current subscribed events. |
646 |
|
* |
647 |
|
* @param pClient Pointer to client instance structure. |
648 |
|
* |
649 |
|
* @returns The current subscrived bit-wise OR'ed event flags. |
650 |
|
*/ |
651 |
|
lscp_event_t lscp_client_get_events ( lscp_client_t *pClient ) |
652 |
|
{ |
653 |
|
if (pClient == NULL) |
654 |
|
return LSCP_EVENT_NONE; |
655 |
|
|
656 |
|
return pClient->events; |
657 |
|
} |
658 |
|
|
659 |
|
|
660 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
661 |
// Client command protocol functions. |
// Client command protocol functions. |
662 |
|
|
903 |
if (strcasecmp(pszToken, "DESCRIPTION") == 0) { |
if (strcasecmp(pszToken, "DESCRIPTION") == 0) { |
904 |
pszToken = lscp_strtok(NULL, pszCrlf, &(pch)); |
pszToken = lscp_strtok(NULL, pszCrlf, &(pch)); |
905 |
if (pszToken) |
if (pszToken) |
906 |
pEngineInfo->description = lscp_unquote(&pszToken, 1); |
lscp_unquote_dup(&(pEngineInfo->description), &pszToken); |
907 |
} |
} |
908 |
else if (strcasecmp(pszToken, "VERSION") == 0) { |
else if (strcasecmp(pszToken, "VERSION") == 0) { |
909 |
pszToken = lscp_strtok(NULL, pszCrlf, &(pch)); |
pszToken = lscp_strtok(NULL, pszCrlf, &(pch)); |
910 |
if (pszToken) |
if (pszToken) |
911 |
pEngineInfo->version = lscp_unquote(&pszToken, 1); |
lscp_unquote_dup(&(pEngineInfo->version), &pszToken); |
912 |
} |
} |
913 |
pszToken = lscp_strtok(NULL, pszSeps, &(pch)); |
pszToken = lscp_strtok(NULL, pszSeps, &(pch)); |
914 |
} |
} |
959 |
if (strcasecmp(pszToken, "ENGINE_NAME") == 0) { |
if (strcasecmp(pszToken, "ENGINE_NAME") == 0) { |
960 |
pszToken = lscp_strtok(NULL, pszCrlf, &(pch)); |
pszToken = lscp_strtok(NULL, pszCrlf, &(pch)); |
961 |
if (pszToken) |
if (pszToken) |
962 |
pChannelInfo->engine_name = lscp_unquote(&pszToken, 1); |
lscp_unquote_dup(&(pChannelInfo->engine_name), &pszToken); |
963 |
} |
} |
964 |
else if (strcasecmp(pszToken, "AUDIO_OUTPUT_DEVICE") == 0) { |
else if (strcasecmp(pszToken, "AUDIO_OUTPUT_DEVICE") == 0) { |
965 |
pszToken = lscp_strtok(NULL, pszCrlf, &(pch)); |
pszToken = lscp_strtok(NULL, pszCrlf, &(pch)); |
973 |
} |
} |
974 |
else if (strcasecmp(pszToken, "AUDIO_OUTPUT_ROUTING") == 0) { |
else if (strcasecmp(pszToken, "AUDIO_OUTPUT_ROUTING") == 0) { |
975 |
pszToken = lscp_strtok(NULL, pszCrlf, &(pch)); |
pszToken = lscp_strtok(NULL, pszCrlf, &(pch)); |
976 |
if (pszToken) |
if (pszToken) { |
977 |
|
if (pChannelInfo->audio_routing) |
978 |
|
lscp_szsplit_destroy(pChannelInfo->audio_routing); |
979 |
pChannelInfo->audio_routing = lscp_szsplit_create(pszToken, ","); |
pChannelInfo->audio_routing = lscp_szsplit_create(pszToken, ","); |
980 |
|
} |
981 |
} |
} |
982 |
else if (strcasecmp(pszToken, "INSTRUMENT_FILE") == 0) { |
else if (strcasecmp(pszToken, "INSTRUMENT_FILE") == 0) { |
983 |
pszToken = lscp_strtok(NULL, pszCrlf, &(pch)); |
pszToken = lscp_strtok(NULL, pszCrlf, &(pch)); |
984 |
if (pszToken) |
if (pszToken) |
985 |
pChannelInfo->instrument_file = lscp_unquote(&pszToken, 1); |
lscp_unquote_dup(&(pChannelInfo->instrument_file), &pszToken); |
986 |
} |
} |
987 |
else if (strcasecmp(pszToken, "INSTRUMENT_NR") == 0) { |
else if (strcasecmp(pszToken, "INSTRUMENT_NR") == 0) { |
988 |
pszToken = lscp_strtok(NULL, pszCrlf, &(pch)); |
pszToken = lscp_strtok(NULL, pszCrlf, &(pch)); |
1277 |
if (iSamplerChannel < 0 || iAudioOut < 0 || iAudioIn < 0) |
if (iSamplerChannel < 0 || iAudioOut < 0 || iAudioIn < 0) |
1278 |
return LSCP_FAILED; |
return LSCP_FAILED; |
1279 |
|
|
1280 |
sprintf(szQuery, "SET CHANNEL AUDIO_OUTPUT_CHANNELS %d %d %d\r\n", iSamplerChannel, iAudioOut, iAudioIn); |
sprintf(szQuery, "SET CHANNEL AUDIO_OUTPUT_CHANNEL %d %d %d\r\n", iSamplerChannel, iAudioOut, iAudioIn); |
1281 |
return lscp_client_query(pClient, szQuery); |
return lscp_client_query(pClient, szQuery); |
1282 |
} |
} |
1283 |
|
|
1352 |
* |
* |
1353 |
* @param pClient Pointer to client instance structure. |
* @param pClient Pointer to client instance structure. |
1354 |
* @param iSamplerChannel Sampler channel number. |
* @param iSamplerChannel Sampler channel number. |
1355 |
* @param iMidiChannel MIDI channel number to listen (1-16) or |
* @param iMidiChannel MIDI channel address number to listen (0-15) or |
1356 |
* zero (0) to listen on all channels. |
* LSCP_MIDI_CHANNEL_ALL (16) to listen on all channels. |
1357 |
* |
* |
1358 |
* @returns LSCP_OK on success, LSCP_FAILED otherwise. |
* @returns LSCP_OK on success, LSCP_FAILED otherwise. |
1359 |
*/ |
*/ |
1364 |
if (iSamplerChannel < 0 || iMidiChannel < 0 || iMidiChannel > 16) |
if (iSamplerChannel < 0 || iMidiChannel < 0 || iMidiChannel > 16) |
1365 |
return LSCP_FAILED; |
return LSCP_FAILED; |
1366 |
|
|
1367 |
if (iMidiChannel > 0) |
if (iMidiChannel == LSCP_MIDI_CHANNEL_ALL) |
|
sprintf(szQuery, "SET CHANNEL MIDI_INPUT_CHANNEL %d %d\r\n", iSamplerChannel, iMidiChannel); |
|
|
else |
|
1368 |
sprintf(szQuery, "SET CHANNEL MIDI_INPUT_CHANNEL %d ALL\r\n", iSamplerChannel); |
sprintf(szQuery, "SET CHANNEL MIDI_INPUT_CHANNEL %d ALL\r\n", iSamplerChannel); |
1369 |
|
else |
1370 |
|
sprintf(szQuery, "SET CHANNEL MIDI_INPUT_CHANNEL %d %d\r\n", iSamplerChannel, iMidiChannel); |
1371 |
return lscp_client_query(pClient, szQuery); |
return lscp_client_query(pClient, szQuery); |
1372 |
} |
} |
1373 |
|
|
1417 |
} |
} |
1418 |
|
|
1419 |
|
|
1420 |
|
/** |
1421 |
|
* Resetting the sampler: |
1422 |
|
* RESET |
1423 |
|
* |
1424 |
|
* @param pClient Pointer to client instance structure. |
1425 |
|
* |
1426 |
|
* @returns LSCP_OK on success, LSCP_FAILED otherwise. |
1427 |
|
*/ |
1428 |
|
lscp_status_t lscp_reset_sampler ( lscp_client_t *pClient ) |
1429 |
|
{ |
1430 |
|
return lscp_client_query(pClient, "RESET\r\n"); |
1431 |
|
} |
1432 |
|
|
1433 |
|
|
1434 |
// end of client.c |
// end of client.c |