music_modplug.h
author Sam Lantinga <slouken@libsdl.org>
Wed, 04 Jan 2012 00:16:03 -0500
changeset 542 3de4970b36d4
parent 521 565549e046b0
child 617 87116a42526e
child 907 f4c576887ec3
permissions -rw-r--r--
Fixed bug 1252 - Added Mix_LoadMUSType_RW() so you can tell SDL_mixer what type the music is

This involved a complete refactoring of the music loading so it's entirely rwops based and has improved music type detection code.
slouken@481
     1
#ifdef MODPLUG_MUSIC
slouken@481
     2
slouken@481
     3
#include "modplug.h"
slouken@481
     4
#include "SDL_rwops.h"
slouken@481
     5
#include "SDL_audio.h"
slouken@481
     6
#include "SDL_mixer.h"
slouken@481
     7
slouken@481
     8
typedef struct {
slouken@481
     9
	ModPlugFile *file;
slouken@481
    10
	int playing;
slouken@481
    11
} modplug_data;
slouken@481
    12
slouken@481
    13
int modplug_init(SDL_AudioSpec *mixer);
slouken@481
    14
slouken@481
    15
/* Uninitialize the music players */
slouken@481
    16
void modplug_exit(void);
slouken@481
    17
slouken@481
    18
/* Set the volume for a modplug stream */
slouken@481
    19
void modplug_setvolume(modplug_data *music, int volume);
slouken@481
    20
slouken@481
    21
/* Load a modplug stream from an SDL_RWops object */
slouken@521
    22
modplug_data *modplug_new_RW(SDL_RWops *rw, int freerw);
slouken@481
    23
slouken@481
    24
/* Start playback of a given modplug stream */
slouken@481
    25
void modplug_play(modplug_data *music);
slouken@481
    26
slouken@481
    27
/* Return non-zero if a stream is currently playing */
slouken@481
    28
int modplug_playing(modplug_data *music);
slouken@481
    29
slouken@481
    30
/* Play some of a stream previously started with modplug_play() */
slouken@481
    31
int modplug_playAudio(modplug_data *music, Uint8 *stream, int len);
slouken@481
    32
slouken@481
    33
/* Stop playback of a stream previously started with modplug_play() */
slouken@481
    34
void modplug_stop(modplug_data *music);
slouken@481
    35
slouken@481
    36
/* Close the given modplug stream */
slouken@481
    37
void modplug_delete(modplug_data *music);
slouken@481
    38
slouken@481
    39
/* Jump (seek) to a given position (time is in seconds) */
slouken@481
    40
void modplug_jump_to_time(modplug_data *music, double time);
slouken@481
    41
slouken@481
    42
#endif