music_modplug.h
author Ozkan Sezer <sezeroz@gmail.com>
Sat, 13 Oct 2018 23:02:04 +0300
branchSDL-1.2
changeset 908 6b860486ce24
parent 907 f4c576887ec3
permissions -rw-r--r--
Mix_InitMP3: unload dll if mpg123_init() fails.
     1 #ifdef MODPLUG_MUSIC
     2 
     3 #ifdef MODPLUG_HEADER
     4 #include MODPLUG_HEADER
     5 #else
     6 #include <libmodplug/modplug.h>
     7 #endif
     8 #include "SDL_rwops.h"
     9 #include "SDL_audio.h"
    10 #include "SDL_mixer.h"
    11 
    12 typedef struct {
    13 	ModPlugFile *file;
    14 	int playing;
    15 } modplug_data;
    16 
    17 int modplug_init(SDL_AudioSpec *mixer);
    18 
    19 /* Uninitialize the music players */
    20 void modplug_exit(void);
    21 
    22 /* Set the volume for a modplug stream */
    23 void modplug_setvolume(modplug_data *music, int volume);
    24 
    25 /* Load a modplug stream from an SDL_RWops object */
    26 modplug_data *modplug_new_RW(SDL_RWops *rw, int freerw);
    27 
    28 /* Start playback of a given modplug stream */
    29 void modplug_play(modplug_data *music);
    30 
    31 /* Return non-zero if a stream is currently playing */
    32 int modplug_playing(modplug_data *music);
    33 
    34 /* Play some of a stream previously started with modplug_play() */
    35 int modplug_playAudio(modplug_data *music, Uint8 *stream, int len);
    36 
    37 /* Stop playback of a stream previously started with modplug_play() */
    38 void modplug_stop(modplug_data *music);
    39 
    40 /* Close the given modplug stream */
    41 void modplug_delete(modplug_data *music);
    42 
    43 /* Jump (seek) to a given position (time is in seconds) */
    44 void modplug_jump_to_time(modplug_data *music, double time);
    45 
    46 #endif