/[svn]/liblscp/trunk/lscp/device.h
ViewVC logotype

Annotation of /liblscp/trunk/lscp/device.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 952 - (hide annotations) (download) (as text)
Tue Nov 28 22:46:32 2006 UTC (17 years, 4 months ago) by capela
File MIME type: text/x-c++hdr
File size: 6095 byte(s)
Code cleanup; preparations for 0.4.1 release (hopefully).

1 capela 103 // device.h
2     //
3     /****************************************************************************
4     liblscp - LinuxSampler Control Protocol API
5 capela 869 Copyright (C) 2004-2006, rncbc aka Rui Nuno Capela. All rights reserved.
6 capela 103
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 capela 921 You should have received a copy of the GNU General Public License along
18     with this program; if not, write to the Free Software Foundation, Inc.,
19     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 capela 103
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 capela 952 LSCP_TYPE_NONE = 0,
40     LSCP_TYPE_BOOL,
41     LSCP_TYPE_INT,
42     LSCP_TYPE_FLOAT,
43     LSCP_TYPE_STRING
44 capela 103
45     } lscp_type_t;
46    
47    
48     /** Common and simple key/value pair parameter tuple. */
49     typedef struct _lscp_param_t
50     {
51 capela 952 char * key;
52     char * value;
53 capela 103
54     } lscp_param_t;
55    
56    
57     /** Common parameter info cache struct. */
58     typedef struct _lscp_param_info_t
59     {
60 capela 952 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 capela 103
71     } lscp_param_info_t;
72    
73    
74     /** Common driver type info cache struct. */
75     typedef struct _lscp_driver_info_t
76     {
77 capela 952 char * description;
78     char * version;
79     char ** parameters;
80 capela 103
81     } lscp_driver_info_t;
82    
83    
84     /** Common device info cache struct. */
85     typedef struct _lscp_device_info_t
86     {
87 capela 952 char * driver;
88     lscp_param_t *params;
89 capela 103
90     } lscp_device_info_t;
91    
92    
93 capela 171 /** Common device channel/port info cache struct. */
94     typedef struct _lscp_device_port_info_t
95 capela 103 {
96 capela 952 char * name;
97     lscp_param_t *params;
98 capela 103
99 capela 171 } lscp_device_port_info_t;
100 capela 103
101    
102     //-------------------------------------------------------------------------
103     // Audio driver control functions.
104    
105 capela 523 int lscp_get_available_audio_drivers (lscp_client_t *pClient);
106     const char ** lscp_list_available_audio_drivers (lscp_client_t *pClient);
107 capela 103
108     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);
110    
111     //-------------------------------------------------------------------------
112     // Audio device control functions.
113    
114     int lscp_create_audio_device (lscp_client_t *pClient, const char *pszAudioDriver, lscp_param_t *pParams);
115     lscp_status_t lscp_destroy_audio_device (lscp_client_t *pClient, int iAudioDevice);
116    
117 capela 125 int lscp_get_audio_devices (lscp_client_t *pClient);
118     int * lscp_list_audio_devices (lscp_client_t *pClient);
119 capela 103 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);
121    
122 capela 171 lscp_device_port_info_t *lscp_get_audio_channel_info (lscp_client_t *pClient, int iAudioDevice, int iAudioChannel);
123 capela 103
124     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);
126    
127    
128     //-------------------------------------------------------------------------
129     // MIDI driver control functions.
130    
131 capela 523 int lscp_get_available_midi_drivers (lscp_client_t *pClient);
132     const char ** lscp_list_available_midi_drivers(lscp_client_t *pClient);
133 capela 103
134     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);
136    
137     //-------------------------------------------------------------------------
138     // MIDI device control functions.
139    
140     int lscp_create_midi_device (lscp_client_t *pClient, const char *pszMidiDriver, lscp_param_t *pParams);
141     lscp_status_t lscp_destroy_midi_device (lscp_client_t *pClient, int iMidiDevice);
142    
143 capela 125 int lscp_get_midi_devices (lscp_client_t *pClient);
144     int * lscp_list_midi_devices (lscp_client_t *pClient);
145 capela 103 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);
147    
148 capela 171 lscp_device_port_info_t *lscp_get_midi_port_info (lscp_client_t *pClient, int iMidiDevice, int iMidiPort);
149 capela 103
150     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);
152    
153 capela 189 //-------------------------------------------------------------------------
154     // Generic parameter list functions.
155 capela 103
156 capela 189 const char * lscp_get_param_value (lscp_param_t *pParams, const char *pszParam);
157    
158    
159 capela 103 #if defined(__cplusplus)
160     }
161     #endif
162    
163     #endif // __LSCP_DEVICE_H
164    
165     // end of device.h

  ViewVC Help
Powered by ViewVC