--- liblscp/trunk/src/client.c 2007/01/11 15:25:04 1020 +++ liblscp/trunk/src/client.c 2007/01/15 11:08:28 1031 @@ -2035,6 +2035,11 @@ pFxSendInfo->audio_routing = lscp_isplit_create(pszToken, ","); } } + else if (strcasecmp(pszToken, "LEVEL") == 0) { + pszToken = lscp_strtok(NULL, pszCrlf, &(pch)); + if (pszToken) + pFxSendInfo->level = (float) atof(lscp_ltrim(pszToken)); + } pszToken = lscp_strtok(NULL, pszSeps, &(pch)); } } @@ -2071,6 +2076,53 @@ return lscp_client_query(pClient, szQuery); } + +/** + * Alter effect send's MIDI controller: + * SET FX_SEND MIDI_CONTROLLER + * + * @param pClient Pointer to client instance structure. + * @param iSamplerChannel Sampler channel number. + * @param iFxSend Effect send number. + * @param iMidiController MIDI controller used to alter the effect, + * usually a number between 0 and 127. + * + * @returns LSCP_OK on success, LSCP_FAILED otherwise. + */ +lscp_status_t lscp_set_fxsend_midi_controller ( lscp_client_t *pClient, int iSamplerChannel, int iFxSend, int iMidiController ) +{ + char szQuery[LSCP_BUFSIZ]; + + if (iSamplerChannel < 0 || iFxSend < 0 || iMidiController < 0 || iMidiController > 127) + return LSCP_FAILED; + + sprintf(szQuery, "SET FX_SEND MIDI_CONTROLLER %d %d %d %d\r\n", iSamplerChannel, iFxSend, iMidiController); + return lscp_client_query(pClient, szQuery); +} + + +/** + * Alter effect send's audio level: + * SET FX_SEND LEVEL + * + * @param pClient Pointer to client instance structure. + * @param iSamplerChannel Sampler channel number. + * @param iFxSend Effect send number. + * @param fLevel Effect send volume level. + * + * @returns LSCP_OK on success, LSCP_FAILED otherwise. + */ +lscp_status_t lscp_set_fxsend_level ( lscp_client_t *pClient, int iSamplerChannel, int iFxSend, float fLevel ) +{ + char szQuery[LSCP_BUFSIZ]; + + if (iSamplerChannel < 0 || iFxSend < 0 || fLevel < 0.0f) + return LSCP_FAILED; + + sprintf(szQuery, "SET FX_SEND LEVEL %d %d %d %g\r\n", iSamplerChannel, iFxSend, fLevel); + return lscp_client_query(pClient, szQuery); +} + /** * Create a new MIDI instrument map: