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