summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-08-03 20:53:49 +0200
committerRobin Gareus <robin@gareus.org>2016-08-03 20:53:49 +0200
commitd6fd0486aef08fcccf013d889734971ed01eaedd (patch)
tree47fee343a20f4586da6aabd3404adabaf53d0c52 /libs
parentfcf9836da09751da80fe1ed78b36d531ec940e1a (diff)
add support for VST default values (instantiation time value)
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/ardour/vst_plugin.h1
-rw-r--r--libs/ardour/vst_plugin.cc7
2 files changed, 6 insertions, 2 deletions
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 <uint32_t, float> _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;
}