1 |
// device.h |
2 |
// |
3 |
/**************************************************************************** |
4 |
liblscp - LinuxSampler Control Protocol API |
5 |
Copyright (C) 2004, rncbc aka Rui Nuno Capela. All rights reserved. |
6 |
|
7 |
This library is free software; you can redistribute it and/or |
8 |
modify it under the terms of the GNU Lesser General Public |
9 |
License as published by the Free Software Foundation; either |
10 |
version 2.1 of the License, or (at your option) any later version. |
11 |
|
12 |
This library is distributed in the hope that it will be useful, |
13 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 |
Lesser General Public License for more details. |
16 |
|
17 |
You should have received a copy of the GNU Lesser General Public |
18 |
License along with this library; if not, write to the Free Software |
19 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
20 |
|
21 |
*****************************************************************************/ |
22 |
|
23 |
#ifndef __LSCP_DEVICE_H |
24 |
#define __LSCP_DEVICE_H |
25 |
|
26 |
#include "lscp/client.h" |
27 |
|
28 |
#if defined(__cplusplus) |
29 |
extern "C" { |
30 |
#endif |
31 |
|
32 |
|
33 |
//------------------------------------------------------------------------- |
34 |
// Device driver information structures. |
35 |
|
36 |
/** Parameter value type. */ |
37 |
typedef enum _lscp_type_t |
38 |
{ |
39 |
LSCP_TYPE_NONE = 0, |
40 |
LSCP_TYPE_BOOL, |
41 |
LSCP_TYPE_INT, |
42 |
LSCP_TYPE_FLOAT, |
43 |
LSCP_TYPE_STRING |
44 |
|
45 |
} lscp_type_t; |
46 |
|
47 |
|
48 |
/** Common and simple key/value pair parameter tuple. */ |
49 |
typedef struct _lscp_param_t |
50 |
{ |
51 |
char * key; |
52 |
char * value; |
53 |
|
54 |
} lscp_param_t; |
55 |
|
56 |
|
57 |
/** Common parameter info cache struct. */ |
58 |
typedef struct _lscp_param_info_t |
59 |
{ |
60 |
lscp_type_t type; |
61 |
char * description; |
62 |
int mandatory; |
63 |
int fix; |
64 |
int multiplicity; |
65 |
char ** depends; |
66 |
char * defaultv; |
67 |
char * range_min; |
68 |
char * range_max; |
69 |
char ** possibilities; |
70 |
|
71 |
} lscp_param_info_t; |
72 |
|
73 |
|
74 |
/** Common driver type info cache struct. */ |
75 |
typedef struct _lscp_driver_info_t |
76 |
{ |
77 |
char * description; |
78 |
char * version; |
79 |
char ** parameters; |
80 |
|
81 |
} lscp_driver_info_t; |
82 |
|
83 |
|
84 |
/** Common device info cache struct. */ |
85 |
typedef struct _lscp_device_info_t |
86 |
{ |
87 |
char * driver; |
88 |
lscp_param_t *parameters; |
89 |
|
90 |
} lscp_device_info_t; |
91 |
|
92 |
|
93 |
/** Common device channel info cache struct. */ |
94 |
typedef struct _lscp_device_channel_info_t |
95 |
{ |
96 |
char * name; |
97 |
lscp_param_t *parameters; |
98 |
|
99 |
} lscp_device_channel_info_t; |
100 |
|
101 |
|
102 |
//------------------------------------------------------------------------- |
103 |
// Audio driver control functions. |
104 |
|
105 |
const char ** lscp_get_available_audio_drivers(lscp_client_t *pClient); |
106 |
|
107 |
lscp_driver_info_t * lscp_get_audio_driver_info (lscp_client_t *pClient, const char *pszAudioDriver); |
108 |
lscp_param_info_t * lscp_get_audio_driver_param_info(lscp_client_t *pClient, const char *pszAudioDriver, const char *pszParam, lscp_param_t *pDepList); |
109 |
|
110 |
//------------------------------------------------------------------------- |
111 |
// Audio device control functions. |
112 |
|
113 |
int lscp_create_audio_device (lscp_client_t *pClient, const char *pszAudioDriver, lscp_param_t *pParams); |
114 |
lscp_status_t lscp_destroy_audio_device (lscp_client_t *pClient, int iAudioDevice); |
115 |
|
116 |
int lscp_get_audio_devices (lscp_client_t *pClient); |
117 |
int * lscp_list_audio_devices (lscp_client_t *pClient); |
118 |
lscp_device_info_t * lscp_get_audio_device_info (lscp_client_t *pClient, int iAudioDevice); |
119 |
lscp_status_t lscp_set_audio_device_param (lscp_client_t *pClient, int iAudioDevice, lscp_param_t *pParam); |
120 |
|
121 |
lscp_device_channel_info_t *lscp_get_audio_channel_info (lscp_client_t *pClient, int iAudioDevice, int iAudioChannel ); |
122 |
|
123 |
lscp_param_info_t * lscp_get_audio_channel_param_info (lscp_client_t *pClient, int iAudioDevice, int iAudioChannel, const char *pszParam); |
124 |
lscp_status_t lscp_set_audio_channel_param (lscp_client_t *pClient, int iAudioDevice, int iAudioChannel, lscp_param_t *pParam); |
125 |
|
126 |
|
127 |
//------------------------------------------------------------------------- |
128 |
// MIDI driver control functions. |
129 |
|
130 |
const char ** lscp_get_available_midi_drivers (lscp_client_t *pClient); |
131 |
|
132 |
lscp_driver_info_t * lscp_get_midi_driver_info (lscp_client_t *pClient, const char *pszMidiDriver); |
133 |
lscp_param_info_t * lscp_get_midi_driver_param_info (lscp_client_t *pClient, const char *pszMidiDriver, const char *pszParam, lscp_param_t *pDepList); |
134 |
|
135 |
//------------------------------------------------------------------------- |
136 |
// MIDI device control functions. |
137 |
|
138 |
int lscp_create_midi_device (lscp_client_t *pClient, const char *pszMidiDriver, lscp_param_t *pParams); |
139 |
lscp_status_t lscp_destroy_midi_device (lscp_client_t *pClient, int iMidiDevice); |
140 |
|
141 |
int lscp_get_midi_devices (lscp_client_t *pClient); |
142 |
int * lscp_list_midi_devices (lscp_client_t *pClient); |
143 |
lscp_device_info_t * lscp_get_midi_device_info (lscp_client_t *pClient, int iMidiDevice); |
144 |
lscp_status_t lscp_set_midi_device_param (lscp_client_t *pClient, int iMidiDevice, lscp_param_t *pParam); |
145 |
|
146 |
lscp_device_channel_info_t *lscp_get_midi_port_info (lscp_client_t *pClient, int iMidiDevice, int iMidiPort); |
147 |
|
148 |
lscp_param_info_t * lscp_get_midi_port_param_info (lscp_client_t *pClient, int iMidiDevice, int iMidiPort, const char *pszParam); |
149 |
lscp_status_t lscp_set_midi_port_param (lscp_client_t *pClient, int iMidiDevice, int iMidiPort, lscp_param_t *pParam); |
150 |
|
151 |
|
152 |
#if defined(__cplusplus) |
153 |
} |
154 |
#endif |
155 |
|
156 |
#endif // __LSCP_DEVICE_H |
157 |
|
158 |
// end of device.h |