/* * fluid_channel_set_preset */ int fluid_channel_set_preset(fluid_channel_t* chan, fluid_preset_t* preset) { fluid_preset_notify(chan->preset, FLUID_PRESET_UNSELECTED, chan->channum); fluid_preset_notify(preset, FLUID_PRESET_SELECTED, chan->channum); if (chan->preset) delete_fluid_preset (chan->preset); chan->preset = preset; return FLUID_OK; }
/* Should only be called from synthesis context */ int fluid_channel_set_preset(fluid_channel_t* chan, fluid_preset_t* preset) { fluid_preset_notify (chan->preset, FLUID_PRESET_UNSELECTED, chan->channum); if (chan->preset) { fluid_sfont_t *sfont; sfont = chan->preset->sfont; fluid_preset_delete_internal (chan->preset); fluid_synth_sfont_unref (chan->synth, sfont); /* -- unref preset's SoundFont */ } chan->preset = preset; fluid_preset_notify (preset, FLUID_PRESET_SELECTED, chan->channum); return FLUID_OK; }