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.
slouken@481
     1
#ifdef MODPLUG_MUSIC
slouken@481
     2
sezeroz@907
     3
#ifdef MODPLUG_HEADER
sezeroz@907
     4
#include MODPLUG_HEADER
sezeroz@907
     5
#else
sezeroz@907
     6
#include <libmodplug/modplug.h>
sezeroz@907
     7
#endif
slouken@481
     8
#include "SDL_rwops.h"
slouken@481
     9
#include "SDL_audio.h"
slouken@481
    10
#include "SDL_mixer.h"
slouken@481
    11
slouken@481
    12
typedef struct {
slouken@481
    13
	ModPlugFile *file;
slouken@481
    14
	int playing;
slouken@481
    15
} modplug_data;
slouken@481
    16
slouken@481
    17
int modplug_init(SDL_AudioSpec *mixer);
slouken@481
    18
slouken@481
    19
/* Uninitialize the music players */
slouken@481
    20
void modplug_exit(void);
slouken@481
    21
slouken@481
    22
/* Set the volume for a modplug stream */
slouken@481
    23
void modplug_setvolume(modplug_data *music, int volume);
slouken@481
    24
slouken@481
    25
/* Load a modplug stream from an SDL_RWops object */
slouken@521
    26
modplug_data *modplug_new_RW(SDL_RWops *rw, int freerw);
slouken@481
    27
slouken@481
    28
/* Start playback of a given modplug stream */
slouken@481
    29
void modplug_play(modplug_data *music);
slouken@481
    30
slouken@481
    31
/* Return non-zero if a stream is currently playing */
slouken@481
    32
int modplug_playing(modplug_data *music);
slouken@481
    33
slouken@481
    34
/* Play some of a stream previously started with modplug_play() */
slouken@481
    35
int modplug_playAudio(modplug_data *music, Uint8 *stream, int len);
slouken@481
    36
slouken@481
    37
/* Stop playback of a stream previously started with modplug_play() */
slouken@481
    38
void modplug_stop(modplug_data *music);
slouken@481
    39
slouken@481
    40
/* Close the given modplug stream */
slouken@481
    41
void modplug_delete(modplug_data *music);
slouken@481
    42
slouken@481
    43
/* Jump (seek) to a given position (time is in seconds) */
slouken@481
    44
void modplug_jump_to_time(modplug_data *music, double time);
slouken@481
    45
slouken@481
    46
#endif