2 * Copyright (C) 2015 "IoT.bzh"
3 * Author "Manuel Bachmann"
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.
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.
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/>.
23 #include <alsa/asoundlib.h>
25 #include "audio-api.h"
26 #include "local-def.h"
28 typedef struct dev_ctx_alsa dev_ctx_alsa_T;
33 snd_pcm_hw_params_t *params;
34 snd_mixer_elem_t *mixer_elm;
35 snd_mixer_elem_t *mixer_elm_m;
39 unsigned char thr_should_run;
40 unsigned char thr_finished;
43 PUBLIC unsigned char _alsa_init (const char *, audioCtxHandleT *);
44 PUBLIC void _alsa_free (const char *);
45 PUBLIC void _alsa_play (int);
46 PUBLIC void _alsa_stop (int);
47 PUBLIC unsigned int _alsa_get_volume (int, unsigned int);
48 PUBLIC void _alsa_set_volume (int, unsigned int, unsigned int);
49 PUBLIC void _alsa_set_volume_all (int, unsigned int);
50 PUBLIC unsigned char _alsa_get_mute (int);
51 PUBLIC void _alsa_set_mute (int, unsigned char);
52 PUBLIC void _alsa_set_channels (int, unsigned int);
53 STATIC void* _alsa_play_thread_fn (void *);
55 static struct dev_ctx_alsa **dev_ctx_a = NULL;
57 #endif /* AUDIO_ALSA_H */