music_mod.h
author Sam Lantinga <slouken@libsdl.org>
Sun, 08 Nov 2009 18:40:07 +0000
changeset 474 a2c238c0c4b2
parent 419 e27fe0bfe470
child 518 8bc9b5fd2aae
permissions -rw-r--r--
Don't break binary compatibility!
slouken@411
     1
/*
slouken@411
     2
    SDL_mixer:  An audio mixer library based on the SDL library
slouken@411
     3
    Copyright (C) 1997-2009 Sam Lantinga
slouken@411
     4
slouken@411
     5
    This library is free software; you can redistribute it and/or
slouken@411
     6
    modify it under the terms of the GNU Library General Public
slouken@411
     7
    License as published by the Free Software Foundation; either
slouken@411
     8
    version 2 of the License, or (at your option) any later version.
slouken@411
     9
slouken@411
    10
    This library is distributed in the hope that it will be useful,
slouken@411
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@411
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
slouken@411
    13
    Library General Public License for more details.
slouken@411
    14
slouken@411
    15
    You should have received a copy of the GNU Library General Public
slouken@411
    16
    License along with this library; if not, write to the Free
slouken@411
    17
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
slouken@411
    18
slouken@411
    19
    Sam Lantinga
slouken@411
    20
    slouken@libsdl.org
slouken@411
    21
*/
slouken@411
    22
slouken@411
    23
/* $Id: music_mod.h 4211 2008-12-08 00:27:32Z slouken $ */
slouken@411
    24
slouken@411
    25
#ifdef MOD_MUSIC
slouken@411
    26
slouken@411
    27
/* This file supports MOD tracker music streams */
slouken@411
    28
slouken@411
    29
struct MODULE;
slouken@411
    30
slouken@411
    31
/* Initialize the Ogg Vorbis player, with the given mixer settings
slouken@411
    32
   This function returns 0, or -1 if there was an error.
slouken@411
    33
 */
slouken@411
    34
extern int MOD_init(SDL_AudioSpec *mixer);
slouken@411
    35
slouken@411
    36
/* Uninitialize the music players */
slouken@411
    37
extern void MOD_exit(void);
slouken@411
    38
slouken@411
    39
/* Set the volume for a MOD stream */
slouken@411
    40
extern void MOD_setvolume(struct MODULE *music, int volume);
slouken@411
    41
slouken@411
    42
/* Load a MOD stream from the given file */
slouken@411
    43
extern struct MODULE *MOD_new(const char *file);
slouken@411
    44
slouken@411
    45
/* Load a MOD stream from an SDL_RWops object */
slouken@411
    46
extern struct MODULE *MOD_new_RW(SDL_RWops *rw);
slouken@411
    47
slouken@411
    48
/* Start playback of a given MOD stream */
slouken@411
    49
extern void MOD_play(struct MODULE *music);
slouken@411
    50
slouken@411
    51
/* Return non-zero if a stream is currently playing */
slouken@411
    52
extern int MOD_playing(struct MODULE *music);
slouken@411
    53
slouken@411
    54
/* Play some of a stream previously started with MOD_play() */
slouken@411
    55
extern int MOD_playAudio(struct MODULE *music, Uint8 *stream, int len);
slouken@411
    56
slouken@411
    57
/* Stop playback of a stream previously started with MOD_play() */
slouken@411
    58
extern void MOD_stop(struct MODULE *music);
slouken@411
    59
slouken@411
    60
/* Close the given MOD stream */
slouken@411
    61
extern void MOD_delete(struct MODULE *music);
slouken@411
    62
slouken@411
    63
/* Jump (seek) to a given position (time is in seconds) */
slouken@411
    64
extern void MOD_jump_to_time(struct MODULE *music, double time);
slouken@411
    65
slouken@411
    66
#endif /* MOD_MUSIC */