/[svn]/liblscp/trunk/src/device.c
ViewVC logotype

Diff of /liblscp/trunk/src/device.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 107 by capela, Fri Jun 4 21:06:59 2004 UTC revision 975 by capela, Sun Dec 17 00:59:40 2006 UTC
# Line 2  Line 2 
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-2006, 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
# Line 14  Line 14 
14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15     Lesser General Public License for more details.     Lesser General Public License for more details.
16    
17     You should have received a copy of the GNU Lesser General Public     You should have received a copy of the GNU General Public License along
18     License along with this library; if not, write to the Free Software     with this program; if not, write to the Free Software Foundation, Inc.,
19     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20    
21  *****************************************************************************/  *****************************************************************************/
22    
# Line 25  Line 25 
25    
26  // Local prototypes.  // Local prototypes.
27    
28  static lscp_driver_info_t *_lscp_driver_info_query (lscp_client_t *pClient, lscp_driver_info_t *pDriverInfo, const char *pszQuery);  static lscp_driver_info_t *_lscp_driver_info_query (lscp_client_t *pClient, lscp_driver_info_t *pDriverInfo, char *pszQuery);
29    static lscp_device_info_t *_lscp_device_info_query (lscp_client_t *pClient, lscp_device_info_t *pDeviceInfo, char *pszQuery);
30    static lscp_param_info_t  *_lscp_param_info_query  (lscp_client_t *pClient, lscp_param_info_t *pParamInfo, char *pszQuery, int cchMaxQuery, lscp_param_t *pDepList);
31    
32    static lscp_device_port_info_t *_lscp_device_port_info_query (lscp_client_t *pClient, lscp_device_port_info_t *pDevicePortInfo, char *pszQuery);
33    
34    
35  //-------------------------------------------------------------------------  //-------------------------------------------------------------------------
36  // Local funtions.  // Local funtions.
37    
38  // Common driver type query command.  // Common driver type query command.
39  static lscp_driver_info_t *_lscp_driver_info_query ( lscp_client_t *pClient, lscp_driver_info_t *pDriverInfo, const char *pszQuery )  static lscp_driver_info_t *_lscp_driver_info_query ( lscp_client_t *pClient, lscp_driver_info_t *pDriverInfo, char *pszQuery )
40  {  {
41      const char *pszResult;          const char *pszResult;
42      const char *pszSeps = ":";          const char *pszSeps = ":";
43      const char *pszCrlf = "\r\n";          const char *pszCrlf = "\r\n";
44      char *pszToken;          char *pszToken;
45      char *pch;          char *pch;
46    
47      lscp_driver_info_reset(pDriverInfo);          // Lock this section up.
48            lscp_mutex_lock(pClient->mutex);
49      if (lscp_client_query(pClient, pszQuery) != LSCP_OK)  
50          return NULL;          lscp_driver_info_reset(pDriverInfo);
51            if (lscp_client_call(pClient, pszQuery, 1) == LSCP_OK) {
52      pszResult = lscp_client_get_result(pClient);                  pszResult = lscp_client_get_result(pClient);
53      pszToken = lscp_strtok(pszResult, pszSeps, &(pch));                  pszToken = lscp_strtok((char *) pszResult, pszSeps, &(pch));
54      while (pszToken) {                  while (pszToken) {
55          if (strcasecmp(pszToken, "DESCRIPTION") == 0) {                          if (strcasecmp(pszToken, "DESCRIPTION") == 0) {
56              pszToken = lscp_strtok(NULL, pszCrlf, &(pch));                                  pszToken = lscp_strtok(NULL, pszCrlf, &(pch));
57              if (pszToken)                                  if (pszToken)
58                  pDriverInfo->description = lscp_unquote(&pszToken, 1);                                          lscp_unquote_dup(&(pDriverInfo->description), &pszToken);
59          }                          }
60          else if (strcasecmp(pszToken, "VERSION") == 0) {                          else if (strcasecmp(pszToken, "VERSION") == 0) {
61              pszToken = lscp_strtok(NULL, pszCrlf, &(pch));                                  pszToken = lscp_strtok(NULL, pszCrlf, &(pch));
62              if (pszToken)                                  if (pszToken)
63                  pDriverInfo->version = lscp_unquote(&pszToken, 1);                                          lscp_unquote_dup(&(pDriverInfo->version), &pszToken);
64          }                          }
65          else if (strcasecmp(pszToken, "PARAMETERS") == 0) {                          else if (strcasecmp(pszToken, "PARAMETERS") == 0) {
66              pszToken = lscp_strtok(NULL, pszCrlf, &(pch));                                  pszToken = lscp_strtok(NULL, pszCrlf, &(pch));
67              if (pszToken)                                  if (pszToken) {
68                  pDriverInfo->parameters = lscp_szsplit_create(pszToken, ",");                                          if (pDriverInfo->parameters)
69          }                                                  lscp_szsplit_destroy(pDriverInfo->parameters);
70          pszToken = lscp_strtok(NULL, pszSeps, &(pch));                                          pDriverInfo->parameters = lscp_szsplit_create(pszToken, ",");
71      }                                  }
72                            }
73                            pszToken = lscp_strtok(NULL, pszSeps, &(pch));
74                    }
75            }
76            else pDriverInfo = NULL;
77            
78            // Unlock this section down.
79            lscp_mutex_unlock(pClient->mutex);
80    
81            return pDriverInfo;
82    }
83    
84    
85    // Common device info query command.
86    static lscp_device_info_t *_lscp_device_info_query ( lscp_client_t *pClient, lscp_device_info_t *pDeviceInfo, char *pszQuery )
87    {
88            const char *pszResult;
89            const char *pszSeps = ":";
90            const char *pszCrlf = "\r\n";
91            char *pszToken;
92            char *pch;
93            char *pszKey;
94    
95            // Lock this section up.
96            lscp_mutex_lock(pClient->mutex);
97    
98            lscp_device_info_reset(pDeviceInfo);
99            if (lscp_client_call(pClient, pszQuery, 1) == LSCP_OK) {
100                    pszResult = lscp_client_get_result(pClient);
101                    pszToken = lscp_strtok((char *) pszResult, pszSeps, &(pch));
102                    while (pszToken) {
103                            if (strcasecmp(pszToken, "DRIVER") == 0) {
104                                    pszToken = lscp_strtok(NULL, pszCrlf, &(pch));
105                                    if (pszToken)
106                                            lscp_unquote_dup(&(pDeviceInfo->driver), &pszToken);
107                            }
108                            else {
109                                    pszKey = pszToken;
110                                    pszToken = lscp_strtok(NULL, pszCrlf, &(pch));
111                                    if (pszToken)
112                                            lscp_plist_append(&(pDeviceInfo->params), pszKey, lscp_unquote(&pszToken, 0));
113                            }
114                            pszToken = lscp_strtok(NULL, pszSeps, &(pch));
115                    }
116            }
117            else pDeviceInfo = NULL;
118    
119            // Unlock this section down.
120            lscp_mutex_unlock(pClient->mutex);
121    
122            return pDeviceInfo;
123    }
124    
125    
126    // Common device channel/port info query command.
127    static lscp_device_port_info_t *_lscp_device_port_info_query ( lscp_client_t *pClient, lscp_device_port_info_t *pDevicePortInfo, char *pszQuery )
128    {
129            const char *pszResult;
130            const char *pszSeps = ":";
131            const char *pszCrlf = "\r\n";
132            char *pszToken;
133            char *pch;
134            char *pszKey;
135    
136            // Lock this section up.
137            lscp_mutex_lock(pClient->mutex);
138    
139            lscp_device_port_info_reset(pDevicePortInfo);
140            if (lscp_client_call(pClient, pszQuery, 1) == LSCP_OK) {
141                    pszResult = lscp_client_get_result(pClient);
142                    pszToken = lscp_strtok((char *) pszResult, pszSeps, &(pch));
143                    while (pszToken) {
144                            if (strcasecmp(pszToken, "NAME") == 0) {
145                                    pszToken = lscp_strtok(NULL, pszCrlf, &(pch));
146                                    if (pszToken)
147                                            lscp_unquote_dup(&(pDevicePortInfo->name), &pszToken);
148                            }
149                            else {
150                                    pszKey = pszToken;
151                                    pszToken = lscp_strtok(NULL, pszCrlf, &(pch));
152                                    if (pszToken)
153                                            lscp_plist_append(&(pDevicePortInfo->params), pszKey, lscp_unquote(&pszToken, 0));
154                            }
155                            pszToken = lscp_strtok(NULL, pszSeps, &(pch));
156                    }
157            }
158            else pDevicePortInfo = NULL;
159    
160            // Unlock this section down.
161            lscp_mutex_unlock(pClient->mutex);
162    
163            return pDevicePortInfo;
164    }
165    
166    
167    // Common parameter info query command.
168    static lscp_param_info_t *_lscp_param_info_query ( lscp_client_t *pClient, lscp_param_info_t *pParamInfo, char *pszQuery, int cchMaxQuery, lscp_param_t *pDepList )
169    {
170            const char *pszResult;
171            const char *pszSeps = ":";
172            const char *pszCrlf = "\r\n";
173            char *pszToken;
174            char *pch;
175    
176            // Lock this section up.
177            lscp_mutex_lock(pClient->mutex);
178    
179            lscp_param_info_reset(pParamInfo);
180            lscp_param_concat(pszQuery, cchMaxQuery, pDepList);
181            if (lscp_client_call(pClient, pszQuery, 1) == LSCP_OK) {
182                    pszResult = lscp_client_get_result(pClient);
183                    pszToken = lscp_strtok((char *) pszResult, pszSeps, &(pch));
184                    while (pszToken) {
185                            if (strcasecmp(pszToken, "TYPE") == 0) {
186                                    pszToken = lscp_strtok(NULL, pszCrlf, &(pch));
187                                    if (pszToken) {
188                                            pszToken = lscp_unquote(&pszToken, 0);
189                                            if (strcasecmp(pszToken, "BOOL") == 0)
190                                                    pParamInfo->type = LSCP_TYPE_BOOL;
191                                            else if (strcasecmp(pszToken, "INT") == 0)
192                                                    pParamInfo->type = LSCP_TYPE_INT;
193                                            else if (strcasecmp(pszToken, "FLOAT") == 0)
194                                                    pParamInfo->type = LSCP_TYPE_FLOAT;
195                                            else if (strcasecmp(pszToken, "STRING") == 0)
196                                                    pParamInfo->type = LSCP_TYPE_STRING;
197                                    }
198                            }
199                            else if (strcasecmp(pszToken, "DESCRIPTION") == 0) {
200                                    pszToken = lscp_strtok(NULL, pszCrlf, &(pch));
201                                    if (pszToken)
202                                            lscp_unquote_dup(&(pParamInfo->description), &pszToken);
203                            }
204                            else if (strcasecmp(pszToken, "MANDATORY") == 0) {
205                                    pszToken = lscp_strtok(NULL, pszCrlf, &(pch));
206                                    if (pszToken)
207                                            pParamInfo->mandatory = (strcasecmp(lscp_unquote(&pszToken, 0), "TRUE") == 0);
208                            }
209                            else if (strcasecmp(pszToken, "FIX") == 0) {
210                                    pszToken = lscp_strtok(NULL, pszCrlf, &(pch));
211                                    if (pszToken)
212                                            pParamInfo->fix = (strcasecmp(lscp_unquote(&pszToken, 0), "TRUE") == 0);
213                            }
214                            else if (strcasecmp(pszToken, "MULTIPLICITY") == 0) {
215                                    pszToken = lscp_strtok(NULL, pszCrlf, &(pch));
216                                    if (pszToken)
217                                            pParamInfo->multiplicity = (strcasecmp(lscp_unquote(&pszToken, 0), "TRUE") == 0);
218                            }
219                            else if (strcasecmp(pszToken, "DEPENDS") == 0) {
220                                    pszToken = lscp_strtok(NULL, pszCrlf, &(pch));
221                                    if (pszToken) {
222                                            if (pParamInfo->depends)
223                                                    lscp_szsplit_destroy(pParamInfo->depends);
224                                            pParamInfo->depends = lscp_szsplit_create(pszToken, ",");
225                                    }
226                            }
227                            else if (strcasecmp(pszToken, "DEFAULT") == 0) {
228                                    pszToken = lscp_strtok(NULL, pszCrlf, &(pch));
229                                    if (pszToken)
230                                            lscp_unquote_dup(&(pParamInfo->defaultv), &pszToken);
231                            }
232                            else if (strcasecmp(pszToken, "RANGE_MIN") == 0) {
233                                    pszToken = lscp_strtok(NULL, pszCrlf, &(pch));
234                                    if (pszToken)
235                                            lscp_unquote_dup(&(pParamInfo->range_min), &pszToken);
236                            }
237                            else if (strcasecmp(pszToken, "RANGE_MAX") == 0) {
238                                    pszToken = lscp_strtok(NULL, pszCrlf, &(pch));
239                                    if (pszToken)
240                                            lscp_unquote_dup(&(pParamInfo->range_max), &pszToken);
241                            }
242                            else if (strcasecmp(pszToken, "POSSIBILITIES") == 0) {
243                                    pszToken = lscp_strtok(NULL, pszCrlf, &(pch));
244                                    if (pszToken) {
245                                            if (pParamInfo->possibilities)
246                                                    lscp_szsplit_destroy(pParamInfo->possibilities);
247                                            pParamInfo->possibilities = lscp_szsplit_create(pszToken, ",");
248                                    }
249                            }
250                            pszToken = lscp_strtok(NULL, pszSeps, &(pch));
251                    }
252            }
253            else pParamInfo = NULL;
254    
255            // Unlock this section down.
256            lscp_mutex_unlock(pClient->mutex);
257    
258      return pDriverInfo;          return pParamInfo;
259  }  }
260    
261    
# Line 74  static lscp_driver_info_t *_lscp_driver_ Line 263  static lscp_driver_info_t *_lscp_driver_
263  // Audio driver control functions.  // Audio driver control functions.
264    
265  /**  /**
266   *  Getting all available audio output drivers.   *  Getting all available audio output driver count.
267   *  GET AVAILABLE_AUDIO_OUTPUT_DRIVERS   *  GET AVAILABLE_AUDIO_OUTPUT_DRIVERS
268   *   *
269   *  @param pClient  Pointer to client instance structure.   *  @param pClient  Pointer to client instance structure.
270   *   *
271     *  @returns The current total number of audio output drivers on success,
272     *  -1 otherwise.
273     */
274    int lscp_get_available_audio_drivers ( lscp_client_t *pClient )
275    {
276            int iAudioDrivers = -1;
277    
278            if (pClient == NULL)
279                    return -1;
280    
281            // Lock this section up.
282            lscp_mutex_lock(pClient->mutex);
283    
284            if (lscp_client_call(pClient, "GET AVAILABLE_AUDIO_OUTPUT_DRIVERS\r\n", 0) == LSCP_OK)
285                    iAudioDrivers = atoi(lscp_client_get_result(pClient));
286    
287            // Unlock this section down.
288            lscp_mutex_unlock(pClient->mutex);
289    
290            return iAudioDrivers;
291    }
292    
293    
294    /**
295     *  Getting all available audio output drivers.
296     *  LIST AVAILABLE_AUDIO_OUTPUT_DRIVERS
297     *
298     *  @param pClient  Pointer to client instance structure.
299     *
300   *  @returns A NULL terminated array of audio output driver type   *  @returns A NULL terminated array of audio output driver type
301   *  name strings, or NULL in case of failure.   *  name strings, or NULL in case of failure.
302   */   */
303  const char ** lscp_get_available_audio_drivers ( lscp_client_t *pClient )  const char ** lscp_list_available_audio_drivers ( lscp_client_t *pClient )
304  {  {
305      const char *pszSeps = ",";          const char *pszSeps = ",";
306    
307            if (pClient == NULL)
308                    return NULL;
309    
310            // Lock this section up.
311            lscp_mutex_lock(pClient->mutex);
312    
313      if (pClient->audio_drivers) {          if (pClient->audio_drivers) {
314          lscp_szsplit_destroy(pClient->audio_drivers);                  lscp_szsplit_destroy(pClient->audio_drivers);
315          pClient->audio_drivers = NULL;                  pClient->audio_drivers = NULL;
316      }          }
317    
318      if (lscp_client_query(pClient, "GET AVAILABLE_AUDIO_OUTPUT_DRIVERS\r\n") == LSCP_OK)          if (lscp_client_call(pClient, "LIST AVAILABLE_AUDIO_OUTPUT_DRIVERS\r\n", 0) == LSCP_OK)
319          pClient->audio_drivers = lscp_szsplit_create(lscp_client_get_result(pClient), pszSeps);                  pClient->audio_drivers = lscp_szsplit_create(lscp_client_get_result(pClient), pszSeps);
320    
321      return (const char **) pClient->audio_drivers;          // Unlock this section down.
322            lscp_mutex_unlock(pClient->mutex);
323    
324            return (const char **) pClient->audio_drivers;
325  }  }
326    
327    
# Line 110  const char ** lscp_get_available_audio_d Line 337  const char ** lscp_get_available_audio_d
337   */   */
338  lscp_driver_info_t* lscp_get_audio_driver_info ( lscp_client_t *pClient, const char *pszAudioDriver )  lscp_driver_info_t* lscp_get_audio_driver_info ( lscp_client_t *pClient, const char *pszAudioDriver )
339  {  {
340      char szQuery[LSCP_BUFSIZ];          char szQuery[LSCP_BUFSIZ];
341    
342      if (pszAudioDriver == NULL)          if (pszAudioDriver == NULL)
343          return NULL;                  return NULL;
344    
345      sprintf(szQuery, "GET AUDIO_OUTPUT_DRIVER INFO %s\r\n", pszAudioDriver);          sprintf(szQuery, "GET AUDIO_OUTPUT_DRIVER INFO %s\r\n", pszAudioDriver);
346      return _lscp_driver_info_query(pClient, &(pClient->audio_info), szQuery);          return _lscp_driver_info_query(pClient, &(pClient->audio_driver_info), szQuery);
347  }  }
348    
349    
# Line 134  lscp_driver_info_t* lscp_get_audio_drive Line 361  lscp_driver_info_t* lscp_get_audio_drive
361   */   */
362  lscp_param_info_t *lscp_get_audio_driver_param_info ( lscp_client_t *pClient, const char *pszAudioDriver, const char *pszParam, lscp_param_t *pDepList )  lscp_param_info_t *lscp_get_audio_driver_param_info ( lscp_client_t *pClient, const char *pszAudioDriver, const char *pszParam, lscp_param_t *pDepList )
363  {  {
364      lscp_param_info_t *pParamInfo = NULL;          char szQuery[LSCP_BUFSIZ];
365    
366      if (pClient == NULL)          if (pClient == NULL)
367          return NULL;                  return NULL;
368      if (pszAudioDriver == NULL)          if (pszAudioDriver == NULL)
369          return NULL;                  return NULL;
370      if (pszParam == NULL)          if (pszParam == NULL)
371          return NULL;                  return NULL;
     if (pDepList == NULL)  
         return NULL;  
372    
373      return pParamInfo;          sprintf(szQuery, "GET AUDIO_OUTPUT_DRIVER_PARAMETER INFO %s %s", pszAudioDriver, pszParam);
374            return _lscp_param_info_query(pClient, &(pClient->audio_param_info), szQuery, sizeof(szQuery), pDepList);
375  }  }
376    
377    
# Line 165  lscp_param_info_t *lscp_get_audio_driver Line 391  lscp_param_info_t *lscp_get_audio_driver
391   */   */
392  int lscp_create_audio_device ( lscp_client_t *pClient, const char *pszAudioDriver, lscp_param_t *pParams )  int lscp_create_audio_device ( lscp_client_t *pClient, const char *pszAudioDriver, lscp_param_t *pParams )
393  {  {
394      int iAudioDevice = -1;          char szQuery[LSCP_BUFSIZ];
395            int iAudioDevice = -1;
396    
397            if (pClient == NULL)
398                    return -1;
399            if (pszAudioDriver == NULL)
400                    return -1;
401    
402            // Lock this section up.
403            lscp_mutex_lock(pClient->mutex);
404    
405            sprintf(szQuery, "CREATE AUDIO_OUTPUT_DEVICE %s", pszAudioDriver);
406            lscp_param_concat(szQuery, sizeof(szQuery), pParams);
407            if (lscp_client_call(pClient, szQuery, 0) == LSCP_OK)
408                    iAudioDevice = atoi(lscp_client_get_result(pClient));
409    
410      if (pClient == NULL)          // Unlock this section down.
411          return -1;          lscp_mutex_unlock(pClient->mutex);
     if (pszAudioDriver == NULL)  
         return -1;  
     if (pParams == NULL)  
         return -1;  
412    
413      return iAudioDevice;          return iAudioDevice;
414  }  }
415    
416    
# Line 189  int lscp_create_audio_device ( lscp_clie Line 425  int lscp_create_audio_device ( lscp_clie
425   */   */
426  lscp_status_t lscp_destroy_audio_device ( lscp_client_t *pClient, int iAudioDevice )  lscp_status_t lscp_destroy_audio_device ( lscp_client_t *pClient, int iAudioDevice )
427  {  {
428      lscp_status_t ret = LSCP_FAILED;          lscp_status_t ret = LSCP_FAILED;
429            char szQuery[LSCP_BUFSIZ];
430    
431      if (pClient == NULL)          if (pClient == NULL)
432          return ret;                  return ret;
433      if (iAudioDevice < 0)          if (iAudioDevice < 0)
434          return ret;                  return ret;
435    
436      return ret;          sprintf(szQuery, "DESTROY AUDIO_OUTPUT_DEVICE %d\r\n", iAudioDevice);
437            return lscp_client_query(pClient, szQuery);
438  }  }
439    
440    
441  /**  /**
442   *  Getting all created audio output devices.   *  Getting all created audio output device count.
443   *  GET AUDIO_OUTPUT_DEVICES   *  GET AUDIO_OUTPUT_DEVICES
444   *   *
445   *  @param pClient  Pointer to client instance structure.   *  @param pClient  Pointer to client instance structure.
446   *   *
447     *  @returns The current total number of audio devices on success,
448     *  -1 otherwise.
449     */
450    int lscp_get_audio_devices ( lscp_client_t *pClient )
451    {
452            int iAudioDevices = -1;
453    
454            if (pClient == NULL)
455                    return -1;
456    
457            // Lock this section up.
458            lscp_mutex_lock(pClient->mutex);
459    
460            if (lscp_client_call(pClient, "GET AUDIO_OUTPUT_DEVICES\r\n", 0) == LSCP_OK)
461                    iAudioDevices = atoi(lscp_client_get_result(pClient));
462    
463            // Unlock this section down.
464            lscp_mutex_unlock(pClient->mutex);
465    
466            return iAudioDevices;
467    }
468    
469    
470    /**
471     *  Getting all created audio output device list.
472     *  LIST AUDIO_OUTPUT_DEVICES
473     *
474     *  @param pClient  Pointer to client instance structure.
475     *
476   *  @returns An array of audio device number identifiers,   *  @returns An array of audio device number identifiers,
477   *  terminated with -1 on success, or NULL in case of failure.   *  terminated with -1 on success, or NULL in case of failure.
478   */   */
479  int *lscp_get_audio_devices ( lscp_client_t *pClient )  int *lscp_list_audio_devices ( lscp_client_t *pClient )
480  {  {
481      int *piAudioDevices = NULL;          const char *pszSeps = ",";
482    
483            if (pClient == NULL)
484                    return NULL;
485    
486            // Lock this section up.
487            lscp_mutex_lock(pClient->mutex);
488    
489      if (pClient == NULL)          if (pClient->audio_devices) {
490          return NULL;                  lscp_isplit_destroy(pClient->audio_devices);
491                    pClient->audio_devices = NULL;
492            }
493    
494      return piAudioDevices;          if (lscp_client_call(pClient, "LIST AUDIO_OUTPUT_DEVICES\r\n", 0) == LSCP_OK)
495                    pClient->audio_devices = lscp_isplit_create(lscp_client_get_result(pClient), pszSeps);
496    
497            // Unlock this section down.
498            lscp_mutex_unlock(pClient->mutex);
499    
500            return pClient->audio_devices;
501  }  }
502    
503    
# Line 232  int *lscp_get_audio_devices ( lscp_clien Line 513  int *lscp_get_audio_devices ( lscp_clien
513   */   */
514  lscp_device_info_t *lscp_get_audio_device_info ( lscp_client_t *pClient, int iAudioDevice )  lscp_device_info_t *lscp_get_audio_device_info ( lscp_client_t *pClient, int iAudioDevice )
515  {  {
516      lscp_device_info_t *pDeviceInfo = NULL;          char szQuery[LSCP_BUFSIZ];
517    
518      if (pClient == NULL)          if (pClient == NULL)
519          return NULL;                  return NULL;
520      if (iAudioDevice < 0)          if (iAudioDevice < 0)
521          return NULL;                  return NULL;
522    
523      return pDeviceInfo;          sprintf(szQuery, "GET AUDIO_OUTPUT_DEVICE INFO %d\r\n", iAudioDevice);
524            return _lscp_device_info_query(pClient, &(pClient->audio_device_info), szQuery);
525  }  }
526    
527    
528  /**  /**
529   *  Changing settings of audio output devices.   *  Changing settings of audio output devices.
530   *  SET AUDIO_OUTPUT_DEVICE_PARAMETER <audio-device-id> <param> <value>   *  SET AUDIO_OUTPUT_DEVICE_PARAMETER <audio-device-id> <param>=<value>
531   *   *
532   *  @param pClient      Pointer to client instance structure.   *  @param pClient      Pointer to client instance structure.
533   *  @param iAudioDevice Audio device number identifier.   *  @param iAudioDevice Audio device number identifier.
# Line 255  lscp_device_info_t *lscp_get_audio_devic Line 537  lscp_device_info_t *lscp_get_audio_devic
537   */   */
538  lscp_status_t lscp_set_audio_device_param ( lscp_client_t *pClient, int iAudioDevice, lscp_param_t *pParam )  lscp_status_t lscp_set_audio_device_param ( lscp_client_t *pClient, int iAudioDevice, lscp_param_t *pParam )
539  {  {
540      lscp_status_t ret = LSCP_FAILED;          char szQuery[LSCP_BUFSIZ];
541    
542      if (pClient == NULL)          if (pClient == NULL)
543          return ret;                  return LSCP_FAILED;
544      if (iAudioDevice < 0)          if (iAudioDevice < 0)
545          return ret;                  return LSCP_FAILED;
546      if (pParam == NULL)          if (pParam == NULL)
547          return ret;                  return LSCP_FAILED;
548    
549      return ret;          sprintf(szQuery, "SET AUDIO_OUTPUT_DEVICE_PARAMETER %d %s='%s'\r\n", iAudioDevice, pParam->key, pParam->value);
550            return lscp_client_query(pClient, szQuery);
551  }  }
552    
553    
# Line 276  lscp_status_t lscp_set_audio_device_para Line 559  lscp_status_t lscp_set_audio_device_para
559   *  @param iAudioDevice     Audio device number identifier.   *  @param iAudioDevice     Audio device number identifier.
560   *  @param iAudioChannel    Audio channel number.   *  @param iAudioChannel    Audio channel number.
561   *   *
562   *  @returns A pointer to a @ref lscp_device_channel_info_t structure,   *  @returns A pointer to a @ref lscp_device_port_info_t structure,
563   *  with the given audio channel information, or NULL in case of failure.   *  with the given audio channel information, or NULL in case of failure.
564   */   */
565  lscp_device_channel_info_t* lscp_get_audio_channel_info ( lscp_client_t *pClient, int iAudioDevice, int iAudioChannel )  lscp_device_port_info_t* lscp_get_audio_channel_info ( lscp_client_t *pClient, int iAudioDevice, int iAudioChannel )
566  {  {
567      lscp_device_channel_info_t *pDevChannelInfo = NULL;          char szQuery[LSCP_BUFSIZ];
568    
569      if (pClient == NULL)          if (pClient == NULL)
570          return NULL;                  return NULL;
571      if (iAudioDevice < 0)          if (iAudioDevice < 0)
572          return NULL;                  return NULL;
573      if (iAudioChannel < 0)          if (iAudioChannel < 0)
574          return NULL;                  return NULL;
575    
576      return pDevChannelInfo;          sprintf(szQuery, "GET AUDIO_OUTPUT_CHANNEL INFO %d %d\r\n", iAudioDevice, iAudioChannel);
577            return _lscp_device_port_info_query(pClient, &(pClient->audio_channel_info), szQuery);
578  }  }
579    
580    
# Line 308  lscp_device_channel_info_t* lscp_get_aud Line 592  lscp_device_channel_info_t* lscp_get_aud
592   */   */
593  lscp_param_info_t* lscp_get_audio_channel_param_info ( lscp_client_t *pClient, int iAudioDevice, int iAudioChannel, const char *pszParam )  lscp_param_info_t* lscp_get_audio_channel_param_info ( lscp_client_t *pClient, int iAudioDevice, int iAudioChannel, const char *pszParam )
594  {  {
595      lscp_param_info_t *pParamInfo = NULL;          char szQuery[LSCP_BUFSIZ];
596    
597      if (pClient == NULL)          if (pClient == NULL)
598          return NULL;                  return NULL;
599      if (iAudioDevice < 0)          if (iAudioDevice < 0)
600          return NULL;                  return NULL;
601      if (iAudioChannel < 0)          if (iAudioChannel < 0)
602          return NULL;                  return NULL;
603      if (pszParam == NULL)          if (pszParam == NULL)
604          return NULL;                  return NULL;
605    
606      return pParamInfo;          sprintf(szQuery, "GET AUDIO_OUTPUT_CHANNEL_PARAMETER INFO %d %d %s", iAudioDevice, iAudioChannel, pszParam);
607            return _lscp_param_info_query(pClient, &(pClient->audio_channel_param_info), szQuery, sizeof(szQuery), NULL);
608  }  }
609    
610    
# Line 336  lscp_param_info_t* lscp_get_audio_channe Line 621  lscp_param_info_t* lscp_get_audio_channe
621   */   */
622  lscp_status_t lscp_set_audio_channel_param ( lscp_client_t *pClient, int iAudioDevice, int iAudioChannel, lscp_param_t *pParam )  lscp_status_t lscp_set_audio_channel_param ( lscp_client_t *pClient, int iAudioDevice, int iAudioChannel, lscp_param_t *pParam )
623  {  {
624      lscp_status_t ret = LSCP_FAILED;          char szQuery[LSCP_BUFSIZ];
625    
626      if (pClient == NULL)          if (pClient == NULL)
627          return ret;                  return LSCP_FAILED;
628      if (iAudioDevice < 0)          if (iAudioDevice < 0)
629          return ret;                  return LSCP_FAILED;
630      if (iAudioChannel < 0)          if (iAudioChannel < 0)
631          return ret;                  return LSCP_FAILED;
632      if (pParam == NULL)          if (pParam == NULL)
633          return ret;                  return LSCP_FAILED;
634    
635      return ret;          sprintf(szQuery, "SET AUDIO_OUTPUT_CHANNEL_PARAMETER %d %d %s='%s'\r\n", iAudioDevice, iAudioChannel, pParam->key, pParam->value);
636            return lscp_client_query(pClient, szQuery);
637  }  }
638    
639    
# Line 355  lscp_status_t lscp_set_audio_channel_par Line 641  lscp_status_t lscp_set_audio_channel_par
641  // MIDI driver control functions.  // MIDI driver control functions.
642    
643  /**  /**
644   *  Getting all available MIDI input drivers.   *  Getting all available MIDI input driver count.
645   *  GET AVAILABLE_MIDI_INPUT_DRIVERS   *  GET AVAILABLE_MIDI_INPUT_DRIVERS
646   *   *
647   *  @param pClient  Pointer to client instance structure.   *  @param pClient  Pointer to client instance structure.
648   *   *
649     *  @returns The current total number of MIDI input drivers on success,
650     *  -1 otherwise.
651     */
652    int lscp_get_available_midi_drivers ( lscp_client_t *pClient )
653    {
654            int iMidiDrivers = -1;
655    
656            if (pClient == NULL)
657                    return -1;
658    
659            // Lock this section up.
660            lscp_mutex_lock(pClient->mutex);
661    
662            if (lscp_client_call(pClient, "GET AVAILABLE_MIDI_INPUT_DRIVERS\r\n", 0) == LSCP_OK)
663                    iMidiDrivers = atoi(lscp_client_get_result(pClient));
664    
665            // Unlock this section up.
666            lscp_mutex_unlock(pClient->mutex);
667    
668            return iMidiDrivers;
669    }
670    
671    
672    /**
673     *  Getting all available MIDI input drivers.
674     *  LIST AVAILABLE_MIDI_INPUT_DRIVERS
675     *
676     *  @param pClient  Pointer to client instance structure.
677     *
678   *  @returns A NULL terminated array of MIDI input driver type   *  @returns A NULL terminated array of MIDI input driver type
679   *  name strings, or NULL in case of failure.   *  name strings, or NULL in case of failure.
680   */   */
681  const char** lscp_get_available_midi_drivers ( lscp_client_t *pClient )  const char** lscp_list_available_midi_drivers ( lscp_client_t *pClient )
682  {  {
683      const char *pszSeps = ",";          const char *pszSeps = ",";
684    
685            if (pClient == NULL)
686                    return NULL;
687    
688            // Lock this section up.
689            lscp_mutex_lock(pClient->mutex);
690    
691            if (pClient->midi_drivers) {
692                    lscp_szsplit_destroy(pClient->midi_drivers);
693                    pClient->midi_drivers = NULL;
694            }
695    
696      if (pClient->midi_drivers) {          if (lscp_client_call(pClient, "LIST AVAILABLE_MIDI_INPUT_DRIVERS\r\n", 0) == LSCP_OK)
697          lscp_szsplit_destroy(pClient->midi_drivers);                  pClient->midi_drivers = lscp_szsplit_create(lscp_client_get_result(pClient), pszSeps);
         pClient->midi_drivers = NULL;  
     }  
698    
699      if (lscp_client_query(pClient, "GET AVAILABLE_MIDI_INPUT_DRIVERS\r\n") == LSCP_OK)          // Unlock this section up.
700          pClient->midi_drivers = lscp_szsplit_create(lscp_client_get_result(pClient), pszSeps);          lscp_mutex_unlock(pClient->mutex);
701    
702      return (const char **) pClient->midi_drivers;          return (const char **) pClient->midi_drivers;
703  }  }
704    
705    
# Line 391  const char** lscp_get_available_midi_dri Line 715  const char** lscp_get_available_midi_dri
715   */   */
716  lscp_driver_info_t* lscp_get_midi_driver_info ( lscp_client_t *pClient, const char *pszMidiDriver )  lscp_driver_info_t* lscp_get_midi_driver_info ( lscp_client_t *pClient, const char *pszMidiDriver )
717  {  {
718      char szQuery[LSCP_BUFSIZ];          char szQuery[LSCP_BUFSIZ];
719    
720      if (pszMidiDriver == NULL)          if (pszMidiDriver == NULL)
721          return NULL;                  return NULL;
722    
723      sprintf(szQuery, "GET MIDI_INPUT_DRIVER INFO %s\r\n", pszMidiDriver);          sprintf(szQuery, "GET MIDI_INPUT_DRIVER INFO %s\r\n", pszMidiDriver);
724      return _lscp_driver_info_query(pClient, &(pClient->midi_info), szQuery);          return _lscp_driver_info_query(pClient, &(pClient->midi_driver_info), szQuery);
725  }  }
726    
727    
# Line 417  lscp_driver_info_t* lscp_get_midi_driver Line 741  lscp_driver_info_t* lscp_get_midi_driver
741   */   */
742  lscp_param_info_t *lscp_get_midi_driver_param_info ( lscp_client_t *pClient, const char *pszMidiDriver, const char *pszParam, lscp_param_t *pDepList )  lscp_param_info_t *lscp_get_midi_driver_param_info ( lscp_client_t *pClient, const char *pszMidiDriver, const char *pszParam, lscp_param_t *pDepList )
743  {  {
744      lscp_param_info_t *pParamInfo = NULL;          char szQuery[LSCP_BUFSIZ];
745    
746      if (pClient == NULL)          if (pClient == NULL)
747          return NULL;                  return NULL;
748      if (pszMidiDriver == NULL)          if (pszMidiDriver == NULL)
749          return NULL;                  return NULL;
750      if (pszParam == NULL)          if (pszParam == NULL)
751          return NULL;                  return NULL;
     if (pDepList == NULL)  
         return NULL;  
752    
753      return pParamInfo;          sprintf(szQuery, "GET MIDI_INPUT_DRIVER_PARAMETER INFO %s %s", pszMidiDriver, pszParam);
754            return _lscp_param_info_query(pClient, &(pClient->midi_param_info), szQuery, sizeof(szQuery), pDepList);
755  }  }
756    
757    
# Line 448  lscp_param_info_t *lscp_get_midi_driver_ Line 771  lscp_param_info_t *lscp_get_midi_driver_
771   */   */
772  int lscp_create_midi_device ( lscp_client_t *pClient, const char *pszMidiDriver, lscp_param_t *pParams )  int lscp_create_midi_device ( lscp_client_t *pClient, const char *pszMidiDriver, lscp_param_t *pParams )
773  {  {
774      int iMidiDevice = -1;          char szQuery[LSCP_BUFSIZ];
775            int iMidiDevice = -1;
776    
777      if (pClient == NULL)          if (pClient == NULL)
778          return -1;                  return -1;
779      if (pszMidiDriver == NULL)          if (pszMidiDriver == NULL)
780          return -1;                  return -1;
781      if (pParams == NULL)  
782          return -1;          // Lock this section up.
783            lscp_mutex_lock(pClient->mutex);
784    
785            sprintf(szQuery, "CREATE MIDI_INPUT_DEVICE %s", pszMidiDriver);
786            lscp_param_concat(szQuery, sizeof(szQuery), pParams);
787            if (lscp_client_call(pClient, szQuery, 0) == LSCP_OK)
788                    iMidiDevice = atoi(lscp_client_get_result(pClient));
789    
790      return iMidiDevice;          // Unlock this section down.
791            lscp_mutex_unlock(pClient->mutex);
792    
793            return iMidiDevice;
794  }  }
795    
796    
# Line 472  int lscp_create_midi_device ( lscp_clien Line 805  int lscp_create_midi_device ( lscp_clien
805   */   */
806  lscp_status_t lscp_destroy_midi_device ( lscp_client_t *pClient, int iMidiDevice )  lscp_status_t lscp_destroy_midi_device ( lscp_client_t *pClient, int iMidiDevice )
807  {  {
808      lscp_status_t ret = LSCP_FAILED;          lscp_status_t ret = LSCP_FAILED;
809            char szQuery[LSCP_BUFSIZ];
810    
811      if (pClient == NULL)          if (pClient == NULL)
812          return ret;                  return ret;
813      if (iMidiDevice < 0)          if (iMidiDevice < 0)
814          return ret;                  return ret;
815    
816      return ret;          sprintf(szQuery, "DESTROY MIDI_INPUT_DEVICE %d\r\n", iMidiDevice);
817            return lscp_client_query(pClient, szQuery);
818  }  }
819    
820    
821  /**  /**
822   *  Getting all created MIDI input devices.   *  Getting all created MIDI intput device count.
823   *  GET MIDI_INPUT_DEVICES   *  GET MIDI_INPUT_DEVICES
824   *   *
825   *  @param pClient  Pointer to client instance structure.   *  @param pClient  Pointer to client instance structure.
826   *   *
827     *  @returns The current total number of MIDI devices on success,
828     *  -1 otherwise.
829     */
830    int lscp_get_midi_devices ( lscp_client_t *pClient )
831    {
832            int iMidiDevices = -1;
833    
834            if (pClient == NULL)
835                    return -1;
836    
837            // Lock this section up.
838            lscp_mutex_lock(pClient->mutex);
839    
840            if (lscp_client_call(pClient, "GET MIDI_INPUT_DEVICES\r\n", 0) == LSCP_OK)
841                    iMidiDevices = atoi(lscp_client_get_result(pClient));
842                    
843            // Unlock this section down.
844            lscp_mutex_unlock(pClient->mutex);
845    
846            return iMidiDevices;
847    }
848    
849    
850    /**
851     *  Getting all created MIDI intput device list.
852     *  LIST MIDI_INPUT_DEVICES
853     *
854     *  @param pClient  Pointer to client instance structure.
855     *
856   *  @returns An array of MIDI device number identifiers,   *  @returns An array of MIDI device number identifiers,
857   *  terminated with -1 on success, or NULL in case of failure.   *  terminated with -1 on success, or NULL in case of failure.
858   */   */
859  int *lscp_get_midi_devices ( lscp_client_t *pClient )  int *lscp_list_midi_devices ( lscp_client_t *pClient )
860  {  {
861      int *piMidiDevices = NULL;          const char *pszSeps = ",";
862    
863            if (pClient == NULL)
864                    return NULL;
865    
866            // Lock this section up.
867            lscp_mutex_lock(pClient->mutex);
868    
869      if (pClient == NULL)          if (pClient->midi_devices) {
870          return NULL;                  lscp_isplit_destroy(pClient->midi_devices);
871                    pClient->midi_devices = NULL;
872            }
873    
874      return piMidiDevices;          if (lscp_client_call(pClient, "LIST MIDI_INPUT_DEVICES\r\n", 0) == LSCP_OK)
875                    pClient->midi_devices = lscp_isplit_create(lscp_client_get_result(pClient), pszSeps);
876    
877            // Unlock this section down.
878            lscp_mutex_unlock(pClient->mutex);
879    
880            return pClient->midi_devices;
881  }  }
882    
883    
# Line 515  int *lscp_get_midi_devices ( lscp_client Line 893  int *lscp_get_midi_devices ( lscp_client
893   */   */
894  lscp_device_info_t* lscp_get_midi_device_info ( lscp_client_t *pClient, int iMidiDevice )  lscp_device_info_t* lscp_get_midi_device_info ( lscp_client_t *pClient, int iMidiDevice )
895  {  {
896      lscp_device_info_t *pDeviceInfo = NULL;          char szQuery[LSCP_BUFSIZ];
897    
898      if (pClient == NULL)          if (pClient == NULL)
899          return NULL;                  return NULL;
900      if (iMidiDevice < 0)          if (iMidiDevice < 0)
901          return NULL;                  return NULL;
902    
903      return pDeviceInfo;          sprintf(szQuery, "GET MIDI_INPUT_DEVICE INFO %d\r\n", iMidiDevice);
904            return _lscp_device_info_query(pClient, &(pClient->midi_device_info), szQuery);
905  }  }
906    
907    
908  /**  /**
909   *  Changing settings of MIDI input devices.   *  Changing settings of MIDI input devices.
910   *  SET MIDI_INPUT_DEVICE_PARAMETER <midi-device-id> <param> <value>   *  SET MIDI_INPUT_DEVICE_PARAMETER <midi-device-id> <param>=<value>
911   *   *
912   *  @param pClient      Pointer to client instance structure.   *  @param pClient      Pointer to client instance structure.
913   *  @param iMidiDevice  MIDI device number identifier.   *  @param iMidiDevice  MIDI device number identifier.
# Line 538  lscp_device_info_t* lscp_get_midi_device Line 917  lscp_device_info_t* lscp_get_midi_device
917   */   */
918  lscp_status_t lscp_set_midi_device_param ( lscp_client_t *pClient, int iMidiDevice, lscp_param_t *pParam )  lscp_status_t lscp_set_midi_device_param ( lscp_client_t *pClient, int iMidiDevice, lscp_param_t *pParam )
919  {  {
920      lscp_status_t ret = LSCP_FAILED;          char szQuery[LSCP_BUFSIZ];
921    
922      if (pClient == NULL)          if (pClient == NULL)
923          return ret;                  return LSCP_FAILED;
924      if (iMidiDevice < 0)          if (iMidiDevice < 0)
925          return ret;                  return LSCP_FAILED;
926      if (pParam == NULL)          if (pParam == NULL)
927          return ret;                  return LSCP_FAILED;
928    
929      return ret;          sprintf(szQuery, "SET MIDI_INPUT_DEVICE_PARAMETER %d %s='%s'\r\n", iMidiDevice, pParam->key, pParam->value);
930            return lscp_client_query(pClient, szQuery);
931  }  }
932    
933    
# Line 559  lscp_status_t lscp_set_midi_device_param Line 939  lscp_status_t lscp_set_midi_device_param
939   *  @param iMidiDevice  MIDI device number identifier.   *  @param iMidiDevice  MIDI device number identifier.
940   *  @param iMidiPort    MIDI port number.   *  @param iMidiPort    MIDI port number.
941   *   *
942   *  @returns A pointer to a @ref lscp_device_channel_info_t structure,   *  @returns A pointer to a @ref lscp_device_port_info_t structure,
943   *  with the given MIDI port information, or NULL in case of failure.   *  with the given MIDI port information, or NULL in case of failure.
944   */   */
945  lscp_device_channel_info_t* lscp_get_midi_port_info ( lscp_client_t *pClient, int iMidiDevice, int iMidiPort )  lscp_device_port_info_t* lscp_get_midi_port_info ( lscp_client_t *pClient, int iMidiDevice, int iMidiPort )
946  {  {
947      lscp_device_channel_info_t *pDevChannelInfo = NULL;          char szQuery[LSCP_BUFSIZ];
948    
949      if (pClient == NULL)          if (pClient == NULL)
950          return NULL;                  return NULL;
951      if (iMidiDevice < 0)          if (iMidiDevice < 0)
952          return NULL;                  return NULL;
953      if (iMidiPort < 0)          if (iMidiPort < 0)
954          return NULL;                  return NULL;
955    
956      return pDevChannelInfo;          sprintf(szQuery, "GET MIDI_INPUT_PORT INFO %d %d\r\n", iMidiDevice, iMidiPort);
957            return _lscp_device_port_info_query(pClient, &(pClient->midi_port_info), szQuery);
958  }  }
959    
960    
# Line 591  lscp_device_channel_info_t* lscp_get_mid Line 972  lscp_device_channel_info_t* lscp_get_mid
972   */   */
973  lscp_param_info_t* lscp_get_midi_port_param_info ( lscp_client_t *pClient, int iMidiDevice, int iMidiPort, const char *pszParam )  lscp_param_info_t* lscp_get_midi_port_param_info ( lscp_client_t *pClient, int iMidiDevice, int iMidiPort, const char *pszParam )
974  {  {
975      lscp_param_info_t *pParamInfo = NULL;          char szQuery[LSCP_BUFSIZ];
976    
977      if (pClient == NULL)          if (pClient == NULL)
978          return NULL;                  return NULL;
979      if (iMidiDevice < 0)          if (iMidiDevice < 0)
980          return NULL;                  return NULL;
981      if (iMidiPort < 0)          if (iMidiPort < 0)
982          return NULL;                  return NULL;
983      if (pszParam == NULL)          if (pszParam == NULL)
984          return NULL;                  return NULL;
985    
986      return pParamInfo;          sprintf(szQuery, "GET MIDI_INPUT_PORT_PARAMETER INFO %d %d %s", iMidiDevice, iMidiPort, pszParam);
987            return _lscp_param_info_query(pClient, &(pClient->midi_port_param_info), szQuery, sizeof(szQuery), NULL);
988  }  }
989    
990    
# Line 619  lscp_param_info_t* lscp_get_midi_port_pa Line 1001  lscp_param_info_t* lscp_get_midi_port_pa
1001   */   */
1002  lscp_status_t lscp_set_midi_port_param ( lscp_client_t *pClient, int iMidiDevice, int iMidiPort, lscp_param_t *pParam )  lscp_status_t lscp_set_midi_port_param ( lscp_client_t *pClient, int iMidiDevice, int iMidiPort, lscp_param_t *pParam )
1003  {  {
1004      lscp_status_t ret = LSCP_FAILED;          char szQuery[LSCP_BUFSIZ];
1005    
1006            if (pClient == NULL)
1007                    return LSCP_FAILED;
1008            if (iMidiDevice < 0)
1009                    return LSCP_FAILED;
1010            if (iMidiPort < 0)
1011                    return LSCP_FAILED;
1012            if (pParam == NULL)
1013                    return LSCP_FAILED;
1014    
1015            sprintf(szQuery, "SET MIDI_INPUT_PORT_PARAMETER %d %d %s='%s'\r\n", iMidiDevice, iMidiPort, pParam->key, pParam->value);
1016            return lscp_client_query(pClient, szQuery);
1017    }
1018    
     if (pClient == NULL)  
         return ret;  
     if (iMidiDevice < 0)  
         return ret;  
     if (iMidiPort < 0)  
         return ret;  
     if (pParam == NULL)  
         return ret;  
1019    
1020      return ret;  //-------------------------------------------------------------------------
1021    // Generic parameter list functions.
1022    
1023    const char *lscp_get_param_value ( lscp_param_t *pParams, const char *pszParam )
1024    {
1025            int i;
1026    
1027            for (i = 0; pParams && pParams[i].key; i++) {
1028                    if (strcasecmp(pParams[i].key, pszParam) == 0)
1029                            return (const char *) pParams[i].value;
1030            }
1031            return NULL;
1032  }  }
1033    
1034    
1035  // end of device.c  // end of device.c
1036    

Legend:
Removed from v.107  
changed lines
  Added in v.975

  ViewVC Help
Powered by ViewVC