RetroArch
audio_mixer.h
Go to the documentation of this file.
1 /* Copyright (C) 2010-2018 The RetroArch team
2  *
3  * ---------------------------------------------------------------------------------------
4  * The following license statement only applies to this file (audio_mixer.h).
5  * ---------------------------------------------------------------------------------------
6  *
7  * Permission is hereby granted, free of charge,
8  * to any person obtaining a copy of this software and associated documentation files (the "Software"),
9  * to deal in the Software without restriction, including without limitation the rights to
10  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
11  * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
16  * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
19  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21  */
22 
23 #ifndef __LIBRETRO_SDK_AUDIO_MIXER__H
24 #define __LIBRETRO_SDK_AUDIO_MIXER__H
25 
26 #include <stdint.h>
27 #include <stddef.h>
28 #include <stdlib.h>
29 
30 #ifdef HAVE_CONFIG_H
31 #include "config.h"
32 #endif
33 
34 #include <boolean.h>
35 #include <retro_common_api.h>
36 
38 
40 {
47 };
48 
51 
52 typedef void (*audio_mixer_stop_cb_t)(audio_mixer_sound_t* sound, unsigned reason);
53 
54 /* Reasons passed to the stop callback. */
55 #define AUDIO_MIXER_SOUND_FINISHED 0
56 #define AUDIO_MIXER_SOUND_STOPPED 1
57 #define AUDIO_MIXER_SOUND_REPEATED 2
58 
59 void audio_mixer_init(unsigned rate);
60 
61 void audio_mixer_done(void);
62 
68 
70 
73 
75 
77 
79 
80 void audio_mixer_mix(float* buffer, size_t num_frames, float volume_override, bool override);
81 
83 
84 #endif
audio_mixer_sound_t * audio_mixer_load_flac(void *buffer, int32_t size)
Definition: audio_mixer.c:406
GLuint GLfloat * val
Definition: glext.h:7847
audio_mixer_sound_t * audio_mixer_load_mod(void *buffer, int32_t size)
Definition: audio_mixer.c:442
#define RETRO_BEGIN_DECLS
Definition: retro_common_api.h:41
Configuration options (set of defines)
void audio_mixer_done(void)
Definition: audio_mixer.c:325
void audio_mixer_stop(audio_mixer_voice_t *voice)
Definition: audio_mixer.c:821
audio_mixer_stop_cb_t stop_cb
Definition: audio_mixer.c:127
GLsizeiptr size
Definition: glext.h:6559
typedef void(__stdcall *PFN_DESTRUCTION_CALLBACK)(void *pData)
Definition: audio_mixer.h:42
void(* audio_mixer_stop_cb_t)(audio_mixer_sound_t *sound, unsigned reason)
Definition: audio_mixer.h:52
audio_mixer_sound_t * audio_mixer_load_wav(void *buffer, int32_t size)
Definition: audio_mixer.c:339
bool repeat
Definition: audio_mixer.c:123
Definition: audio_mixer.h:43
void audio_mixer_init(unsigned rate)
Definition: audio_mixer.c:311
void audio_mixer_voice_set_volume(audio_mixer_voice_t *voice, float val)
Definition: audio_mixer.c:1251
void audio_mixer_destroy(audio_mixer_sound_t *sound)
Definition: audio_mixer.c:460
audio_mixer_sound_t * audio_mixer_load_mp3(void *buffer, int32_t size)
Definition: audio_mixer.c:424
void audio_mixer_mix(float *buffer, size_t num_frames, float volume_override, bool override)
Definition: audio_mixer.c:1185
audio_mixer_type
Definition: audio_mixer.h:39
Definition: audio_mixer.c:121
Definition: audio_mixer.c:70
Definition: audio_mixer.h:44
audio_mixer_sound_t * audio_mixer_load_ogg(void *buffer, int32_t size)
Definition: audio_mixer.c:387
signed int int32_t
Definition: stdint.h:123
#define RETRO_END_DECLS
Definition: retro_common_api.h:42
float audio_mixer_voice_get_volume(audio_mixer_voice_t *voice)
Definition: audio_mixer.c:1243
Definition: audio_mixer.h:46
Definition: video4linux2.c:51
audio_mixer_voice_t * audio_mixer_play(audio_mixer_sound_t *sound, bool repeat, float volume, audio_mixer_stop_cb_t stop_cb)
Definition: audio_mixer.c:752
Definition: audio_mixer.h:41
float volume
Definition: audio_mixer.c:125
Definition: audio_mixer.h:45
audio_mixer_sound_t * sound
Definition: audio_mixer.c:126