From 08ee90ea2e6ea839846c5670afa9d1a19c20ba78 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sun, 13 May 2007 00:49:21 +0000 Subject: s/device/stream git-svn-id: file:///home/lennart/svn/public/libsydney/trunk@7 9ba3c220-e4d3-45a2-8aa3-73fcc9aff6ce --- sydney.h | 92 ++++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 46 insertions(+), 46 deletions(-) (limited to 'sydney.h') diff --git a/sydney.h b/sydney.h index ecb10bc..7c67f86 100644 --- a/sydney.h +++ b/sydney.h @@ -27,7 +27,7 @@ async-signal safe. # error "Cannot determine byte order!" #endif -typedef struct sa_device sa_device_t; +typedef struct sa_stream sa_stream_t; /** Volume that corresponds to muted in/out */ #define SA_VOLUME_MUTED 0x80000000 @@ -225,95 +225,95 @@ typedef enum { #define SA_META_XID "sydney.xid" /* X11 window id */ /** Main callback function */ -typedef int (*sa_event_callback_t)(sa_device_t *dev, sa_event_t event); +typedef int (*sa_event_callback_t)(sa_stream_t *dev, sa_event_t event); /** Create an opaque (e.g. AC3) codec stream */ -int sa_device_create_opaque(sa_device_t **dev, sa_mode_t mode, const char *codec); +int sa_stream_create_opaque(sa_stream_t **dev, sa_mode_t mode, const char *codec); /** Normal way to open a PCM device */ -int sa_device_create_pcm(sa_device_t **dev, sa_mode_t mode, sa_pcm_format_t format, unsigned rate, unsigned nchannels); +int sa_stream_create_pcm(sa_stream_t **dev, sa_mode_t mode, sa_pcm_format_t format, unsigned rate, unsigned nchannels); /** Initialise the device */ -int sa_device_open(sa_device_t *dev); +int sa_stream_open(sa_stream_t *dev); /** Close/destroy everything */ -int sa_device_destroy(sa_device_t *dev); +int sa_stream_destroy(sa_stream_t *dev); /* "Soft" params */ -int sa_device_set_write_lower_watermark(sa_device_t *dev, size_t size); -int sa_device_set_read_lower_watermark(sa_device_t *dev, size_t size); +int sa_stream_set_write_lower_watermark(sa_stream_t *dev, size_t size); +int sa_stream_set_read_lower_watermark(sa_stream_t *dev, size_t size); -int sa_device_set_write_upper_watermark(sa_device_t *dev, size_t size); -int sa_device_set_read_upper_watermark(sa_device_t *dev, size_t size); +int sa_stream_set_write_upper_watermark(sa_stream_t *dev, size_t size); +int sa_stream_set_read_upper_watermark(sa_stream_t *dev, size_t size); /** Set the mapping between channels and the loudspeakers */ -int sa_device_set_channel_map(sa_device_t *dev, const sa_channel_t map[]); +int sa_stream_set_channel_map(sa_stream_t *dev, const sa_channel_t map[]); /** Whether xruns cause the card to reset */ -int sa_device_set_xrun_mode(sa_device_t *dev, sa_xrun_mode_t mode); +int sa_stream_set_xrun_mode(sa_stream_t *dev, sa_xrun_mode_t mode); /** Set the device to non-interleaved mode */ -int sa_device_set_ni(sa_device_t *dev, int enable); +int sa_stream_set_ni(sa_stream_t *dev, int enable); /** Require dynamic sample rate */ -int sa_device_set_dynamic_rate(sa_device_t *dev, int enable); +int sa_stream_set_dynamic_rate(sa_stream_t *dev, int enable); /** Select driver */ -int sa_device_set_driver(sa_device_t *dev, const char *driver); +int sa_stream_set_driver(sa_stream_t *dev, const char *driver); /** Start callback */ -int sa_device_start_thread(sa_device_t *dev, sa_event_callback_t *callback); +int sa_stream_start_thread(sa_stream_t *dev, sa_event_callback_t *callback); /** Change the device connected to the stream */ -int sa_device_change_device(sa_device_t *dev, const char *device_name); +int sa_stream_change_device(sa_stream_t *dev, const char *device_name); /** volume in hundreths of dB*/ -int sa_device_change_input_volume(sa_device_t *dev, const int vol[]); +int sa_stream_change_input_volume(sa_stream_t *dev, const int vol[]); /** volume in hundreths of dB*/ -int sa_device_change_output_volume(sa_device_t *dev, const int vol[]); +int sa_stream_change_output_volume(sa_stream_t *dev, const int vol[]); /** Change the sampling rate */ -int sa_device_change_rate(sa_device_t *dev, unsigned rate); +int sa_stream_change_rate(sa_stream_t *dev, unsigned rate); /** Change some meta data that is attached to the stream */ -int sa_device_change_meta_data(sa_device_t *dev, const char *name, const void *data, size_t len); +int sa_stream_change_meta_data(sa_stream_t *dev, const char *name, const void *data, size_t len); /** Associate opaque user data */ -int sa_device_change_user_data(sa_device_t *dev, void *value); +int sa_stream_change_user_data(sa_stream_t *dev, void *value); /* Hardware-related. This is implementation-specific and hardware specific. */ -int sa_device_adjust_rate(sa_device_t *dev, sa_adjust_t direction); +int sa_stream_adjust_rate(sa_stream_t *dev, sa_adjust_t direction); -int sa_device_adjust_nchannels(sa_device_t *dev, sa_adjust_t direction); +int sa_stream_adjust_nchannels(sa_stream_t *dev, sa_adjust_t direction); -int sa_device_adjust_pcm_format(sa_device_t *dev, sa_adjust_t direction); +int sa_stream_adjust_pcm_format(sa_stream_t *dev, sa_adjust_t direction); /* Query functions */ /** Get current state of the audio device */ -int sa_device_get_state(sa_device_t *dev, sa_state_t *state); +int sa_stream_get_state(sa_stream_t *dev, sa_state_t *state); /** Get current sampling rate */ -int sa_device_get_rate(sa_device_t *dev, unsigned *rate); +int sa_stream_get_rate(sa_stream_t *dev, unsigned *rate); /** Get number of channels */ -int sa_device_get_nchannels(sa_device_t *dev, int *nchannels); +int sa_stream_get_nchannels(sa_stream_t *dev, int *nchannels); /** Get format being used */ -int sa_device_get_pcm_format(sa_device_t *dev, sa_pcm_format_t *format); +int sa_stream_get_pcm_format(sa_stream_t *dev, sa_pcm_format_t *format); /** Get opaque pointer associated to the device */ -int sa_device_get_user_data(sa_device_t *dev, void **value); +int sa_stream_get_user_data(sa_stream_t *dev, void **value); /** Obtain the error code */ -int sa_device_get_event_error(sa_device_t *dev, sa_error_t *error); +int sa_stream_get_event_error(sa_stream_t *dev, sa_error_t *error); /** Obtain the notification code */ -int sa_device_get_event_notify(sa_device_t *dev, sa_notify_t *notify); +int sa_stream_get_event_notify(sa_stream_t *dev, sa_notify_t *notify); /** sync/timing */ -int sa_device_get_position(sa_device_t *dev, sa_position_t position, int64_t *pos); +int sa_stream_get_position(sa_stream_t *dev, sa_position_t position, int64_t *pos); @@ -321,42 +321,42 @@ int sa_device_get_position(sa_device_t *dev, sa_position_t position, int64_t *po /* Blocking IO calls */ /** Interleaved capture function */ -int sa_device_read(sa_device_t *dev, void *data, size_t nbytes); +int sa_stream_read(sa_stream_t *dev, void *data, size_t nbytes); /** Interleaved playback function */ -int sa_device_write(sa_device_t *dev, const void *data, size_t nbytes); +int sa_stream_write(sa_stream_t *dev, const void *data, size_t nbytes); /** Non-interleaved capture function */ -int sa_device_read_ni(sa_device_t *dev, unsigned channel, void *data, size_t nbytes); +int sa_stream_read_ni(sa_stream_t *dev, unsigned channel, void *data, size_t nbytes); /** Non-interleaved playback function */ -int sa_device_write_ni(sa_device_t *dev, unsigned channel, const void *data, size_t nbytes); +int sa_stream_write_ni(sa_stream_t *dev, unsigned channel, const void *data, size_t nbytes); /** Interleaved capture function with seek offset */ -int sa_device_pread(sa_device_t *dev, void *data, size_t nbytes, int64_t offset, sa_seek_t whence); +int sa_stream_pread(sa_stream_t *dev, void *data, size_t nbytes, int64_t offset, sa_seek_t whence); /** Interleaved playback function with seek offset */ -int sa_device_pwrite(sa_device_t *dev, const void *data, size_t nbytes, int64_t offset, sa_seek_t whence); +int sa_stream_pwrite(sa_stream_t *dev, const void *data, size_t nbytes, int64_t offset, sa_seek_t whence); /** Non-interleaved capture function with seek offset */ -int sa_device_pread_ni(sa_device_t *dev, unsigned channel, void *data, size_t nbytes, int64_t offset, sa_seek_t whence); +int sa_stream_pread_ni(sa_stream_t *dev, unsigned channel, void *data, size_t nbytes, int64_t offset, sa_seek_t whence); /** Non-interleaved playback function with seek offset */ -int sa_device_pwrite_ni(sa_device_t *dev, unsigned channel, const void *data, size_t nbytes, int64_t offset, sa_seek_t whence); +int sa_stream_pwrite_ni(sa_stream_t *dev, unsigned channel, const void *data, size_t nbytes, int64_t offset, sa_seek_t whence); /** Query how much can be read without blocking */ -int sa_device_get_read_size(sa_device_t *dev, size_t *size); +int sa_stream_get_read_size(sa_stream_t *dev, size_t *size); /** Query how much can be written without blocking */ -int sa_device_get_write_size(sa_device_t *dev, size_t *size); +int sa_stream_get_write_size(sa_stream_t *dev, size_t *size); /* Control/xrun */ /** Resume playing after a pause */ -int sa_device_resume(sa_device_t *dev); +int sa_stream_resume(sa_stream_t *dev); /** Pause audio playback (do not empty the buffer) */ -int sa_device_pause(sa_device_t *dev); +int sa_stream_pause(sa_stream_t *dev); /** Block until all audio has been played */ -int sa_device_drain(sa_device_t *dev); +int sa_stream_drain(sa_stream_t *dev); /** Return a human readable error */ const char *sa_strerror(int code); -- cgit