00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef FFADO_H
00027 #define FFADO_H
00028
00029 #define FFADO_MAX_NAME_LEN 256
00030
00031 #include <stdlib.h>
00032
00033 #define FFADO_STREAMING_MAX_URL_LENGTH 2048
00034
00035 #define FFADO_IGNORE_CAPTURE (1<<0)
00036 #define FFADO_IGNORE_PLAYBACK (1<<1)
00037
00038 enum ffado_direction {
00039 FFADO_CAPTURE = 0,
00040 FFADO_PLAYBACK = 1,
00041 };
00042
00043 typedef struct ffado_handle* ffado_handle_t;
00044
00045 #ifdef __cplusplus
00046 extern "C" {
00047 #endif
00048
00049
00050 const char*
00051 ffado_get_version();
00052
00053 int
00054 ffado_get_api_version();
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087 typedef struct _ffado_device ffado_device_t;
00088
00093 typedef unsigned int ffado_sample_t;
00094 typedef unsigned int ffado_nframes_t;
00095
00096 #define FFADO_MAX_SPECSTRING_LENGTH 256
00097 #define FFADO_MAX_SPECSTRINGS 64
00098
00135 typedef struct ffado_device_info {
00136 unsigned int nb_device_spec_strings;
00137 char **device_spec_strings;
00138
00139
00140
00141 int32_t reserved[32];
00142 } ffado_device_info_t;
00143
00147 typedef struct ffado_options {
00148
00149 int32_t sample_rate;
00150
00151
00152
00153
00154 int32_t period_size;
00155
00156
00157
00158
00159 int32_t nb_buffers;
00160
00161
00162 int32_t realtime;
00163 int32_t packetizer_priority;
00164
00165
00166 int32_t verbose;
00167
00168
00169 int32_t slave_mode;
00170
00171 int32_t snoop_mode;
00172
00173
00174
00175 int32_t reserved[24];
00176
00177 } ffado_options_t;
00178
00194 typedef enum {
00195 ffado_stream_type_invalid = -1,
00196 ffado_stream_type_unknown = 0,
00197 ffado_stream_type_audio = 1,
00198 ffado_stream_type_midi = 2,
00199 ffado_stream_type_control = 3,
00200 } ffado_streaming_stream_type;
00201
00207 typedef enum {
00208 ffado_audio_datatype_error = -1,
00209 ffado_audio_datatype_int24 = 0,
00210 ffado_audio_datatype_float = 1,
00211 } ffado_streaming_audio_datatype;
00212
00218 typedef enum {
00219 ffado_wait_shutdown = -3,
00220 ffado_wait_error = -2,
00221 ffado_wait_xrun = -1,
00222 ffado_wait_ok = 0,
00223 } ffado_wait_response;
00224
00240 ffado_device_t *ffado_streaming_init(
00241 ffado_device_info_t device_info,
00242 ffado_options_t options);
00243
00251 int ffado_streaming_prepare(ffado_device_t *dev);
00252
00253
00260 void ffado_streaming_finish(ffado_device_t *dev);
00261
00270 int ffado_streaming_get_nb_capture_streams(ffado_device_t *dev);
00271
00280 int ffado_streaming_get_nb_playback_streams(ffado_device_t *dev);
00281
00292 int ffado_streaming_get_capture_stream_name(ffado_device_t *dev, int number, char* buffer, size_t buffersize);
00293
00304 int ffado_streaming_get_playback_stream_name(ffado_device_t *dev, int number, char* buffer, size_t buffersize);
00305
00314 ffado_streaming_stream_type ffado_streaming_get_capture_stream_type(ffado_device_t *dev, int number);
00315
00324 ffado_streaming_stream_type ffado_streaming_get_playback_stream_type(ffado_device_t *dev, int number);
00325
00326
00327
00328
00329
00330
00331
00346 int ffado_streaming_set_capture_stream_buffer(ffado_device_t *dev, int number, char *buff);
00347 int ffado_streaming_capture_stream_onoff(ffado_device_t *dev, int number, int on);
00348
00361 int ffado_streaming_set_playback_stream_buffer(ffado_device_t *dev, int number, char *buff);
00362 int ffado_streaming_playback_stream_onoff(ffado_device_t *dev, int number, int on);
00363
00364 ffado_streaming_audio_datatype ffado_streaming_get_audio_datatype(ffado_device_t *dev);
00365 int ffado_streaming_set_audio_datatype(ffado_device_t *dev, ffado_streaming_audio_datatype t);
00366
00375 int ffado_streaming_prepare(ffado_device_t *dev);
00376
00385 int ffado_streaming_start(ffado_device_t *dev);
00386
00395 int ffado_streaming_stop(ffado_device_t *dev);
00396
00407 int ffado_streaming_reset(ffado_device_t *dev);
00408
00417 ffado_wait_response ffado_streaming_wait(ffado_device_t *dev);
00418
00445 int ffado_streaming_transfer_buffers(ffado_device_t *dev);
00446
00464 int ffado_streaming_transfer_playback_buffers(ffado_device_t *dev);
00465
00483 int ffado_streaming_transfer_capture_buffers(ffado_device_t *dev);
00484
00485 #ifdef __cplusplus
00486 }
00487 #endif
00488
00489 #endif