2 |
// |
// |
3 |
/**************************************************************************** |
/**************************************************************************** |
4 |
liblscp - LinuxSampler Control Protocol API |
liblscp - LinuxSampler Control Protocol API |
5 |
Copyright (C) 2004, rncbc aka Rui Nuno Capela. All rights reserved. |
Copyright (C) 2004-2005, rncbc aka Rui Nuno Capela. All rights reserved. |
6 |
|
|
7 |
This library is free software; you can redistribute it and/or |
This library is free software; you can redistribute it and/or |
8 |
modify it under the terms of the GNU Lesser General Public |
modify it under the terms of the GNU Lesser General Public |
73 |
pszToken = lscp_strtok(NULL, pszSeps, &(pch)); |
pszToken = lscp_strtok(NULL, pszSeps, &(pch)); |
74 |
} |
} |
75 |
} |
} |
76 |
|
else pDriverInfo = NULL; |
77 |
|
|
78 |
// Unlock this section down. |
// Unlock this section down. |
79 |
lscp_mutex_unlock(pClient->mutex); |
lscp_mutex_unlock(pClient->mutex); |
114 |
pszToken = lscp_strtok(NULL, pszSeps, &(pch)); |
pszToken = lscp_strtok(NULL, pszSeps, &(pch)); |
115 |
} |
} |
116 |
} |
} |
117 |
|
else pDeviceInfo = NULL; |
118 |
|
|
119 |
// Unlock this section down. |
// Unlock this section down. |
120 |
lscp_mutex_unlock(pClient->mutex); |
lscp_mutex_unlock(pClient->mutex); |
155 |
pszToken = lscp_strtok(NULL, pszSeps, &(pch)); |
pszToken = lscp_strtok(NULL, pszSeps, &(pch)); |
156 |
} |
} |
157 |
} |
} |
158 |
|
else pDevicePortInfo = NULL; |
159 |
|
|
160 |
// Unlock this section down. |
// Unlock this section down. |
161 |
lscp_mutex_unlock(pClient->mutex); |
lscp_mutex_unlock(pClient->mutex); |
250 |
pszToken = lscp_strtok(NULL, pszSeps, &(pch)); |
pszToken = lscp_strtok(NULL, pszSeps, &(pch)); |
251 |
} |
} |
252 |
} |
} |
253 |
|
else pParamInfo = NULL; |
254 |
|
|
255 |
// Unlock this section down. |
// Unlock this section down. |
256 |
lscp_mutex_unlock(pClient->mutex); |
lscp_mutex_unlock(pClient->mutex); |
511 |
if (pParam == NULL) |
if (pParam == NULL) |
512 |
return LSCP_FAILED; |
return LSCP_FAILED; |
513 |
|
|
514 |
sprintf(szQuery, "SET AUDIO_OUTPUT_DEVICE_PARAMETER %d", iAudioDevice); |
sprintf(szQuery, "SET AUDIO_OUTPUT_DEVICE_PARAMETER %d %s='%s'", iAudioDevice, pParam->key, pParam->value); |
|
lscp_param_concat(szQuery, sizeof(szQuery), pParam); |
|
515 |
return lscp_client_query(pClient, szQuery); |
return lscp_client_query(pClient, szQuery); |
516 |
} |
} |
517 |
|
|
597 |
if (pParam == NULL) |
if (pParam == NULL) |
598 |
return LSCP_FAILED; |
return LSCP_FAILED; |
599 |
|
|
600 |
sprintf(szQuery, "SET AUDIO_OUTPUT_CHANNEL_PARAMETER %d %d", iAudioDevice, iAudioChannel); |
sprintf(szQuery, "SET AUDIO_OUTPUT_CHANNEL_PARAMETER %d %d %s='%s'", iAudioDevice, iAudioChannel, pParam->key, pParam->value); |
|
lscp_param_concat(szQuery, sizeof(szQuery), pParam); |
|
601 |
return lscp_client_query(pClient, szQuery); |
return lscp_client_query(pClient, szQuery); |
602 |
} |
} |
603 |
|
|
856 |
if (pParam == NULL) |
if (pParam == NULL) |
857 |
return LSCP_FAILED; |
return LSCP_FAILED; |
858 |
|
|
859 |
sprintf(szQuery, "SET MIDI_INPUT_DEVICE_PARAMETER %d", iMidiDevice); |
sprintf(szQuery, "SET MIDI_INPUT_DEVICE_PARAMETER %d %s='%s'", iMidiDevice, pParam->key, pParam->value); |
|
lscp_param_concat(szQuery, sizeof(szQuery), pParam); |
|
860 |
return lscp_client_query(pClient, szQuery); |
return lscp_client_query(pClient, szQuery); |
861 |
} |
} |
862 |
|
|
942 |
if (pParam == NULL) |
if (pParam == NULL) |
943 |
return LSCP_FAILED; |
return LSCP_FAILED; |
944 |
|
|
945 |
sprintf(szQuery, "SET MIDI_INPUT_PORT_PARAMETER %d %d", iMidiDevice, iMidiPort); |
sprintf(szQuery, "SET MIDI_INPUT_PORT_PARAMETER %d %d %s='%s'", iMidiDevice, iMidiPort, pParam->key, pParam->value); |
|
lscp_param_concat(szQuery, sizeof(szQuery), pParam); |
|
946 |
return lscp_client_query(pClient, szQuery); |
return lscp_client_query(pClient, szQuery); |
947 |
} |
} |
948 |
|
|
949 |
|
|
950 |
|
//------------------------------------------------------------------------- |
951 |
|
// Generic parameter list functions. |
952 |
|
|
953 |
|
const char *lscp_get_param_value ( lscp_param_t *pParams, const char *pszParam ) |
954 |
|
{ |
955 |
|
int i; |
956 |
|
|
957 |
|
for (i = 0; pParams && pParams[i].key; i++) { |
958 |
|
if (strcasecmp(pParams[i].key, pszParam) == 0) |
959 |
|
return (const char *) pParams[i].value; |
960 |
|
} |
961 |
|
return NULL; |
962 |
|
} |
963 |
|
|
964 |
|
|
965 |
// end of device.c |
// end of device.c |
966 |
|
|