Move logarithmic property into Evoral, add rangesteps
authorRobin Gareus <robin@gareus.org>
Mon, 19 Jun 2017 07:52:11 +0000 (09:52 +0200)
committerRobin Gareus <robin@gareus.org>
Wed, 21 Jun 2017 16:12:14 +0000 (18:12 +0200)
This allows complete mathematical description of a given parameter
and parameter values.

Semantic type abstraction is reserved for Ardour::ParameterDescriptor.

libs/ardour/ardour/parameter_descriptor.h
libs/ardour/luabindings.cc
libs/ardour/parameter_descriptor.cc
libs/evoral/evoral/ParameterDescriptor.hpp

index 978bd3d04260b8da8d30e546357dbe6af6ea1f98..60950bb14b88dda63f8d541b79f4b307b2e9799e 100644 (file)
@@ -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;
index 8e3892c871ef75e4c308c2b0c46688355229088d..3125ab1fe64825b87ceb0fdf6a759ebfedf7f896 100644 (file)
@@ -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 ()
 
index f6460a514efe96762f908016f32d7640a3b7f312..7acbb9477248c6f0fec1ef2ee6f5ae6857bd3727 100644 (file)
@@ -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)
index 5eac28eba9db9fe273292acc70dbe02eaaa6e867..ccb25fa67afbd8a253301ba9d0464e598266ab33 100644 (file)
@@ -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