2010-01-31 00:24:23 +01: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 09:04:07 +02:00
|
|
|
#ifndef MPLAYER_MIXER_H
|
|
|
|
#define MPLAYER_MIXER_H
|
2001-04-15 20:37:07 +02:00
|
|
|
|
2012-01-21 08:28:07 +01:00
|
|
|
#include <stdbool.h>
|
|
|
|
|
2013-09-19 14:32:09 +02: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 21:41:22 +02:00
|
|
|
enum {
|
|
|
|
SOFTVOL_NO = 0,
|
|
|
|
SOFTVOL_YES = 1,
|
|
|
|
SOFTVOL_AUTO = 2,
|
|
|
|
};
|
|
|
|
|
2013-12-21 18:19:47 +01:00
|
|
|
struct mpv_global;
|
2013-09-19 14:33:26 +02:00
|
|
|
struct ao;
|
|
|
|
struct af_stream;
|
|
|
|
struct mixer;
|
2004-06-26 11:14:20 +02:00
|
|
|
|
2013-12-21 18:19:47 +01:00
|
|
|
struct mixer *mixer_init(void *talloc_ctx, struct mpv_global *global);
|
2013-09-19 14:31:43 +02:00
|
|
|
void mixer_reinit_audio(struct mixer *mixer, struct ao *ao, struct af_stream *af);
|
|
|
|
void mixer_uninit_audio(struct mixer *mixer);
|
2013-10-12 18:28:02 +02:00
|
|
|
bool mixer_audio_initialized(struct mixer *mixer);
|
2013-09-19 14:33:26 +02:00
|
|
|
void mixer_getvolume(struct mixer *mixer, float *l, float *r);
|
|
|
|
void mixer_setvolume(struct mixer *mixer, float l, float r);
|
2014-02-27 01:07:46 +01:00
|
|
|
void mixer_addvolume(struct mixer *mixer, float step);
|
2013-09-19 14:33:26 +02:00
|
|
|
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 14:32:47 +02:00
|
|
|
char *mixer_get_volume_restore_data(struct mixer *mixer);
|
2001-04-15 20:37:07 +02:00
|
|
|
|
2007-07-31 09:04:07 +02:00
|
|
|
#endif /* MPLAYER_MIXER_H */
|