2010-01-30 23:24:23 +00:00
|
|
|
/*
|
|
|
|
* This file is part of MPlayer.
|
|
|
|
*
|
|
|
|
* MPlayer is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* MPlayer is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with MPlayer; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
2007-07-31 07:04:07 +00:00
|
|
|
#ifndef MPLAYER_MIXER_H
|
|
|
|
#define MPLAYER_MIXER_H
|
2001-04-15 18:37:07 +00:00
|
|
|
|
2012-01-21 07:28:07 +00:00
|
|
|
#include <stdbool.h>
|
|
|
|
|
2013-09-19 12:32:09 +00:00
|
|
|
// Values of MPOpts.softvol
|
softvol, ao_pulse: prefer ao_pulse volume control by default
--softvol is enabled by default. For most audio outputs, this is a good
thing, as they have either their own (bad) soft volume implementation,
or control the system mixer. With ao_pulse, the situation is a bit
different: it supports per-application volume (i.e. volume control is
not really global). More importantly, ao_pulse uses a rather large audio
buffer, and changing the volume with mplayer's volume filter has a large
delay. With the native ao_pulse volume control, it's instant, because
PulseAudio's audio filtering happens at a later stage in its processing
pipeline (inaccessible for mplayer).
This means native volume control should really be allowed for ao_pulse,
while it's the reverse for other audio outputs. Make --softvol a choice
option, and add a new "auto" choice. This is default and will use PA's
volume control with ao_pulse, and mplayer's volume filter otherwise
(i.e. the old softvol behavior).
2012-09-18 19:41:22 +00:00
|
|
|
enum {
|
|
|
|
SOFTVOL_NO = 0,
|
|
|
|
SOFTVOL_YES = 1,
|
|
|
|
SOFTVOL_AUTO = 2,
|
|
|
|
};
|
|
|
|
|
2013-09-19 12:33:26 +00:00
|
|
|
struct MPOpts;
|
|
|
|
struct ao;
|
|
|
|
struct af_stream;
|
|
|
|
struct mixer;
|
2004-06-26 09:14:20 +00:00
|
|
|
|
2013-09-19 12:33:26 +00:00
|
|
|
struct mixer *mixer_init(void *talloc_ctx, struct MPOpts *opts);
|
2013-09-19 12:31:43 +00:00
|
|
|
void mixer_reinit_audio(struct mixer *mixer, struct ao *ao, struct af_stream *af);
|
|
|
|
void mixer_uninit_audio(struct mixer *mixer);
|
2013-09-19 12:33:26 +00:00
|
|
|
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);
|
2013-09-19 12:32:47 +00:00
|
|
|
char *mixer_get_volume_restore_data(struct mixer *mixer);
|
2001-04-15 18:37:07 +00:00
|
|
|
|
2007-07-31 07:04:07 +00:00
|
|
|
#endif /* MPLAYER_MIXER_H */
|