-
Notifications
You must be signed in to change notification settings - Fork 0
/
audio_mixer.h
39 lines (25 loc) · 842 Bytes
/
audio_mixer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//SPDX-License-Identifier: GPL-2.0-or-later
/*
Copyright (C) 2007-2022 Cyril Hrubis <[email protected]>
*/
#ifndef AUDIO_MIXER_H__
#define AUDIO_MIXER_H__
#include <utils/gp_poll.h>
#include <alsa/asoundlib.h>
struct audio_mixer {
snd_mixer_t *mixer;
snd_mixer_elem_t *master_volume;
long master_volume_min;
long master_volume_max;
int use_db:1;
void (*master_volume_callback)(struct audio_mixer *mixer, long volume, int mute);
void *priv;
/* Array of file descriptors with callbacks */
size_t poll_fds_cnt;
gp_fd *poll_fds;
};
int audio_mixer_init(struct audio_mixer *self, const char *device);
void audio_mixer_set_master_volume(struct audio_mixer *self, long volume);
void audio_mixer_set_master_mute(struct audio_mixer *self, int mute);
void audio_mixer_exit(struct audio_mixer *self);
#endif /* AUDIO_MIXER_H__ */