fluidsynth.h
author James Le Cuirot <chewi@aura-online.co.uk>
Sun, 20 Mar 2011 14:34:18 +0000
changeset 506 586ae09f8176
child 518 8bc9b5fd2aae
permissions -rw-r--r--
Add FluidSynth backend and generic SoundFont functions. No FluidSynth DLL or headers for MSVC in this commit.
     1 /*
     2     SDL_mixer:  An audio mixer library based on the SDL library
     3     Copyright (C) 1997-2011 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     James Le Cuirot
    20     chewi@aura-online.co.uk
    21 */
    22 
    23 #ifndef _FLUIDSYNTH_H_
    24 #define _FLUIDSYNTH_H_
    25 
    26 #include "dynamic_fluidsynth.h"
    27 #include <SDL_rwops.h>
    28 #include <SDL_audio.h>
    29 
    30 typedef struct {
    31 	SDL_AudioCVT convert;
    32 	fluid_synth_t *synth;
    33 	fluid_player_t* player;
    34 } FluidSynthMidiSong;
    35 
    36 int fluidsynth_init(SDL_AudioSpec *mixer);
    37 FluidSynthMidiSong *fluidsynth_loadsong(const char *midifile);
    38 FluidSynthMidiSong *fluidsynth_loadsong_RW(SDL_RWops *rw);
    39 void fluidsynth_freesong(FluidSynthMidiSong *song);
    40 void fluidsynth_start(FluidSynthMidiSong *song);
    41 void fluidsynth_stop(FluidSynthMidiSong *song);
    42 int fluidsynth_active(FluidSynthMidiSong *song);
    43 void fluidsynth_setvolume(FluidSynthMidiSong *song, int volume);
    44 int fluidsynth_playsome(FluidSynthMidiSong *song, void *stream, int len);
    45 
    46 #endif /* _FLUIDSYNTH_H_ */