root/branches/freebob-syt-experiments/libfreebob/freebob.h

Revision 185, 4.8 kB (checked in by wagi, 16 years ago)

CVS-SVN migration developer public sync patch

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 /* freebob.h
2  * Copyright (C) 2005 Pieter Palmers
3  * Copyright (C) 2006 Daniel Wagner
4  *
5  * This file is part of FreeBoB
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., 51 Franklin Street, Fifth Floor, Boston,
20  * MA 02110-1301 USA
21  */
22
23 #ifndef FREEBOB_H
24 #define FREEBOB_H
25
26 #define FREEBOB_MAX_NAME_LEN 256
27
28 #define FREEBOB_BOUNCE_SERVER_VENDORNAME  "FreeBoB Server"
29 #define FREEBOB_BOUNCE_SERVER_MODELNAME   "freebob-server"
30
31 enum freebob_direction {
32     FREEBOB_CAPTURE  = 0,
33     FREEBOB_PLAYBACK = 1,
34 };
35
36 typedef struct freebob_handle* freebob_handle_t;
37
38 /*
39  * Buffer specification
40  */
41 typedef struct _freebob_stream_spec freebob_stream_spec_t;
42 typedef struct _freebob_stream_info freebob_stream_info_t;
43 typedef struct _freebob_connection_spec freebob_connection_spec_t;
44 typedef struct _freebob_connection_info freebob_connection_info_t;
45 typedef struct _freebob_supported_stream_format_spec freebob_supported_stream_format_spec_t;
46 typedef struct _freebob_supported_stream_format_info freebob_supported_stream_format_info_t;
47
48 /*
49  * Stream specification
50  */
51 struct _freebob_stream_spec {
52     int location;
53     int position;
54     int format;
55     int type;
56     int destination_port;
57     char name[FREEBOB_MAX_NAME_LEN];
58 };
59
60 struct _freebob_stream_info {
61     int nb_streams;
62     freebob_stream_spec_t** streams;
63 };
64
65 /*
66  * Connection specification
67  */
68 struct _freebob_connection_spec {
69     int id;
70     int port;
71     int node;
72     int plug;
73     int dimension;  /* due to the midi stuff, the dimension isn't equal */
74                     /* to the number of streams */
75     int samplerate; /* this should be equal for all connections when */
76                     /* using jack. maybe not when using other api's */
77     int iso_channel;
78     enum freebob_direction direction;
79     int is_master;
80     freebob_stream_info_t* stream_info;
81 };
82
83 /*
84  * topology info
85  */
86 struct _freebob_connection_info {
87     int direction;
88     int nb_connections;
89     freebob_connection_spec_t** connections;
90 };
91
92 /*
93  * Supported stream formats
94  */
95 struct _freebob_supported_stream_format_spec {
96     int samplerate;
97     int nb_audio_channels;
98     int nb_midi_channels;
99 };
100
101 struct _freebob_supported_stream_format_info {
102     int direction;
103     int nb_formats;
104     freebob_supported_stream_format_spec_t** formats;
105 };
106
107
108 #ifdef __cplusplus
109 extern "C" {
110 #endif
111
112 freebob_handle_t
113 freebob_new_handle( int port );
114
115 int
116 freebob_destroy_handle( freebob_handle_t freebob_handle );
117
118 int
119 freebob_discover_devices( freebob_handle_t freebob_handle, int verbose_level );
120
121
122 freebob_connection_info_t*
123 freebob_get_connection_info( freebob_handle_t freebob_handle,
124                              int node_id,
125                              enum freebob_direction direction );
126
127 freebob_supported_stream_format_info_t*
128 freebob_get_supported_stream_format_info( freebob_handle_t freebob_handle,
129                                           int node_id,
130                                           enum freebob_direction direction );
131
132 void
133 freebob_free_connection_info( freebob_connection_info_t* connection_info );
134 void
135 freebob_free_connection_spec( freebob_connection_spec_t* connection_spec );
136 void
137 freebob_free_stream_info( freebob_stream_info_t* stream_info );
138 void
139 freebob_free_stream_spec( freebob_stream_spec_t* stream_spec );
140 void
141 freebob_free_supported_stream_format_info( freebob_supported_stream_format_info_t* stream_info );
142 void
143 freebob_free_supported_stream_format_spec( freebob_supported_stream_format_spec_t* stream_spec );
144
145
146
147 void
148 freebob_print_connection_info( freebob_connection_info_t* connection_info );
149 void
150 freebob_print_supported_stream_format_info( freebob_supported_stream_format_info_t* stream_info );
151
152 int freebob_node_is_valid_freebob_device(freebob_handle_t fb_handle, int node_id);
153 int freebob_get_nb_devices_on_bus(freebob_handle_t fb_handle);
154
155 int freebob_get_device_node_id(freebob_handle_t fb_handle, int device_nr);
156 int freebob_set_samplerate(freebob_handle_t freebob_handle, int node_id, int samplerate);
157
158 /* debug function */
159 void
160 freebob_print_xml_description( freebob_handle_t freebob_handle,
161                                int node_id,
162                                enum freebob_direction direction );
163
164 const char*
165 freebob_get_version();
166
167 /* various function */
168
169 /* workaround: wait usec after each AVC command.
170    will disapear as soon bug is fixed */   
171 void freebob_sleep_after_avc_command( int time );
172
173 #ifdef __cplusplus
174 }
175 #endif
176
177 #endif /* FREEBOB_H */
Note: See TracBrowser for help on using the browser.