mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2025-01-31 13:40:35 +00:00
Added fluid_synth_remove_sfont, moved fluid_synth_add_sfont from
fluid_ramsfont.c to fluid_synth.c
This commit is contained in:
parent
89d04366c1
commit
03ec4ff354
4 changed files with 43 additions and 18 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2004-05-07 Peter Hanappe <peter@hanappe.com>
|
||||||
|
|
||||||
|
* src/fluid_synth.c (fluid_synth_remove_sfont): Added new function
|
||||||
|
|
||||||
2004-05-05 Peter Hanappe <peter@hanappe.com>
|
2004-05-05 Peter Hanappe <peter@hanappe.com>
|
||||||
|
|
||||||
* src/fluid_alsa.c (new_fluid_alsa_seq_driver): The alsa driver
|
* src/fluid_alsa.c (new_fluid_alsa_seq_driver): The alsa driver
|
||||||
|
|
|
@ -218,6 +218,15 @@ FLUIDSYNTH_API int fluid_synth_sfunload(fluid_synth_t* synth, unsigned int id, i
|
||||||
*/
|
*/
|
||||||
FLUIDSYNTH_API int fluid_synth_add_sfont(fluid_synth_t* synth, fluid_sfont_t* sfont);
|
FLUIDSYNTH_API int fluid_synth_add_sfont(fluid_synth_t* synth, fluid_sfont_t* sfont);
|
||||||
|
|
||||||
|
/** Remove a SoundFont that was previously added using
|
||||||
|
* fluid_synth_add_sfont(). The synthesizer does not delete the
|
||||||
|
* SoundFont; this is responsability of the caller.
|
||||||
|
|
||||||
|
\param synth The synthesizer object
|
||||||
|
\param sfont The SoundFont
|
||||||
|
*/
|
||||||
|
FLUIDSYNTH_API void fluid_synth_remove_sfont(fluid_synth_t* synth, fluid_sfont_t* sfont);
|
||||||
|
|
||||||
/** Count the number of loaded SoundFonts.
|
/** Count the number of loaded SoundFonts.
|
||||||
|
|
||||||
\param synth The synthesizer object
|
\param synth The synthesizer object
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
#include "fluid_ramsfont.h"
|
#include "fluid_ramsfont.h"
|
||||||
#include "fluid_sys.h"
|
#include "fluid_sys.h"
|
||||||
#include "fluid_synth.h" // for fluid_synth_add_sfont
|
#include "fluid_synth.h"
|
||||||
|
|
||||||
/* thenumber of samples before the start and after the end */
|
/* thenumber of samples before the start and after the end */
|
||||||
#define SAMPLE_LOOP_MARGIN 8
|
#define SAMPLE_LOOP_MARGIN 8
|
||||||
|
@ -63,23 +63,6 @@ fluid_ramsfont_create_sfont()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* fluid_synth_add_sfont
|
|
||||||
*/
|
|
||||||
/* Could be in fluid_synth.c */
|
|
||||||
int fluid_synth_add_sfont(fluid_synth_t* synth, fluid_sfont_t* sfont)
|
|
||||||
{
|
|
||||||
sfont->id = synth->sfont_id++;
|
|
||||||
|
|
||||||
/* insert the sfont as the first one on the list */
|
|
||||||
synth->sfont = fluid_list_prepend(synth->sfont, sfont);
|
|
||||||
|
|
||||||
/* reset the presets for all channels */
|
|
||||||
fluid_synth_program_reset(synth);
|
|
||||||
|
|
||||||
return sfont->id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/***************************************************************
|
/***************************************************************
|
||||||
*
|
*
|
||||||
* PUBLIC INTERFACE
|
* PUBLIC INTERFACE
|
||||||
|
|
|
@ -2256,6 +2256,35 @@ int fluid_synth_sfreload(fluid_synth_t* synth, unsigned int id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* fluid_synth_add_sfont
|
||||||
|
*/
|
||||||
|
int fluid_synth_add_sfont(fluid_synth_t* synth, fluid_sfont_t* sfont)
|
||||||
|
{
|
||||||
|
sfont->id = synth->sfont_id++;
|
||||||
|
|
||||||
|
/* insert the sfont as the first one on the list */
|
||||||
|
synth->sfont = fluid_list_prepend(synth->sfont, sfont);
|
||||||
|
|
||||||
|
/* reset the presets for all channels */
|
||||||
|
fluid_synth_program_reset(synth);
|
||||||
|
|
||||||
|
return sfont->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* fluid_synth_remove_sfont
|
||||||
|
*/
|
||||||
|
void fluid_synth_remove_sfont(fluid_synth_t* synth, fluid_sfont_t* sfont)
|
||||||
|
{
|
||||||
|
synth->sfont = fluid_list_remove(synth->sfont, sfont);
|
||||||
|
|
||||||
|
/* reset the presets for all channels */
|
||||||
|
fluid_synth_program_reset(synth);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* fluid_synth_sfcount
|
/* fluid_synth_sfcount
|
||||||
*
|
*
|
||||||
* Returns the number of loaded SoundFonts
|
* Returns the number of loaded SoundFonts
|
||||||
|
|
Loading…
Reference in a new issue