music_modplug.h
author Sam Lantinga <slouken@libsdl.org>
Mon, 16 Nov 2009 04:40:54 +0000
changeset 481 286c27f54ea1
child 521 565549e046b0
permissions -rw-r--r--
Jon Atkins to Sam

I added libmodplug as a possible music player
defaulted to no in configure for now.
libmodplug has higher quality than mikmod, and it seems to be ported to all the major modern OS's (Linux/Win/OSX).
     1 #ifdef MODPLUG_MUSIC
     2 
     3 #include "modplug.h"
     4 #include "SDL_rwops.h"
     5 #include "SDL_audio.h"
     6 #include "SDL_mixer.h"
     7 
     8 typedef struct {
     9 	ModPlugFile *file;
    10 	int playing;
    11 } modplug_data;
    12 
    13 int modplug_init(SDL_AudioSpec *mixer);
    14 
    15 /* Uninitialize the music players */
    16 void modplug_exit(void);
    17 
    18 /* Set the volume for a modplug stream */
    19 void modplug_setvolume(modplug_data *music, int volume);
    20 
    21 /* Load a modplug stream from the given file */
    22 modplug_data *modplug_new(const char *file);
    23 
    24 /* Load a modplug stream from an SDL_RWops object */
    25 modplug_data *modplug_new_RW(SDL_RWops *rw);
    26 
    27 /* Start playback of a given modplug stream */
    28 void modplug_play(modplug_data *music);
    29 
    30 /* Return non-zero if a stream is currently playing */
    31 int modplug_playing(modplug_data *music);
    32 
    33 /* Play some of a stream previously started with modplug_play() */
    34 int modplug_playAudio(modplug_data *music, Uint8 *stream, int len);
    35 
    36 /* Stop playback of a stream previously started with modplug_play() */
    37 void modplug_stop(modplug_data *music);
    38 
    39 /* Close the given modplug stream */
    40 void modplug_delete(modplug_data *music);
    41 
    42 /* Jump (seek) to a given position (time is in seconds) */
    43 void modplug_jump_to_time(modplug_data *music, double time);
    44 
    45 #endif