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.
chewi@506
     1
/*
chewi@506
     2
    SDL_mixer:  An audio mixer library based on the SDL library
chewi@506
     3
    Copyright (C) 1997-2011 Sam Lantinga
chewi@506
     4
chewi@506
     5
    This library is free software; you can redistribute it and/or
chewi@506
     6
    modify it under the terms of the GNU Library General Public
chewi@506
     7
    License as published by the Free Software Foundation; either
chewi@506
     8
    version 2 of the License, or (at your option) any later version.
chewi@506
     9
chewi@506
    10
    This library is distributed in the hope that it will be useful,
chewi@506
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
chewi@506
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
chewi@506
    13
    Library General Public License for more details.
chewi@506
    14
chewi@506
    15
    You should have received a copy of the GNU Library General Public
chewi@506
    16
    License along with this library; if not, write to the Free
chewi@506
    17
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
chewi@506
    18
chewi@506
    19
    James Le Cuirot
chewi@506
    20
    chewi@aura-online.co.uk
chewi@506
    21
*/
chewi@506
    22
chewi@506
    23
#ifndef _FLUIDSYNTH_H_
chewi@506
    24
#define _FLUIDSYNTH_H_
chewi@506
    25
chewi@506
    26
#include "dynamic_fluidsynth.h"
chewi@506
    27
#include <SDL_rwops.h>
chewi@506
    28
#include <SDL_audio.h>
chewi@506
    29
chewi@506
    30
typedef struct {
chewi@506
    31
	SDL_AudioCVT convert;
chewi@506
    32
	fluid_synth_t *synth;
chewi@506
    33
	fluid_player_t* player;
chewi@506
    34
} FluidSynthMidiSong;
chewi@506
    35
chewi@506
    36
int fluidsynth_init(SDL_AudioSpec *mixer);
chewi@506
    37
FluidSynthMidiSong *fluidsynth_loadsong(const char *midifile);
chewi@506
    38
FluidSynthMidiSong *fluidsynth_loadsong_RW(SDL_RWops *rw);
chewi@506
    39
void fluidsynth_freesong(FluidSynthMidiSong *song);
chewi@506
    40
void fluidsynth_start(FluidSynthMidiSong *song);
chewi@506
    41
void fluidsynth_stop(FluidSynthMidiSong *song);
chewi@506
    42
int fluidsynth_active(FluidSynthMidiSong *song);
chewi@506
    43
void fluidsynth_setvolume(FluidSynthMidiSong *song, int volume);
chewi@506
    44
int fluidsynth_playsome(FluidSynthMidiSong *song, void *stream, int len);
chewi@506
    45
chewi@506
    46
#endif /* _FLUIDSYNTH_H_ */