9a4b0b58dd621db109c22815be2ad6470b9394dc
[src/app-framework-binder.git] / plugins / audio / audio-alsa.h
1 /*
2  * Copyright (C) 2015 "IoT.bzh"
3  * Author "Manuel Bachmann"
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  */
18
19 #ifndef AUDIO_ALSA_H
20 #define AUDIO_ALSA_H
21
22 #include <alsa/asoundlib.h>
23
24 #include "local-def.h"
25
26 typedef struct dev_ctx dev_ctx_T;
27
28 struct dev_ctx {
29   char *name;
30   snd_pcm_t *dev;
31   snd_pcm_hw_params_t *params;
32   snd_mixer_elem_t *mixer_elm;
33   long vol_max;
34   long vol;
35 };
36
37 PUBLIC unsigned int _alsa_get_volume (unsigned int);
38 PUBLIC unsigned char _alsa_get_mute (unsigned int);
39
40 static struct dev_ctx **dev_ctx = NULL;
41
42 #endif /* AUDIO_ALSA_H */