13
0

add support for VST default values (instantiation time value)

This commit is contained in:
Robin Gareus 2016-08-03 20:53:49 +02:00
parent fcf9836da0
commit d6fd0486ae
2 changed files with 6 additions and 2 deletions

View File

@ -118,6 +118,7 @@ protected:
framepos_t _transport_frame;
float _transport_speed;
mutable std::map <uint32_t, float> _parameter_defaults;
};
}

View File

@ -91,9 +91,9 @@ VSTPlugin::set_block_size (pframes_t nframes)
}
float
VSTPlugin::default_value (uint32_t)
VSTPlugin::default_value (uint32_t which)
{
return 0;
return _parameter_defaults[which];
}
float
@ -323,6 +323,9 @@ VSTPlugin::get_parameter_descriptor (uint32_t which, ParameterDescriptor& desc)
desc.sr_dependent = false;
}
desc.normal = get_parameter (which);
_parameter_defaults[which] = desc.normal;
return 0;
}