Documentation de la bibliothèque MLV-2.0.2

MLV_audio.h
Aller à la documentation de ce fichier.
1 /*
2  * This file is part of the MLV Library.
3  *
4  * Copyright (C) 2010,2011,2012 Adrien Boussicault, Marc Zipstein
5  *
6  *
7  * This Library is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This Library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this Library. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
32 #ifndef __MLV__MLV_AUDIO_H__
33 #define __MLV__MLV_AUDIO_H__
34 
35 #ifndef MEMORY_DEBUG
36 #include <SDL/SDL.h>
37 #else
38 #include "memory_debug.h"
39 #endif
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
48 typedef struct _MLV_Music MLV_Music;
49 
53 typedef struct _MLV_Sound MLV_Sound;
54 
62 int MLV_init_audio();
63 
67 void MLV_free_audio();
68 
96 int MLV_change_audio_buffer_size( int buffer_size );
97 
104 void MLV_change_number_of_parallel_sounds( unsigned int n );
105 
120 MLV_Music* MLV_load_music( const char* file_music );
121 
127 void MLV_free_music( MLV_Music* music );
128 
137 void MLV_play_music( const MLV_Music* music, float volume, int loop );
138 
142 void MLV_stop_music();
143 
144 
160 MLV_Sound* MLV_load_sound( const char* file_sound );
161 
167 void MLV_free_sound( MLV_Sound* sound );
168 
175 void MLV_play_sound( const MLV_Sound* sound, float volume );
176 
180 void MLV_stop_all_sounds();
181 
182 
183 #ifdef __cplusplus
184 }
185 #endif
186 
187 #endif
struct _MLV_Music MLV_Music
Ce type code un morceau de musique.
Definition: MLV_audio.h:48
int MLV_change_audio_buffer_size(int buffer_size)
Change la taille du buffer audio. La taille doit être une puissance de 2.
MLV_Sound * MLV_load_sound(const char *file_sound)
Charge un ficher contenant un échantillon sonore en mémoire.
MLV_Music * MLV_load_music(const char *file_music)
Charge un ficher contenant de la musique en mémoire.
void MLV_free_music(MLV_Music *music)
Ferme un morceau de musique chargé en mémoire.
void MLV_change_number_of_parallel_sounds(unsigned int n)
Change le nombre d'écahantillons sonores qui peuvent être joués en même temps.
void MLV_free_sound(MLV_Sound *sound)
Ferme un échantillon sonore chargé en mémoire.
void MLV_stop_all_sounds()
Arrête tous les échantillons sonores.
struct _MLV_Sound MLV_Sound
Ce type code un échantillon sonore.
Definition: MLV_audio.h:53
int MLV_init_audio()
Cette fonction initialise la bibliothèque MLV pour pouvoir jouer de la musique et des sons...
void MLV_stop_music()
Arrête toutes les musiques.
void MLV_play_sound(const MLV_Sound *sound, float volume)
Joue un échantillon sonore chargé en mémoire.
void MLV_play_music(const MLV_Music *music, float volume, int loop)
Joue un morceau de musique qui est chargée en mémoire.
void MLV_free_audio()
Ferme proprement les différents périphériques audios.