2 * Copyright (C) 2015 "IoT.bzh"
3 * Author "Manuel Bachmann"
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
22 #include <alsa/asoundlib.h>
24 #include "audio-api.h"
25 #include "local-def.h"
27 typedef struct dev_ctx_alsa dev_ctx_alsa_T;
32 snd_pcm_hw_params_t *params;
33 snd_mixer_elem_t *mixer_elm;
34 snd_mixer_elem_t *mixer_elm_m;
38 unsigned char thr_should_run;
39 unsigned char thr_finished;
42 PUBLIC unsigned char _alsa_init (const char *, audioCtxHandleT *);
43 PUBLIC void _alsa_free (const char *);
44 PUBLIC void _alsa_play (int);
45 PUBLIC void _alsa_stop (int);
46 PUBLIC unsigned int _alsa_get_volume (int, unsigned int);
47 PUBLIC void _alsa_set_volume (int, unsigned int, unsigned int);
48 PUBLIC void _alsa_set_volume_all (int, unsigned int);
49 PUBLIC unsigned char _alsa_get_mute (int);
50 PUBLIC void _alsa_set_mute (int, unsigned char);
51 PUBLIC void _alsa_set_channels (int, unsigned int);
52 STATIC void* _alsa_play_thread_fn (void *);
54 static struct dev_ctx_alsa **dev_ctx_a = NULL;
56 #endif /* AUDIO_ALSA_H */