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