diff options
author | Robin Gareus <robin@gareus.org> | 2018-11-22 14:58:44 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2018-11-22 14:58:44 +0100 |
commit | f795462100cd0a16b86ffa7e07edeb166dc53abd (patch) | |
tree | fd69b7b420da1aecc96b60fcd5e88bf164a842ba /libs/ardour/lv2_plugin.cc | |
parent | abf1f286d49482ade939da7e49863a3d63048b42 (diff) |
Save LV2 Port Property values locally
This keeps track of lv2:Parameter properties modified with Port:Set,
currently file-paths.
Diffstat (limited to 'libs/ardour/lv2_plugin.cc')
-rw-r--r-- | libs/ardour/lv2_plugin.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc index 3ae3140577..79bef11cdd 100644 --- a/libs/ardour/lv2_plugin.cc +++ b/libs/ardour/lv2_plugin.cc @@ -1992,6 +1992,16 @@ LV2Plugin::load_supported_properties(PropertyDescriptors& descs) lilv_nodes_free(properties); } +Variant +LV2Plugin::get_property_value (uint32_t prop_id) const +{ + std::map<uint32_t, Variant>::const_iterator it; + if ((it = _property_values.find (prop_id)) == _property_values.end()) { + return Variant(); + } + return it->second; +} + void LV2Plugin::announce_property_values() { @@ -2944,6 +2954,7 @@ LV2Plugin::connect_and_run(BufferSet& bufs, // Emit PropertyChanged signal for UI // TODO: This should emit the control's Changed signal PropertyChanged(prop_id, Variant(Variant::PATH, path)); + _property_values[prop_id] = Variant(Variant::PATH, path); } else { std::cerr << "warning: patch:Set for unknown property" << std::endl; } |