diff options
author | Uoti Urpala <uau@mplayer2.org> | 2012-04-07 16:26:56 +0300 |
---|---|---|
committer | Uoti Urpala <uau@mplayer2.org> | 2012-04-08 16:35:09 +0300 |
commit | 3a01606dc05b2cedb9792a6f8adefeba6e434ab0 (patch) | |
tree | 4fe7f5735617f05e6726d4b2006676fc774ec64f /libao2/audio_out.h | |
parent | 485f439cfefd4fa8d35f406fd8694e649bd536c8 (diff) | |
download | mpv-3a01606dc05b2cedb9792a6f8adefeba6e434ab0.tar.bz2 mpv-3a01606dc05b2cedb9792a6f8adefeba6e434ab0.tar.xz |
libao2: change control() types to enum, remove unused ones
Change the audio driver control() command argument from "int" to "enum
aocontrol". Remove unused control types (SET_DEVICE, GET_DEVICE,
QUERY_FORMAT, SET_PLUGIN_DRIVER, SET_PLUGIN_LIST). The QUERY_FORMAT
one looks like there's a possibility such functionality could be
useful in the future, but as ao_oss was the only driver to have an
actual implementation of it, the current code wasn't worth keeping.
Diffstat (limited to 'libao2/audio_out.h')
-rw-r--r-- | libao2/audio_out.h | 49 |
1 files changed, 24 insertions, 25 deletions
diff --git a/libao2/audio_out.h b/libao2/audio_out.h index 1c472565a0..2e59c42aa4 100644 --- a/libao2/audio_out.h +++ b/libao2/audio_out.h @@ -23,6 +23,27 @@ #include "bstr.h" +#define CONTROL_OK 1 +#define CONTROL_TRUE 1 +#define CONTROL_FALSE 0 +#define CONTROL_UNKNOWN -1 +#define CONTROL_ERROR -2 +#define CONTROL_NA -3 + +enum aocontrol { + // _VOLUME commands take struct ao_control_vol pointer for input/output. + // If there's only one volume, SET should use average of left/right. + AOCONTROL_GET_VOLUME, + AOCONTROL_SET_VOLUME, +}; + +#define AOPLAY_FINAL_CHUNK 1 + +typedef struct ao_control_vol { + float left; + float right; +} ao_control_vol_t; + typedef struct ao_info { /* driver name ("Matrox Millennium G200/G400" */ const char *name; @@ -53,7 +74,7 @@ struct ao_driver { bool is_new; const struct ao_info *info; const struct ao_old_functions *old_functions; - int (*control)(struct ao *ao, int cmd, void *arg); + int (*control)(struct ao *ao, enum aocontrol cmd, void *arg); int (*init)(struct ao *ao, char *params); void (*uninit)(struct ao *ao, bool cut_audio); void (*reset)(struct ao*ao); @@ -88,40 +109,18 @@ extern char *ao_subdevice; void list_audio_out(void); -#define CONTROL_OK 1 -#define CONTROL_TRUE 1 -#define CONTROL_FALSE 0 -#define CONTROL_UNKNOWN -1 -#define CONTROL_ERROR -2 -#define CONTROL_NA -3 - -#define AOCONTROL_SET_DEVICE 1 -#define AOCONTROL_GET_DEVICE 2 -#define AOCONTROL_QUERY_FORMAT 3 /* test for availabilty of a format */ -#define AOCONTROL_GET_VOLUME 4 -#define AOCONTROL_SET_VOLUME 5 -#define AOCONTROL_SET_PLUGIN_DRIVER 6 -#define AOCONTROL_SET_PLUGIN_LIST 7 - -#define AOPLAY_FINAL_CHUNK 1 - -typedef struct ao_control_vol { - float left; - float right; -} ao_control_vol_t; - struct ao *ao_create(struct MPOpts *opts, struct input_ctx *input); void ao_init(struct ao *ao, char **ao_list); void ao_uninit(struct ao *ao, bool cut_audio); int ao_play(struct ao *ao, void *data, int len, int flags); -int ao_control(struct ao *ao, int cmd, void *arg); +int ao_control(struct ao *ao, enum aocontrol cmd, void *arg); double ao_get_delay(struct ao *ao); int ao_get_space(struct ao *ao); void ao_reset(struct ao *ao); void ao_pause(struct ao *ao); void ao_resume(struct ao *ao); -int old_ao_control(struct ao *ao, int cmd, void *arg); +int old_ao_control(struct ao *ao, enum aocontrol cmd, void *arg); int old_ao_init(struct ao *ao, char *params); void old_ao_uninit(struct ao *ao, bool cut_audio); void old_ao_reset(struct ao*ao); |