root/trunk/libfreebob/libfreebob/freebob.h

Revision 183, 4.6 kB (checked in by wagi, 17 years ago)

2006-03-30 Daniel Wagner <wagi@monom.org>

  • configure.ac: Version bump to 0.6.0
  • src/*: Verbose bool turned int verbose level.
  • src/libfreebobavc/*: Moved fire implementation to
    base class (AVCCommand).
  • libfreebob/freebob.h: freebob_sleep_after_avc_command
    workaround added.
  • tests/test-freebob.c: Verbose bool turned into verbose level.
    Workaround: sleep after avc command added.
  • tests/streaming/Makefile.am (*_SOURCES): Added libavc1394 to LDADD.
  • tests/Makefile.am (*_SOURCES): Likewise.
  • tests/streaming/teststreaming2.c (fid_in): compiler warning fixed.
  • 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  *
4  * This file is part of FreeBoB
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19  * MA 02110-1301 USA
20  */
21
22 #ifndef FREEBOB_H
23 #define FREEBOB_H
24
25 #define FREEBOB_MAX_NAME_LEN 256
26
27 enum freebob_direction {
28     FREEBOB_CAPTURE  = 0,
29     FREEBOB_PLAYBACK = 1,
30 };
31
32 typedef struct freebob_handle* freebob_handle_t;
33
34 /*
35  * Buffer specification
36  */
37 typedef struct _freebob_stream_spec freebob_stream_spec_t;
38 typedef struct _freebob_stream_info freebob_stream_info_t;
39 typedef struct _freebob_connection_spec freebob_connection_spec_t;
40 typedef struct _freebob_connection_info freebob_connection_info_t;
41 typedef struct _freebob_supported_stream_format_spec freebob_supported_stream_format_spec_t;
42 typedef struct _freebob_supported_stream_format_info freebob_supported_stream_format_info_t;
43
44 /*
45  * Stream specification
46  */
47 struct _freebob_stream_spec {
48     int location;
49     int position;
50     int format;
51     int type;
52     int destination_port;
53     char name[FREEBOB_MAX_NAME_LEN];
54 };
55
56 struct _freebob_stream_info {
57     int nb_streams;
58     freebob_stream_spec_t** streams;
59 };
60
61 /*
62  * Connection specification
63  */
64 struct _freebob_connection_spec {
65     int id;
66     int port;
67     int node;
68     int plug;
69     int dimension;  /* due to the midi stuff, the dimension isn't equal */
70                     /* to the number of streams */
71     int samplerate; /* this should be equal for all connections when */
72                     /* using jack. maybe not when using other api's */
73     int iso_channel;
74     enum freebob_direction direction;
75     int is_master;
76     freebob_stream_info_t* stream_info;
77 };
78
79 /*
80  * topology info
81  */
82 struct _freebob_connection_info {
83     int direction;
84     int nb_connections;
85     freebob_connection_spec_t** connections;
86 };
87
88 /*
89  * Supported stream formats
90  */
91 struct _freebob_supported_stream_format_spec {
92     int samplerate;
93     int nb_audio_channels;
94     int nb_midi_channels;
95 };
96
97 struct _freebob_supported_stream_format_info {
98     int direction;
99     int nb_formats;
100     freebob_supported_stream_format_spec_t** formats;
101 };
102
103
104 #ifdef __cplusplus
105 extern "C" {
106 #endif
107
108 freebob_handle_t
109 freebob_new_handle( int port );
110
111 int
112 freebob_destroy_handle( freebob_handle_t freebob_handle );
113
114 int
115 freebob_discover_devices( freebob_handle_t freebob_handle, int verbose_level );
116
117
118 freebob_connection_info_t*
119 freebob_get_connection_info( freebob_handle_t freebob_handle,
120                              int node_id,
121                              enum freebob_direction direction );
122
123 freebob_supported_stream_format_info_t*
124 freebob_get_supported_stream_format_info( freebob_handle_t freebob_handle,
125                                           int node_id,
126                                           enum freebob_direction direction );
127
128 void
129 freebob_free_connection_info( freebob_connection_info_t* connection_info );
130 void
131 freebob_free_connection_spec( freebob_connection_spec_t* connection_spec );
132 void
133 freebob_free_stream_info( freebob_stream_info_t* stream_info );
134 void
135 freebob_free_stream_spec( freebob_stream_spec_t* stream_spec );
136 void
137 freebob_free_supported_stream_format_info( freebob_supported_stream_format_info_t* stream_info );
138 void
139 freebob_free_supported_stream_format_spec( freebob_supported_stream_format_spec_t* stream_spec );
140
141
142
143 void
144 freebob_print_connection_info( freebob_connection_info_t* connection_info );
145 void
146 freebob_print_supported_stream_format_info( freebob_supported_stream_format_info_t* stream_info );
147
148 int freebob_node_is_valid_freebob_device(freebob_handle_t fb_handle, int node_id);
149 int freebob_get_nb_devices_on_bus(freebob_handle_t fb_handle);
150
151 int freebob_get_device_node_id(freebob_handle_t fb_handle, int device_nr);
152 int freebob_set_samplerate(freebob_handle_t freebob_handle, int node_id, int samplerate);
153
154 /* debug function */
155 void
156 freebob_print_xml_description( freebob_handle_t freebob_handle,
157                                int node_id,
158                                enum freebob_direction direction );
159
160 const char*
161 freebob_get_version();
162
163 /* various function */
164
165 /* workaround: wait usec after each AVC command.
166    will disapear as soon bug is fixed */   
167 void freebob_sleep_after_avc_command( int time );
168
169 #ifdef __cplusplus
170 }
171 #endif
172
173 #endif /* FREEBOB_H */
Note: See TracBrowser for help on using the browser.