fix build.
2 SDL_mixer: An audio mixer library based on the SDL library
3 Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
21 #include "SDL_mixer.h"
26 /* Supported music APIs, in order of preference */
46 /* Music API implementation */
56 /* Load the library */
59 /* Initialize for the audio output */
60 int (*Open)(const SDL_AudioSpec *spec);
62 /* Create a music object from an SDL_RWops stream
63 * If the function returns NULL, 'src' will be freed if needed by the caller.
65 void *(*CreateFromRW)(SDL_RWops *src, int freesrc);
67 /* Create a music object from a file, if SDL_RWops are not supported */
68 void *(*CreateFromFile)(const char *file);
71 void (*SetVolume)(void *music, int volume);
73 /* Start playing music from the beginning with an optional loop count */
74 int (*Play)(void *music, int play_count);
76 /* Returns SDL_TRUE if music is still playing */
77 SDL_bool (*IsPlaying)(void *music);
79 /* Get music data, returns the number of bytes left */
80 int (*GetAudio)(void *music, void *data, int bytes);
82 /* Seek to a play position (in seconds) */
83 int (*Seek)(void *music, double position);
85 /* Get Music duration in ms */
86 double (*Duration)(void *music);
88 /* Pause playing music */
89 void (*Pause)(void *music);
91 /* Resume playing music */
92 void (*Resume)(void *music);
94 /* Stop playing music */
95 void (*Stop)(void *music);
97 /* Delete a music object */
98 void (*Delete)(void *music);
100 /* Close the library and clean up */
103 /* Unload the library */
104 void (*Unload)(void);
106 } Mix_MusicInterface;
109 extern int get_num_music_interfaces(void);
110 extern Mix_MusicInterface *get_music_interface(int index);
111 extern Mix_MusicType detect_music_type(SDL_RWops *src);
112 extern SDL_bool load_music_type(Mix_MusicType type);
113 extern SDL_bool open_music_type(Mix_MusicType type);
114 extern SDL_bool has_music(Mix_MusicType type);
115 extern void open_music(const SDL_AudioSpec *spec);
116 extern int music_pcm_getaudio(void *context, void *data, int bytes, int volume,
117 int (*GetSome)(void *context, void *data, int bytes, SDL_bool *done));
118 extern void SDLCALL music_mixer(void *udata, Uint8 *stream, int len);
119 extern void close_music(void);
120 extern void unload_music(void);
122 extern char *music_cmd;
123 extern SDL_AudioSpec music_spec;
125 #endif /* MUSIC_H_ */
127 /* vi: set ts=4 sw=4 expandtab: */