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.
This commit is contained in:
Robin Gareus 2017-06-19 09:52:11 +02:00
parent 2627cd414c
commit fe83e1e2ed
4 changed files with 9 additions and 8 deletions

View 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;

View 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 ()

View 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)

View 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