Documentation of the MLV-2.0.2 library

MLV_audio.h
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