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 |
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 |
|
|
36 |
/** Parameter value type. */ |
/** Parameter value type. */ |
37 |
typedef enum _lscp_type_t |
typedef enum _lscp_type_t |
38 |
{ |
{ |
39 |
LSCP_TYPE_BOOL = 0, |
LSCP_TYPE_NONE = 0, |
40 |
|
LSCP_TYPE_BOOL, |
41 |
LSCP_TYPE_INT, |
LSCP_TYPE_INT, |
42 |
LSCP_TYPE_FLOAT, |
LSCP_TYPE_FLOAT, |
43 |
LSCP_TYPE_STRING |
LSCP_TYPE_STRING |
45 |
} lscp_type_t; |
} lscp_type_t; |
46 |
|
|
47 |
|
|
|
/** Parameter value union type. */ |
|
|
typedef union _lscp_value_t |
|
|
{ |
|
|
int i; |
|
|
float f; |
|
|
char *psz; |
|
|
|
|
|
} lscp_value_t; |
|
|
|
|
|
|
|
48 |
/** Common and simple key/value pair parameter tuple. */ |
/** Common and simple key/value pair parameter tuple. */ |
49 |
typedef struct _lscp_param_t |
typedef struct _lscp_param_t |
50 |
{ |
{ |
51 |
char * key; |
char * key; |
52 |
lscp_value_t value; |
char * value; |
53 |
|
|
54 |
} lscp_param_t; |
} lscp_param_t; |
55 |
|
|
63 |
int fix; |
int fix; |
64 |
int multiplicity; |
int multiplicity; |
65 |
char ** depends; |
char ** depends; |
66 |
lscp_value_t defaultv; |
char * defaultv; |
67 |
lscp_value_t range_min; |
char * range_min; |
68 |
lscp_value_t range_max; |
char * range_max; |
69 |
char ** possibilities; |
char ** possibilities; |
70 |
|
|
71 |
} lscp_param_info_t; |
} lscp_param_info_t; |
85 |
typedef struct _lscp_device_info_t |
typedef struct _lscp_device_info_t |
86 |
{ |
{ |
87 |
char * driver; |
char * driver; |
88 |
lscp_param_t *parameters; |
lscp_param_t *params; |
89 |
|
|
90 |
} lscp_device_info_t; |
} lscp_device_info_t; |
91 |
|
|
92 |
|
|
93 |
/** Common device channel info cache struct. */ |
/** Common device channel/port info cache struct. */ |
94 |
typedef struct _lscp_device_channel_info_t |
typedef struct _lscp_device_port_info_t |
95 |
{ |
{ |
96 |
char * name; |
char * name; |
97 |
lscp_param_t *parameters; |
lscp_param_t *params; |
98 |
|
|
99 |
} lscp_device_channel_info_t; |
} lscp_device_port_info_t; |
100 |
|
|
101 |
|
|
102 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
103 |
// Audio driver control functions. |
// Audio driver control functions. |
104 |
|
|
105 |
const char ** lscp_get_available_audio_drivers(lscp_client_t *pClient); |
int lscp_get_available_audio_drivers (lscp_client_t *pClient); |
106 |
|
const char ** lscp_list_available_audio_drivers (lscp_client_t *pClient); |
107 |
|
|
108 |
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); |
109 |
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); |
119 |
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); |
120 |
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); |
121 |
|
|
122 |
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); |
123 |
|
|
124 |
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); |
125 |
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); |
128 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
129 |
// MIDI driver control functions. |
// MIDI driver control functions. |
130 |
|
|
131 |
const char ** lscp_get_available_midi_drivers (lscp_client_t *pClient); |
int lscp_get_available_midi_drivers (lscp_client_t *pClient); |
132 |
|
const char ** lscp_list_available_midi_drivers(lscp_client_t *pClient); |
133 |
|
|
134 |
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); |
135 |
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); |
145 |
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); |
146 |
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); |
147 |
|
|
148 |
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); |
149 |
|
|
150 |
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); |
151 |
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); |
152 |
|
|
153 |
|
//------------------------------------------------------------------------- |
154 |
|
// Generic parameter list functions. |
155 |
|
|
156 |
|
const char * lscp_get_param_value (lscp_param_t *pParams, const char *pszParam); |
157 |
|
|
158 |
|
|
159 |
#if defined(__cplusplus) |
#if defined(__cplusplus) |
160 |
} |
} |