2 * Copyright (C) 2016 "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 <pulse/pulseaudio.h>
23 #include <pulse/simple.h>
24 #include <pulse/error.h>
26 #include "audio-alsa.h"
28 typedef struct dev_ctx_pulse dev_ctx_pulse_T;
29 typedef struct alsa_info alsa_info_T;
31 struct dev_ctx_pulse {
35 pa_context *pa_context;
39 unsigned char refresh;
41 unsigned char thr_should_run;
42 unsigned char thr_finished;
50 unsigned char _pulse_init (const char *, audioCtxHandleT *);
51 void _pulse_free (audioCtxHandleT *);
52 void _pulse_play (audioCtxHandleT *);
53 void _pulse_stop (audioCtxHandleT *);
54 unsigned int _pulse_get_volume (audioCtxHandleT *, unsigned int);
55 void _pulse_set_volume (audioCtxHandleT *, unsigned int, unsigned int);
56 void _pulse_set_volume_all (audioCtxHandleT *, unsigned int);
57 unsigned char _pulse_get_mute (audioCtxHandleT *);
58 void _pulse_set_mute (audioCtxHandleT *, unsigned char);
60 void _pulse_context_cb (pa_context *, void *);
61 void _pulse_sink_list_cb (pa_context *, const pa_sink_info *, int, void *);
62 void _pulse_sink_info_cb (pa_context *, const pa_sink_info *, int, void *);
63 void* _pulse_play_thread_fn (void *);
64 void _pulse_refresh_sink (dev_ctx_pulse_T *);
66 #endif /* AUDIO_PULSE_H */