fluidsynth.h
author Sam Lantinga <slouken@libsdl.org>
Sat, 31 Dec 2011 10:27:48 -0500
changeset 518 8bc9b5fd2aae
parent 506 586ae09f8176
child 521 565549e046b0
permissions -rw-r--r--
Happy New Year!
chewi@506
     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>
chewi@506
     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.
chewi@506
     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:
chewi@506
    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.
chewi@506
    20
slouken@518
    21
  James Le Cuirot
slouken@518
    22
  chewi@aura-online.co.uk
chewi@506
    23
*/
chewi@506
    24
chewi@506
    25
#ifndef _FLUIDSYNTH_H_
chewi@506
    26
#define _FLUIDSYNTH_H_
chewi@506
    27
chewi@506
    28
#include "dynamic_fluidsynth.h"
chewi@506
    29
#include <SDL_rwops.h>
chewi@506
    30
#include <SDL_audio.h>
chewi@506
    31
chewi@506
    32
typedef struct {
chewi@506
    33
	SDL_AudioCVT convert;
chewi@506
    34
	fluid_synth_t *synth;
chewi@506
    35
	fluid_player_t* player;
chewi@506
    36
} FluidSynthMidiSong;
chewi@506
    37
chewi@506
    38
int fluidsynth_init(SDL_AudioSpec *mixer);
chewi@506
    39
FluidSynthMidiSong *fluidsynth_loadsong(const char *midifile);
chewi@506
    40
FluidSynthMidiSong *fluidsynth_loadsong_RW(SDL_RWops *rw);
chewi@506
    41
void fluidsynth_freesong(FluidSynthMidiSong *song);
chewi@506
    42
void fluidsynth_start(FluidSynthMidiSong *song);
chewi@506
    43
void fluidsynth_stop(FluidSynthMidiSong *song);
chewi@506
    44
int fluidsynth_active(FluidSynthMidiSong *song);
chewi@506
    45
void fluidsynth_setvolume(FluidSynthMidiSong *song, int volume);
chewi@506
    46
int fluidsynth_playsome(FluidSynthMidiSong *song, void *stream, int len);
chewi@506
    47
chewi@506
    48
#endif /* _FLUIDSYNTH_H_ */