liblscp
0.5.6
|
00001 // device.h 00002 // 00003 /**************************************************************************** 00004 liblscp - LinuxSampler Control Protocol API 00005 Copyright (C) 2004-2007, rncbc aka Rui Nuno Capela. All rights reserved. 00006 00007 This library is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU Lesser General Public 00009 License as published by the Free Software Foundation; either 00010 version 2.1 of the License, or (at your option) any later version. 00011 00012 This library is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 Lesser General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License along 00018 with this program; if not, write to the Free Software Foundation, Inc., 00019 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00020 00021 *****************************************************************************/ 00022 00023 #ifndef __LSCP_DEVICE_H 00024 #define __LSCP_DEVICE_H 00025 00026 #include "lscp/client.h" 00027 00028 #if defined(__cplusplus) 00029 extern "C" { 00030 #endif 00031 00032 00033 //------------------------------------------------------------------------- 00034 // Device driver information structures. 00035 00037 typedef enum _lscp_type_t 00038 { 00039 LSCP_TYPE_NONE = 0, 00040 LSCP_TYPE_BOOL, 00041 LSCP_TYPE_INT, 00042 LSCP_TYPE_FLOAT, 00043 LSCP_TYPE_STRING 00044 00045 } lscp_type_t; 00046 00047 00049 typedef struct _lscp_param_t 00050 { 00051 char * key; 00052 char * value; 00053 00054 } lscp_param_t; 00055 00056 00058 typedef struct _lscp_param_info_t 00059 { 00060 lscp_type_t type; 00061 char * description; 00062 int mandatory; 00063 int fix; 00064 int multiplicity; 00065 char ** depends; 00066 char * defaultv; 00067 char * range_min; 00068 char * range_max; 00069 char ** possibilities; 00070 00071 } lscp_param_info_t; 00072 00073 00075 typedef struct _lscp_driver_info_t 00076 { 00077 char * description; 00078 char * version; 00079 char ** parameters; 00080 00081 } lscp_driver_info_t; 00082 00083 00085 typedef struct _lscp_device_info_t 00086 { 00087 char * driver; 00088 lscp_param_t *params; 00089 00090 } lscp_device_info_t; 00091 00092 00094 typedef struct _lscp_device_port_info_t 00095 { 00096 char * name; 00097 lscp_param_t *params; 00098 00099 } lscp_device_port_info_t; 00100 00101 00102 //------------------------------------------------------------------------- 00103 // Audio driver control functions. 00104 00105 int lscp_get_available_audio_drivers (lscp_client_t *pClient); 00106 const char ** lscp_list_available_audio_drivers (lscp_client_t *pClient); 00107 00108 lscp_driver_info_t * lscp_get_audio_driver_info (lscp_client_t *pClient, const char *pszAudioDriver); 00109 lscp_param_info_t * lscp_get_audio_driver_param_info(lscp_client_t *pClient, const char *pszAudioDriver, const char *pszParam, lscp_param_t *pDepList); 00110 00111 //------------------------------------------------------------------------- 00112 // Audio device control functions. 00113 00114 int lscp_create_audio_device (lscp_client_t *pClient, const char *pszAudioDriver, lscp_param_t *pParams); 00115 lscp_status_t lscp_destroy_audio_device (lscp_client_t *pClient, int iAudioDevice); 00116 00117 int lscp_get_audio_devices (lscp_client_t *pClient); 00118 int * lscp_list_audio_devices (lscp_client_t *pClient); 00119 lscp_device_info_t * lscp_get_audio_device_info (lscp_client_t *pClient, int iAudioDevice); 00120 lscp_status_t lscp_set_audio_device_param (lscp_client_t *pClient, int iAudioDevice, lscp_param_t *pParam); 00121 00122 lscp_device_port_info_t *lscp_get_audio_channel_info (lscp_client_t *pClient, int iAudioDevice, int iAudioChannel); 00123 00124 lscp_param_info_t * lscp_get_audio_channel_param_info (lscp_client_t *pClient, int iAudioDevice, int iAudioChannel, const char *pszParam); 00125 lscp_status_t lscp_set_audio_channel_param (lscp_client_t *pClient, int iAudioDevice, int iAudioChannel, lscp_param_t *pParam); 00126 00127 00128 //------------------------------------------------------------------------- 00129 // MIDI driver control functions. 00130 00131 int lscp_get_available_midi_drivers (lscp_client_t *pClient); 00132 const char ** lscp_list_available_midi_drivers(lscp_client_t *pClient); 00133 00134 lscp_driver_info_t * lscp_get_midi_driver_info (lscp_client_t *pClient, const char *pszMidiDriver); 00135 lscp_param_info_t * lscp_get_midi_driver_param_info (lscp_client_t *pClient, const char *pszMidiDriver, const char *pszParam, lscp_param_t *pDepList); 00136 00137 //------------------------------------------------------------------------- 00138 // MIDI device control functions. 00139 00140 int lscp_create_midi_device (lscp_client_t *pClient, const char *pszMidiDriver, lscp_param_t *pParams); 00141 lscp_status_t lscp_destroy_midi_device (lscp_client_t *pClient, int iMidiDevice); 00142 00143 int lscp_get_midi_devices (lscp_client_t *pClient); 00144 int * lscp_list_midi_devices (lscp_client_t *pClient); 00145 lscp_device_info_t * lscp_get_midi_device_info (lscp_client_t *pClient, int iMidiDevice); 00146 lscp_status_t lscp_set_midi_device_param (lscp_client_t *pClient, int iMidiDevice, lscp_param_t *pParam); 00147 00148 lscp_device_port_info_t *lscp_get_midi_port_info (lscp_client_t *pClient, int iMidiDevice, int iMidiPort); 00149 00150 lscp_param_info_t * lscp_get_midi_port_param_info (lscp_client_t *pClient, int iMidiDevice, int iMidiPort, const char *pszParam); 00151 lscp_status_t lscp_set_midi_port_param (lscp_client_t *pClient, int iMidiDevice, int iMidiPort, lscp_param_t *pParam); 00152 00153 //------------------------------------------------------------------------- 00154 // Generic parameter list functions. 00155 00156 const char * lscp_get_param_value (lscp_param_t *pParams, const char *pszParam); 00157 00158 00159 #if defined(__cplusplus) 00160 } 00161 #endif 00162 00163 #endif // __LSCP_DEVICE_H 00164 00165 // end of device.h