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 |
|
---|
42 |
/* |
---|
43 |
* Stream specification |
---|
44 |
*/ |
---|
45 |
struct _freebob_stream_spec { |
---|
46 |
int location; |
---|
47 |
int position; |
---|
48 |
int format; |
---|
49 |
int type; |
---|
50 |
int destination_port; |
---|
51 |
char name[FREEBOB_MAX_NAME_LEN]; |
---|
52 |
}; |
---|
53 |
|
---|
54 |
struct _freebob_stream_info { |
---|
55 |
int nb_streams; |
---|
56 |
freebob_stream_spec_t** streams; |
---|
57 |
}; |
---|
58 |
|
---|
59 |
/* |
---|
60 |
* Connection specification |
---|
61 |
*/ |
---|
62 |
struct _freebob_connection_spec { |
---|
63 |
int id; |
---|
64 |
int port; |
---|
65 |
int node; |
---|
66 |
int plug; |
---|
67 |
int dimension; /* due to the midi stuff, the dimension isn't equal */ |
---|
68 |
/* to the number of streams */ |
---|
69 |
int samplerate; /* this should be equal for all connections when */ |
---|
70 |
/* using jack. maybe not when using other api's */ |
---|
71 |
int iso_channel; |
---|
72 |
enum freebob_direction direction; |
---|
73 |
int is_master; |
---|
74 |
freebob_stream_info_t* stream_info; |
---|
75 |
}; |
---|
76 |
|
---|
77 |
/* |
---|
78 |
* topology info |
---|
79 |
*/ |
---|
80 |
struct _freebob_connection_info { |
---|
81 |
int direction; |
---|
82 |
int nb_connections; |
---|
83 |
freebob_connection_spec_t** connections; |
---|
84 |
}; |
---|
85 |
|
---|
86 |
|
---|
87 |
#ifdef __cplusplus |
---|
88 |
extern "C" { |
---|
89 |
#endif |
---|
90 |
|
---|
91 |
freebob_handle_t |
---|
92 |
freebob_new_handle( int port ); |
---|
93 |
|
---|
94 |
int |
---|
95 |
freebob_destroy_handle( freebob_handle_t freebob_handle ); |
---|
96 |
|
---|
97 |
int |
---|
98 |
freebob_discover_devices( freebob_handle_t freebob_handle ); |
---|
99 |
|
---|
100 |
|
---|
101 |
freebob_connection_info_t* |
---|
102 |
freebob_get_connection_info( freebob_handle_t freebob_handle, |
---|
103 |
int node_id, |
---|
104 |
enum freebob_direction direction ); |
---|
105 |
|
---|
106 |
void |
---|
107 |
freebob_free_connection_info( freebob_connection_info_t* connection_info ); |
---|
108 |
void |
---|
109 |
freebob_free_connection_spec( freebob_connection_spec_t* connection_spec ); |
---|
110 |
void |
---|
111 |
freebob_free_stream_info( freebob_stream_info_t* stream_info ); |
---|
112 |
void |
---|
113 |
freebob_free_stream_spec( freebob_stream_spec_t* stream_spec ); |
---|
114 |
|
---|
115 |
void |
---|
116 |
freebob_print_connection_info( freebob_connection_info_t* connection_info ); |
---|
117 |
|
---|
118 |
const char* |
---|
119 |
freebob_get_version(); |
---|
120 |
|
---|
121 |
#ifdef __cplusplus |
---|
122 |
} |
---|
123 |
#endif |
---|
124 |
|
---|
125 |
#endif /* FREEBOB_H */ |
---|