00001 #ifndef foostreamhfoo
00002 #define foostreamhfoo
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #include <sys/types.h>
00029
00030 #include <pulse/sample.h>
00031 #include <pulse/channelmap.h>
00032 #include <pulse/volume.h>
00033 #include <pulse/def.h>
00034 #include <pulse/cdecl.h>
00035 #include <pulse/operation.h>
00036
00265 PA_C_DECL_BEGIN
00266
00268 typedef struct pa_stream pa_stream;
00269
00271 typedef void (*pa_stream_success_cb_t) (pa_stream*s, int success, void *userdata);
00272
00274 typedef void (*pa_stream_request_cb_t)(pa_stream *p, size_t bytes, void *userdata);
00275
00277 typedef void (*pa_stream_notify_cb_t)(pa_stream *p, void *userdata);
00278
00282 pa_stream* pa_stream_new(
00283 pa_context *c ,
00284 const char *name ,
00285 const pa_sample_spec *ss ,
00286 const pa_channel_map *map );
00287
00291 pa_stream* pa_stream_new_with_proplist(
00292 pa_context *c ,
00293 const char *name ,
00294 const pa_sample_spec *ss ,
00295 const pa_channel_map *map ,
00296 pa_proplist *p );
00297
00299 void pa_stream_unref(pa_stream *s);
00300
00302 pa_stream *pa_stream_ref(pa_stream *s);
00303
00305 pa_stream_state_t pa_stream_get_state(pa_stream *p);
00306
00308 pa_context* pa_stream_get_context(pa_stream *p);
00309
00314 uint32_t pa_stream_get_index(pa_stream *s);
00315
00324 uint32_t pa_stream_get_device_index(pa_stream *s);
00325
00334 const char *pa_stream_get_device_name(pa_stream *s);
00335
00340 int pa_stream_is_suspended(pa_stream *s);
00341
00344 int pa_stream_is_corked(pa_stream *s);
00345
00347 int pa_stream_connect_playback(
00348 pa_stream *s ,
00349 const char *dev ,
00350 const pa_buffer_attr *attr ,
00351 pa_stream_flags_t flags ,
00352 pa_cvolume *volume ,
00353 pa_stream *sync_stream );
00354
00356 int pa_stream_connect_record(
00357 pa_stream *s ,
00358 const char *dev ,
00359 const pa_buffer_attr *attr ,
00360 pa_stream_flags_t flags );
00361
00363 int pa_stream_disconnect(pa_stream *s);
00364
00372 int pa_stream_write(
00373 pa_stream *p ,
00374 const void *data ,
00375 size_t nbytes ,
00376 pa_free_cb_t free_cb ,
00377 int64_t offset,
00378 pa_seek_mode_t seek );
00379
00385 int pa_stream_peek(
00386 pa_stream *p ,
00387 const void **data ,
00388 size_t *nbytes );
00389
00392 int pa_stream_drop(pa_stream *p);
00393
00395 size_t pa_stream_writable_size(pa_stream *p);
00396
00398 size_t pa_stream_readable_size(pa_stream *p);
00399
00401 pa_operation* pa_stream_drain(pa_stream *s, pa_stream_success_cb_t cb, void *userdata);
00402
00407 pa_operation* pa_stream_update_timing_info(pa_stream *p, pa_stream_success_cb_t cb, void *userdata);
00408
00410 void pa_stream_set_state_callback(pa_stream *s, pa_stream_notify_cb_t cb, void *userdata);
00411
00414 void pa_stream_set_write_callback(pa_stream *p, pa_stream_request_cb_t cb, void *userdata);
00415
00418 void pa_stream_set_read_callback(pa_stream *p, pa_stream_request_cb_t cb, void *userdata);
00419
00421 void pa_stream_set_overflow_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata);
00422
00424 void pa_stream_set_underflow_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata);
00425
00431 void pa_stream_set_started_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata);
00432
00436 void pa_stream_set_latency_update_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata);
00437
00443 void pa_stream_set_moved_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata);
00444
00453 void pa_stream_set_suspended_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata);
00454
00456 pa_operation* pa_stream_cork(pa_stream *s, int b, pa_stream_success_cb_t cb, void *userdata);
00457
00462 pa_operation* pa_stream_flush(pa_stream *s, pa_stream_success_cb_t cb, void *userdata);
00463
00466 pa_operation* pa_stream_prebuf(pa_stream *s, pa_stream_success_cb_t cb, void *userdata);
00467
00471 pa_operation* pa_stream_trigger(pa_stream *s, pa_stream_success_cb_t cb, void *userdata);
00472
00474 pa_operation* pa_stream_set_name(pa_stream *s, const char *name, pa_stream_success_cb_t cb, void *userdata);
00475
00491 int pa_stream_get_time(pa_stream *s, pa_usec_t *r_usec);
00492
00497 int pa_stream_get_latency(pa_stream *s, pa_usec_t *r_usec, int *negative);
00498
00509 const pa_timing_info* pa_stream_get_timing_info(pa_stream *s);
00510
00512 const pa_sample_spec* pa_stream_get_sample_spec(pa_stream *s);
00513
00515 const pa_channel_map* pa_stream_get_channel_map(pa_stream *s);
00516
00520 const pa_buffer_attr* pa_stream_get_buffer_attr(pa_stream *s);
00521
00528 pa_operation *pa_stream_set_buffer_attr(pa_stream *s, const pa_buffer_attr *attr, pa_stream_success_cb_t cb, void *userdata);
00529
00530
00531
00532
00533
00534
00535 pa_operation *pa_stream_update_sample_rate(pa_stream *s, uint32_t rate, pa_stream_success_cb_t cb, void *userdata);
00536
00537
00538
00539
00540
00541
00542
00543 pa_operation *pa_stream_proplist_update(pa_stream *s, pa_update_mode_t mode, pa_proplist *p, pa_stream_success_cb_t cb, void *userdata);
00544
00545
00546
00547 pa_operation *pa_stream_proplist_remove(pa_stream *s, const char *const keys[], pa_stream_success_cb_t cb, void *userdata);
00548
00549 PA_C_DECL_END
00550
00551 #endif