music_modplug.h
author Sam Lantinga <slouken@libsdl.org>
Sat, 02 Jan 2016 22:12:31 -0800
changeset 712 7e59d684b070
parent 711 f40c5ac95b12
child 725 bdf7b8d20566
permissions -rw-r--r--
Updated to version 2.0.1
slouken@639
     1
/*
slouken@639
     2
  SDL_mixer:  An audio mixer library based on the SDL library
slouken@711
     3
  Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
slouken@639
     4
slouken@639
     5
  This software is provided 'as-is', without any express or implied
slouken@639
     6
  warranty.  In no event will the authors be held liable for any damages
slouken@639
     7
  arising from the use of this software.
slouken@639
     8
slouken@639
     9
  Permission is granted to anyone to use this software for any purpose,
slouken@639
    10
  including commercial applications, and to alter it and redistribute it
slouken@639
    11
  freely, subject to the following restrictions:
slouken@639
    12
slouken@639
    13
  1. The origin of this software must not be misrepresented; you must not
slouken@639
    14
     claim that you wrote the original software. If you use this software
slouken@639
    15
     in a product, an acknowledgment in the product documentation would be
slouken@639
    16
     appreciated but is not required.
slouken@639
    17
  2. Altered source versions must be plainly marked as such, and must not be
slouken@639
    18
     misrepresented as being the original software.
slouken@639
    19
  3. This notice may not be removed or altered from any source distribution.
slouken@639
    20
*/
slouken@639
    21
slouken@481
    22
#ifdef MODPLUG_MUSIC
slouken@481
    23
slouken@695
    24
#ifdef MODPLUG_HEADER
slouken@695
    25
#include MODPLUG_HEADER
slouken@695
    26
#else
slouken@695
    27
#include <libmodplug/modplug.h>
slouken@695
    28
#endif
slouken@481
    29
#include "SDL_rwops.h"
slouken@481
    30
#include "SDL_audio.h"
slouken@481
    31
#include "SDL_mixer.h"
slouken@481
    32
slouken@481
    33
typedef struct {
slouken@617
    34
    ModPlugFile *file;
slouken@617
    35
    int playing;
slouken@481
    36
} modplug_data;
slouken@481
    37
slouken@481
    38
int modplug_init(SDL_AudioSpec *mixer);
slouken@481
    39
slouken@481
    40
/* Uninitialize the music players */
slouken@481
    41
void modplug_exit(void);
slouken@481
    42
slouken@481
    43
/* Set the volume for a modplug stream */
slouken@481
    44
void modplug_setvolume(modplug_data *music, int volume);
slouken@481
    45
slouken@481
    46
/* Load a modplug stream from an SDL_RWops object */
slouken@521
    47
modplug_data *modplug_new_RW(SDL_RWops *rw, int freerw);
slouken@481
    48
slouken@481
    49
/* Start playback of a given modplug stream */
slouken@481
    50
void modplug_play(modplug_data *music);
slouken@481
    51
slouken@481
    52
/* Return non-zero if a stream is currently playing */
slouken@481
    53
int modplug_playing(modplug_data *music);
slouken@481
    54
slouken@481
    55
/* Play some of a stream previously started with modplug_play() */
slouken@481
    56
int modplug_playAudio(modplug_data *music, Uint8 *stream, int len);
slouken@481
    57
slouken@481
    58
/* Stop playback of a stream previously started with modplug_play() */
slouken@481
    59
void modplug_stop(modplug_data *music);
slouken@481
    60
slouken@481
    61
/* Close the given modplug stream */
slouken@481
    62
void modplug_delete(modplug_data *music);
slouken@481
    63
slouken@481
    64
/* Jump (seek) to a given position (time is in seconds) */
slouken@481
    65
void modplug_jump_to_time(modplug_data *music, double time);
slouken@481
    66
slouken@639
    67
#endif /* MODPLUG_MUSIC */