start hooking up fileChooser to use valueTree instead of coupling to fluidSynth model

This commit is contained in:
Alex Birch
2019-07-10 23:52:15 +01:00
parent d972a23ce8
commit e02188b7f4
4 changed files with 47 additions and 12 deletions

View File

@ -27,11 +27,11 @@ FluidSynthModel::FluidSynthModel(
, channel{0}/*,
mod(nullptr)*/
{
valueTreeState.state.getChildWithName("soundFont").addListener(this);
valueTreeState.state.addListener(this);
}
FluidSynthModel::~FluidSynthModel() {
valueTreeState.state.getChildWithName("soundFont").removeListener(this);
valueTreeState.state.removeListener(this);
// if (initialised) {
// delete_fluid_audio_driver(driver);
// delete_fluid_synth(synth);
@ -196,7 +196,7 @@ void FluidSynthModel::initialise() {
fluid_mod_set_amount(mod.get(), 1000.0f);
fluid_synth_add_default_mod(synth.get(), mod.get(), FLUID_SYNTH_ADD);
valueTreeState.state.sendPropertyChangeMessage("soundFont");
valueTreeState.state.getChildWithName("soundFont").sendPropertyChangeMessage("path");
// valueTree.sendPropertyChangeMessage("soundFontPath");
// initialised = true;