diff --git a/libs/ardour/ardour/vst_plugin.h b/libs/ardour/ardour/vst_plugin.h index 2f2bcaae83..e56b9c005c 100644 --- a/libs/ardour/ardour/vst_plugin.h +++ b/libs/ardour/ardour/vst_plugin.h @@ -118,6 +118,7 @@ protected: framepos_t _transport_frame; float _transport_speed; + mutable std::map _parameter_defaults; }; } diff --git a/libs/ardour/vst_plugin.cc b/libs/ardour/vst_plugin.cc index 728219b0fe..8188354062 100644 --- a/libs/ardour/vst_plugin.cc +++ b/libs/ardour/vst_plugin.cc @@ -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; }