From 01622717257673d424debfa762536f998d97a4dd Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 19 Sep 2013 14:33:26 +0200 Subject: mixer: make struct opaque Also remove stray include statements from ao_alsa and ao_oss. --- audio/mixer.h | 42 ++++++++++++++---------------------------- 1 file changed, 14 insertions(+), 28 deletions(-) (limited to 'audio/mixer.h') diff --git a/audio/mixer.h b/audio/mixer.h index a636a2b418..9fbb4bcdca 100644 --- a/audio/mixer.h +++ b/audio/mixer.h @@ -28,37 +28,23 @@ enum { SOFTVOL_AUTO = 2, }; -typedef struct mixer { - struct MPOpts *opts; - struct ao *ao; - struct af_stream *af; - // Static, dependent on ao/softvol settings - bool softvol; // use AO (true) or af_volume (false) - bool emulate_mute; // if true, emulate mute with volume=0 - // Last known values (possibly out of sync with reality) - float vol_l, vol_r; - bool muted; - // Used to decide whether we should unmute on uninit - bool muted_by_us; - /* Contains ao driver name or "softvol" if volume is not persistent - * and needs to be restored after the driver is reinitialized. */ - const char *driver; - // Other stuff - float balance; -} mixer_t; +struct MPOpts; +struct ao; +struct af_stream; +struct mixer; -void mixer_init(struct mixer *mixer, struct MPOpts *opts); +struct mixer *mixer_init(void *talloc_ctx, struct MPOpts *opts); void mixer_reinit_audio(struct mixer *mixer, struct ao *ao, struct af_stream *af); void mixer_uninit_audio(struct mixer *mixer); -void mixer_getvolume(mixer_t *mixer, float *l, float *r); -void mixer_setvolume(mixer_t *mixer, float l, float r); -void mixer_incvolume(mixer_t *mixer); -void mixer_decvolume(mixer_t *mixer); -void mixer_getbothvolume(mixer_t *mixer, float *b); -void mixer_setmute(mixer_t *mixer, bool mute); -bool mixer_getmute(mixer_t *mixer); -void mixer_getbalance(mixer_t *mixer, float *bal); -void mixer_setbalance(mixer_t *mixer, float bal); +void mixer_getvolume(struct mixer *mixer, float *l, float *r); +void mixer_setvolume(struct mixer *mixer, float l, float r); +void mixer_incvolume(struct mixer *mixer); +void mixer_decvolume(struct mixer *mixer); +void mixer_getbothvolume(struct mixer *mixer, float *b); +void mixer_setmute(struct mixer *mixer, bool mute); +bool mixer_getmute(struct mixer *mixer); +void mixer_getbalance(struct mixer *mixer, float *bal); +void mixer_setbalance(struct mixer *mixer, float bal); char *mixer_get_volume_restore_data(struct mixer *mixer); #endif /* MPLAYER_MIXER_H */ -- cgit v1.2.3