mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 08:36:32 +01:00
Save LV2 Port Property values locally
This keeps track of lv2:Parameter properties modified with Port:Set, currently file-paths.
This commit is contained in:
parent
abf1f286d4
commit
f795462100
2 changed files with 14 additions and 0 deletions
|
|
@ -172,6 +172,7 @@ class LIBARDOUR_API LV2Plugin : public ARDOUR::Plugin, public ARDOUR::Workee
|
||||||
void set_property(uint32_t key, const Variant& value);
|
void set_property(uint32_t key, const Variant& value);
|
||||||
const PropertyDescriptors& get_supported_properties() const { return _property_descriptors; }
|
const PropertyDescriptors& get_supported_properties() const { return _property_descriptors; }
|
||||||
const ParameterDescriptor& get_property_descriptor(uint32_t id) const;
|
const ParameterDescriptor& get_property_descriptor(uint32_t id) const;
|
||||||
|
Variant get_property_value (uint32_t) const;
|
||||||
void announce_property_values();
|
void announce_property_values();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
@ -231,6 +232,8 @@ class LIBARDOUR_API LV2Plugin : public ARDOUR::Plugin, public ARDOUR::Workee
|
||||||
std::vector<size_t> _port_minimumSize;
|
std::vector<size_t> _port_minimumSize;
|
||||||
std::map<std::string,uint32_t> _port_indices;
|
std::map<std::string,uint32_t> _port_indices;
|
||||||
|
|
||||||
|
std::map<uint32_t, Variant> _property_values;
|
||||||
|
|
||||||
PropertyDescriptors _property_descriptors;
|
PropertyDescriptors _property_descriptors;
|
||||||
|
|
||||||
struct AutomationCtrl {
|
struct AutomationCtrl {
|
||||||
|
|
|
||||||
|
|
@ -1992,6 +1992,16 @@ LV2Plugin::load_supported_properties(PropertyDescriptors& descs)
|
||||||
lilv_nodes_free(properties);
|
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
|
void
|
||||||
LV2Plugin::announce_property_values()
|
LV2Plugin::announce_property_values()
|
||||||
{
|
{
|
||||||
|
|
@ -2944,6 +2954,7 @@ LV2Plugin::connect_and_run(BufferSet& bufs,
|
||||||
// Emit PropertyChanged signal for UI
|
// Emit PropertyChanged signal for UI
|
||||||
// TODO: This should emit the control's Changed signal
|
// TODO: This should emit the control's Changed signal
|
||||||
PropertyChanged(prop_id, Variant(Variant::PATH, path));
|
PropertyChanged(prop_id, Variant(Variant::PATH, path));
|
||||||
|
_property_values[prop_id] = Variant(Variant::PATH, path);
|
||||||
} else {
|
} else {
|
||||||
std::cerr << "warning: patch:Set for unknown property" << std::endl;
|
std::cerr << "warning: patch:Set for unknown property" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue