diff options
author | Robin Gareus <robin@gareus.org> | 2017-06-19 09:52:11 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-06-21 18:12:14 +0200 |
commit | fe83e1e2ed450814dfec0ffed7a2c2559c6fa8b6 (patch) | |
tree | 426b6d1e9f697d0f324f2904e617c199ef70d838 | |
parent | 2627cd414c83bce07f6c2462ffd32b8989df3342 (diff) |
Move logarithmic property into Evoral, add rangesteps
This allows complete mathematical description of a given parameter
and parameter values.
Semantic type abstraction is reserved for Ardour::ParameterDescriptor.
-rw-r--r-- | libs/ardour/ardour/parameter_descriptor.h | 1 | ||||
-rw-r--r-- | libs/ardour/luabindings.cc | 2 | ||||
-rw-r--r-- | libs/ardour/parameter_descriptor.cc | 2 | ||||
-rw-r--r-- | libs/evoral/evoral/ParameterDescriptor.hpp | 12 |
4 files changed, 9 insertions, 8 deletions
diff --git a/libs/ardour/ardour/parameter_descriptor.h b/libs/ardour/ardour/parameter_descriptor.h index 978bd3d042..60950bb14b 100644 --- a/libs/ardour/ardour/parameter_descriptor.h +++ b/libs/ardour/ardour/parameter_descriptor.h @@ -69,7 +69,6 @@ struct LIBARDOUR_API ParameterDescriptor : public Evoral::ParameterDescriptor float smallstep; float largestep; bool integer_step; - bool logarithmic; bool sr_dependent; bool min_unbound; bool max_unbound; diff --git a/libs/ardour/luabindings.cc b/libs/ardour/luabindings.cc index 8e3892c871..3125ab1fe6 100644 --- a/libs/ardour/luabindings.cc +++ b/libs/ardour/luabindings.cc @@ -553,6 +553,7 @@ LuaBindings::common (lua_State* L) .addData ("upper", &Evoral::ParameterDescriptor::upper) .addData ("normal", &Evoral::ParameterDescriptor::normal) .addData ("toggled", &Evoral::ParameterDescriptor::toggled) + .addData ("logarithmic", &Evoral::ParameterDescriptor::logarithmic) .endClass () .beginClass <Evoral::Range<framepos_t> > ("Range") @@ -1279,7 +1280,6 @@ LuaBindings::common (lua_State* L) .deriveClass <ParameterDescriptor, Evoral::ParameterDescriptor> ("ParameterDescriptor") .addVoidConstructor () .addData ("label", &ParameterDescriptor::label) - .addData ("logarithmic", &ParameterDescriptor::logarithmic) .addStaticFunction ("midi_note_name", &ParameterDescriptor::midi_note_name) .endClass () diff --git a/libs/ardour/parameter_descriptor.cc b/libs/ardour/parameter_descriptor.cc index f6460a514e..7acbb94772 100644 --- a/libs/ardour/parameter_descriptor.cc +++ b/libs/ardour/parameter_descriptor.cc @@ -43,7 +43,6 @@ ParameterDescriptor::ParameterDescriptor(const Evoral::Parameter& parameter) , largestep(0) , integer_step(parameter.type() >= MidiCCAutomation && parameter.type() <= MidiChannelPressureAutomation) - , logarithmic(false) , sr_dependent(false) , min_unbound(0) , max_unbound(0) @@ -142,7 +141,6 @@ ParameterDescriptor::ParameterDescriptor() , smallstep(0) , largestep(0) , integer_step(false) - , logarithmic(false) , sr_dependent(false) , min_unbound(0) , max_unbound(0) diff --git a/libs/evoral/evoral/ParameterDescriptor.hpp b/libs/evoral/evoral/ParameterDescriptor.hpp index 5eac28eba9..ccb25fa67a 100644 --- a/libs/evoral/evoral/ParameterDescriptor.hpp +++ b/libs/evoral/evoral/ParameterDescriptor.hpp @@ -29,12 +29,16 @@ struct ParameterDescriptor , lower(0.0) , upper(1.0) , toggled(false) + , logarithmic(false) + , rangesteps (0) {} - float normal; ///< Default value - float lower; ///< Minimum value (in Hz, for frequencies) - float upper; ///< Maximum value (in Hz, for frequencies) - bool toggled; ///< True iff parameter is boolean + float normal; ///< Default value + float lower; ///< Minimum value (in Hz, for frequencies) + float upper; ///< Maximum value (in Hz, for frequencies) + bool toggled; ///< True iff parameter is boolean + bool logarithmic; ///< True for log-scale parameters + unsigned int rangesteps; ///< number of steps, [min,max] (inclusive). <= 1 means continuous. == 2 only min, max. For integer controls this is usually (1 + max - min) }; } // namespace Evoral |