/[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 180 by capela, Tue Jul 6 20:20:51 2004 UTC revision 435 by capela, Wed Mar 9 18:39:57 2005 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-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
# Line 73  static lscp_driver_info_t *_lscp_driver_ Line 73  static lscp_driver_info_t *_lscp_driver_
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);
# Line 113  static lscp_device_info_t *_lscp_device_ Line 114  static lscp_device_info_t *_lscp_device_
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);
# Line 153  static lscp_device_port_info_t *_lscp_de Line 155  static lscp_device_port_info_t *_lscp_de
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);
# Line 247  static lscp_param_info_t *_lscp_param_in Line 250  static lscp_param_info_t *_lscp_param_in
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);
# Line 507  lscp_status_t lscp_set_audio_device_para Line 511  lscp_status_t lscp_set_audio_device_para
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    
# Line 594  lscp_status_t lscp_set_audio_channel_par Line 597  lscp_status_t lscp_set_audio_channel_par
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    
# Line 854  lscp_status_t lscp_set_midi_device_param Line 856  lscp_status_t lscp_set_midi_device_param
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    
# Line 941  lscp_status_t lscp_set_midi_port_param ( Line 942  lscp_status_t lscp_set_midi_port_param (
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    

Legend:
Removed from v.180  
changed lines
  Added in v.435

  ViewVC Help
Powered by ViewVC