summaryrefslogtreecommitdiffstats
path: root/audio/mixer.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-09-19 14:33:26 +0200
committerwm4 <wm4@nowhere>2013-09-20 13:23:25 +0200
commit01622717257673d424debfa762536f998d97a4dd (patch)
treedfc18807213d8fcdbc1a008421d07f5c6df656d8 /audio/mixer.h
parent327a779a81098b39823f7036eba816b8b4c7245f (diff)
downloadmpv-01622717257673d424debfa762536f998d97a4dd.tar.bz2
mpv-01622717257673d424debfa762536f998d97a4dd.tar.xz
mixer: make struct opaque
Also remove stray include statements from ao_alsa and ao_oss.
Diffstat (limited to 'audio/mixer.h')
-rw-r--r--audio/mixer.h42
1 files changed, 14 insertions, 28 deletions
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 */