alsa.audio: add volume control
[AROS.git] / workbench / devs / AHI / Drivers / Alsa / alsa-bridge / alsa_hostlib.h
bloba0adfc98ea5d08a73689cd0b7b3eb8b73c106f7d
1 /*
2 Copyright © 2015, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <alsa/asoundlib.h>
8 struct alsa_func
10 int (*snd_pcm_open)(snd_pcm_t **pcmp, const char *name, snd_pcm_stream_t stream, int mode);
11 int (*snd_pcm_close)(snd_pcm_t *pcm);
12 int (*snd_pcm_hw_params_malloc)(snd_pcm_hw_params_t **ptr);
13 void (*snd_pcm_hw_params_free)(snd_pcm_hw_params_t *obj);
14 int (*snd_pcm_hw_params_any)(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
15 int (*snd_pcm_hw_params_set_access)(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t _access);
16 int (*snd_pcm_hw_params_set_format)(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val);
17 int (*snd_pcm_hw_params_set_rate_near)(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
18 int (*snd_pcm_hw_params_set_channels)(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
19 int (*snd_pcm_hw_params)(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
20 int (*snd_pcm_prepare)(snd_pcm_t *pcm);
21 snd_pcm_sframes_t(*snd_pcm_writei)(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size);
22 snd_pcm_sframes_t(*snd_pcm_avail_update)(snd_pcm_t *pcm);
23 int (*snd_pcm_hw_params_get_buffer_size)(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
24 int (*snd_pcm_hw_params_set_buffer_size)(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val);
25 int (*snd_pcm_drop)(snd_pcm_t *pcm);
27 int (*snd_mixer_open)(snd_mixer_t **mixer, int mode);
28 int (*snd_mixer_close)(snd_mixer_t *mixer);
29 int (*snd_mixer_load)(snd_mixer_t *mixer);
30 int (*snd_mixer_attach)(snd_mixer_t *mixer, const char *name);
31 snd_mixer_elem_t *(*snd_mixer_find_selem)(snd_mixer_t *mixer, const snd_mixer_selem_id_t *id);
32 int (*snd_mixer_selem_register)(snd_mixer_t *mixer, struct snd_mixer_selem_regopt *options, snd_mixer_class_t **classp);
33 int (*snd_mixer_selem_id_malloc)(snd_mixer_selem_id_t **ptr);
34 void (*snd_mixer_selem_id_free)(snd_mixer_selem_id_t *obj);
35 void (*snd_mixer_selem_id_set_index)(snd_mixer_selem_id_t *obj, unsigned int val);
36 void (*snd_mixer_selem_id_set_name)(snd_mixer_selem_id_t *obj, const char *val);
37 int (*snd_mixer_selem_get_playback_volume_range)(snd_mixer_elem_t *elem, long *min, long *max);
38 int (*snd_mixer_selem_get_playback_volume)(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long *value);
39 int (*snd_mixer_selem_set_playback_volume_all)(snd_mixer_elem_t *elem, long value);
42 extern struct alsa_func alsa_func;
44 #define ALSACALL(func,...) (alsa_func.func(__VA_ARGS__))
46 BOOL ALSA_HostLib_Init();
47 VOID ALSA_HostLib_Cleanup();