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>
|
|
|
|
|
2004-06-26 09:14:20 +00:00
|
|
|
#include "libaf/af.h"
|
|
|
|
#include "libao2/audio_out.h"
|
|
|
|
|
2011-12-26 00:41:35 +00:00
|
|
|
typedef struct mixer {
|
2011-04-09 00:03:22 +00:00
|
|
|
struct ao *ao;
|
2004-06-26 09:14:20 +00:00
|
|
|
af_stream_t *afilter;
|
|
|
|
int volstep;
|
2012-01-21 07:28:07 +00:00
|
|
|
bool softvol;
|
|
|
|
float softvol_max;
|
2012-04-09 14:39:01 +00:00
|
|
|
bool muted;
|
2012-04-10 01:45:53 +00:00
|
|
|
bool muted_by_us;
|
|
|
|
bool muted_using_volume;
|
2012-04-09 14:39:01 +00:00
|
|
|
float vol_l, vol_r;
|
2012-04-09 18:02:27 +00:00
|
|
|
/* Contains ao driver name or "softvol" if volume is not persistent
|
|
|
|
* and needs to be restored after the driver is reinitialized. */
|
|
|
|
const char *restore_volume;
|
2012-04-09 18:06:10 +00:00
|
|
|
float balance;
|
2004-06-26 09:14:20 +00:00
|
|
|
} mixer_t;
|
|
|
|
|
2012-04-09 18:02:27 +00:00
|
|
|
void mixer_reinit(struct mixer *mixer, struct ao *ao);
|
2012-04-09 19:11:49 +00:00
|
|
|
void mixer_uninit(struct mixer *mixer);
|
2004-06-26 09:14:20 +00:00
|
|
|
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);
|
2012-04-09 14:39:01 +00:00
|
|
|
void mixer_setmute(mixer_t *mixer, bool mute);
|
|
|
|
bool mixer_getmute(mixer_t *mixer);
|
2007-06-20 02:26:20 +00:00
|
|
|
void mixer_getbalance(mixer_t *mixer, float *bal);
|
|
|
|
void mixer_setbalance(mixer_t *mixer, float bal);
|
2001-04-15 18:37:07 +00:00
|
|
|
|
2007-07-31 07:04:07 +00:00
|
|
|
#endif /* MPLAYER_MIXER_H */
|