diff options
author | David Robillard <d@drobilla.net> | 2014-11-01 23:29:10 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-11-02 02:10:24 -0500 |
commit | 8a128b33d38172ae525ac798c53bc105bc4e2c64 (patch) | |
tree | 226459f2fec72a9717d12f190d354f72175607dc /libs/ardour/ardour/parameter_descriptor.h | |
parent | 6dfb11c2d08201f1a27818955707590b762f5a40 (diff) |
Automation of LV2 plugin properties.
Work towards ParameterDescriptor being used more universally to describe control characteristics.
Diffstat (limited to 'libs/ardour/ardour/parameter_descriptor.h')
-rw-r--r-- | libs/ardour/ardour/parameter_descriptor.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libs/ardour/ardour/parameter_descriptor.h b/libs/ardour/ardour/parameter_descriptor.h index a6315ae429..8916f081a3 100644 --- a/libs/ardour/ardour/parameter_descriptor.h +++ b/libs/ardour/ardour/parameter_descriptor.h @@ -21,6 +21,7 @@ #define __ardour_parameter_descriptor_h__ #include "ardour/variant.h" +#include "evoral/Parameter.hpp" namespace ARDOUR { @@ -32,9 +33,29 @@ typedef std::map<const std::string, const float> ScalePoints; */ struct ParameterDescriptor { + ParameterDescriptor(const Evoral::Parameter& parameter) + : key((uint32_t)-1) + , datatype(Variant::VOID) + , normal(parameter.normal()) + , lower(parameter.min()) + , upper(parameter.max()) + , step(0) + , smallstep((upper - lower) / 100.0) + , largestep((upper - lower) / 10.0) + , integer_step(false) + , toggled(parameter.toggled()) + , logarithmic(false) + , sr_dependent(false) + , min_unbound(0) + , max_unbound(0) + , enumeration(false) + , midinote(false) + {} + ParameterDescriptor() : key((uint32_t)-1) , datatype(Variant::VOID) + , normal(0) , lower(0) , upper(0) , step(0) @@ -54,6 +75,7 @@ struct ParameterDescriptor boost::shared_ptr<ScalePoints> scale_points; uint32_t key; ///< for properties Variant::Type datatype; ///< for properties + float normal; float lower; ///< for frequencies, this is in Hz (not a fraction of the sample rate) float upper; ///< for frequencies, this is in Hz (not a fraction of the sample rate) float step; |