music_mod.h
author Sam Lantinga <slouken@libsdl.org>
Sat, 31 Dec 2011 10:27:48 -0500
changeset 518 8bc9b5fd2aae
parent 419 e27fe0bfe470
child 521 565549e046b0
permissions -rw-r--r--
Happy New Year!
slouken@411
     1
/*
slouken@518
     2
  SDL_mixer:  An audio mixer library based on the SDL library
slouken@518
     3
  Copyright (C) 1997-2012 Sam Lantinga <slouken@libsdl.org>
slouken@411
     4
slouken@518
     5
  This software is provided 'as-is', without any express or implied
slouken@518
     6
  warranty.  In no event will the authors be held liable for any damages
slouken@518
     7
  arising from the use of this software.
slouken@411
     8
slouken@518
     9
  Permission is granted to anyone to use this software for any purpose,
slouken@518
    10
  including commercial applications, and to alter it and redistribute it
slouken@518
    11
  freely, subject to the following restrictions:
slouken@411
    12
slouken@518
    13
  1. The origin of this software must not be misrepresented; you must not
slouken@518
    14
     claim that you wrote the original software. If you use this software
slouken@518
    15
     in a product, an acknowledgment in the product documentation would be
slouken@518
    16
     appreciated but is not required.
slouken@518
    17
  2. Altered source versions must be plainly marked as such, and must not be
slouken@518
    18
     misrepresented as being the original software.
slouken@518
    19
  3. This notice may not be removed or altered from any source distribution.
slouken@411
    20
*/
slouken@411
    21
slouken@411
    22
/* $Id: music_mod.h 4211 2008-12-08 00:27:32Z slouken $ */
slouken@411
    23
slouken@411
    24
#ifdef MOD_MUSIC
slouken@411
    25
slouken@411
    26
/* This file supports MOD tracker music streams */
slouken@411
    27
slouken@411
    28
struct MODULE;
slouken@411
    29
slouken@411
    30
/* Initialize the Ogg Vorbis player, with the given mixer settings
slouken@411
    31
   This function returns 0, or -1 if there was an error.
slouken@411
    32
 */
slouken@411
    33
extern int MOD_init(SDL_AudioSpec *mixer);
slouken@411
    34
slouken@411
    35
/* Uninitialize the music players */
slouken@411
    36
extern void MOD_exit(void);
slouken@411
    37
slouken@411
    38
/* Set the volume for a MOD stream */
slouken@411
    39
extern void MOD_setvolume(struct MODULE *music, int volume);
slouken@411
    40
slouken@411
    41
/* Load a MOD stream from the given file */
slouken@411
    42
extern struct MODULE *MOD_new(const char *file);
slouken@411
    43
slouken@411
    44
/* Load a MOD stream from an SDL_RWops object */
slouken@411
    45
extern struct MODULE *MOD_new_RW(SDL_RWops *rw);
slouken@411
    46
slouken@411
    47
/* Start playback of a given MOD stream */
slouken@411
    48
extern void MOD_play(struct MODULE *music);
slouken@411
    49
slouken@411
    50
/* Return non-zero if a stream is currently playing */
slouken@411
    51
extern int MOD_playing(struct MODULE *music);
slouken@411
    52
slouken@411
    53
/* Play some of a stream previously started with MOD_play() */
slouken@411
    54
extern int MOD_playAudio(struct MODULE *music, Uint8 *stream, int len);
slouken@411
    55
slouken@411
    56
/* Stop playback of a stream previously started with MOD_play() */
slouken@411
    57
extern void MOD_stop(struct MODULE *music);
slouken@411
    58
slouken@411
    59
/* Close the given MOD stream */
slouken@411
    60
extern void MOD_delete(struct MODULE *music);
slouken@411
    61
slouken@411
    62
/* Jump (seek) to a given position (time is in seconds) */
slouken@411
    63
extern void MOD_jump_to_time(struct MODULE *music, double time);
slouken@411
    64
slouken@411
    65
#endif /* MOD_MUSIC */