18#ifndef __VSF_SDL2_AUDIO_H__
19#define __VSF_SDL2_AUDIO_H__
23#include "../../vsf_sdl2_cfg.h"
25#if VSF_USE_SDL2 == ENABLED
37#define SDL_MIX_MAXVOLUME 128
39#define SDL_AUDIO_ALLOW_FREQUENCY_CHANGE 0x00000001
40#define SDL_AUDIO_ALLOW_FORMAT_CHANGE 0x00000002
41#define SDL_AUDIO_ALLOW_CHANNELS_CHANGE 0x00000004
42#define SDL_AUDIO_ALLOW_SAMPLES_CHANGE 0x00000008
43#define SDL_AUDIO_ALLOW_ANY_CHANGE (SDL_AUDIO_ALLOW_FREQUENCY_CHANGE \
44 | SDL_AUDIO_ALLOW_FORMAT_CHANGE | SDL_AUDIO_ALLOW_CHANNELS_CHANGE \
45 | SDL_AUDIO_ALLOW_SAMPLES_CHANGE)
47#define SDL_AUDIO_MASK_BITSIZE 0xFF
48#define SDL_AUDIO_BITSIZE(__FORMAT) ((__FORMAT) & SDL_AUDIO_MASK_BITSIZE)
49#define SDL_AUDIO_MASK_DATATYPE (1 << 8)
50#define SDL_AUDIO_ISFLOAT(__FORMAT) ((__FORMAT) & SDL_AUDIO_MASK_DATATYPE)
51#define SDL_AUDIO_ISINT(__FORMAT) (!SDL_AUDIO_ISFLOAT(__FORMAT))
52#define SDL_AUDIO_MASK_ENDIAN (1 << 12)
53#define SDL_AUDIO_ISBIGENDIAN(__FORMAT) ((__FORMAT) & SDL_AUDIO_MASK_ENDIAN)
54#define SDL_AUDIO_ISLITTLEENDIAN(__FORMAT) (!SDL_AUDIO_ISBIGENDIAN(__FORMAT))
55#define SDL_AUDIO_MASK_SIGNED (1 << 15)
56#define SDL_AUDIO_ISSIGNED(__FORMAT) ((__FORMAT) & SDL_AUDIO_MASK_SIGNED)
57#define SDL_AUDIO_ISUNSIGNED(__FORMAT) (!SDL_AUDIO_ISSIGNED(__FORMAT))
61#if VSF_SDL_CFG_WRAPPER == ENABLED
62#define SDL_OpenAudio VSF_SDL_WRAPPER(SDL_OpenAudio)
63#define SDL_PauseAudio VSF_SDL_WRAPPER(SDL_PauseAudio)
64#define SDL_GetAudioStatus VSF_SDL_WRAPPER(SDL_GetAudioStatus)
65#define SDL_CloseAudio VSF_SDL_WRAPPER(SDL_CloseAudio)
66#define SDL_LockAudio VSF_SDL_WRAPPER(SDL_LockAudio)
67#define SDL_UnlockAudio VSF_SDL_WRAPPER(SDL_UnlockAudio)
111#if __BYTE_ORDER == __BIG_ENDIAN
#define SDL_CloseAudio
Definition SDL_audio.h:65
SDL_AudioStatus
Definition SDL_audio.h:72
@ SDL_AUDIO_STOPPED
Definition SDL_audio.h:73
@ SDL_AUDIO_PLAYING
Definition SDL_audio.h:74
@ SDL_AUDIO_PAUSED
Definition SDL_audio.h:75
uint8_t SDL_AudioFormat
Definition SDL_audio.h:77
#define SDL_LockAudio
Definition SDL_audio.h:66
#define SDL_OpenAudio
Definition SDL_audio.h:62
#define SDL_GetAudioStatus
Definition SDL_audio.h:64
void(* SDL_AudioCallback)(void *userdata, uint8_t *stream, int len)
Definition SDL_audio.h:78
#define SDL_UnlockAudio
Definition SDL_audio.h:67
@ AUDIO_F16
Definition SDL_audio.h:95
@ AUDIO_S32MSB
Definition SDL_audio.h:107
@ AUDIO_F32SYS
Definition SDL_audio.h:115
@ AUDIO_U32
Definition SDL_audio.h:96
@ AUDIO_FLOAT
Definition SDL_audio.h:89
@ AUDIO_S32
Definition SDL_audio.h:97
@ AUDIO_F32MSB
Definition SDL_audio.h:109
@ AUDIO_S16LSB
Definition SDL_audio.h:102
@ AUDIO_S32SYS
Definition SDL_audio.h:114
@ AUDIO_UNSIGNED
Definition SDL_audio.h:88
@ AUDIO_MSB
Definition SDL_audio.h:86
@ AUDIO_16
Definition SDL_audio.h:81
@ AUDIO_U32LSB
Definition SDL_audio.h:104
@ AUDIO_U8
Definition SDL_audio.h:91
@ AUDIO_U16MSB
Definition SDL_audio.h:101
@ AUDIO_S32LSB
Definition SDL_audio.h:106
@ AUDIO_U32MSB
Definition SDL_audio.h:105
@ AUDIO_S16MSB
Definition SDL_audio.h:103
@ AUDIO_U16
Definition SDL_audio.h:93
@ AUDIO_F32LSB
Definition SDL_audio.h:108
@ AUDIO_F32
Definition SDL_audio.h:98
@ AUDIO_U16LSB
Definition SDL_audio.h:100
@ AUDIO_S16SYS
Definition SDL_audio.h:113
@ AUDIO_SIGNED
Definition SDL_audio.h:87
@ AUDIO_8
Definition SDL_audio.h:80
@ AUDIO_LSB
Definition SDL_audio.h:85
@ AUDIO_32
Definition SDL_audio.h:82
@ AUDIO_S16
Definition SDL_audio.h:94
@ AUDIO_S8
Definition SDL_audio.h:92
@ AUDIO_U16SYS
Definition SDL_audio.h:112
uintptr_t SDL_AudioDeviceID
Definition SDL_audio.h:134
#define SDL_PauseAudio
Definition SDL_audio.h:63
unsigned short uint16_t
Definition lvgl.h:41
unsigned int uint32_t
Definition lvgl.h:43
unsigned char uint8_t
Definition lvgl.h:40
uint32_t uintptr_t
Definition stdint.h:38
Definition SDL_audio.h:136
uint8_t * buf
Definition SDL_audio.h:140
int len_cvt
Definition SDL_audio.h:142
SDL_AudioFormat src_format
Definition SDL_audio.h:138
SDL_AudioFormat dst_format
Definition SDL_audio.h:139
int needed
Definition SDL_audio.h:137
int len_mult
Definition SDL_audio.h:143
int len
Definition SDL_audio.h:141
Definition SDL_audio.h:123
SDL_AudioCallback callback
Definition SDL_audio.h:130
uint8_t silence
Definition SDL_audio.h:127
uint16_t samples
Definition SDL_audio.h:128
uint32_t freq
Definition SDL_audio.h:124
uint32_t size
Definition SDL_audio.h:129
SDL_AudioFormat format
Definition SDL_audio.h:125
void * userdata
Definition SDL_audio.h:131
uint8_t channels
Definition SDL_audio.h:126