summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/parameter_descriptor.h
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-06-19 16:34:29 +0200
committerRobin Gareus <robin@gareus.org>2017-06-21 18:12:45 +0200
commit37905d82a611a09342faf52d01378c9b4e86a2ac (patch)
treed1b1340bbacff5e70d969d2f74ae57b711b66375 /libs/ardour/ardour/parameter_descriptor.h
parent8dcc28c9ad91baade9c30a2ec6d59a1f799dc654 (diff)
Centralize Parameter scaling
This exposes an AutomationType dependent abstract version of inteface_to_internal(), internal_to_interface().
Diffstat (limited to 'libs/ardour/ardour/parameter_descriptor.h')
-rw-r--r--libs/ardour/ardour/parameter_descriptor.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/libs/ardour/ardour/parameter_descriptor.h b/libs/ardour/ardour/parameter_descriptor.h
index 2348b05903..a451887f22 100644
--- a/libs/ardour/ardour/parameter_descriptor.h
+++ b/libs/ardour/ardour/parameter_descriptor.h
@@ -55,6 +55,24 @@ struct LIBARDOUR_API ParameterDescriptor : public Evoral::ParameterDescriptor
ParameterDescriptor();
+ /** control-value to normalized [0..1] range
+ *
+ * Convert given AutomationType from lower/upper range to [0..1]
+ * interface value, using settings from Evoral::ParameterDescriptor.
+ *
+ * default for AutomationControl::internal_to_interface ();
+ */
+ float to_interface (float) const;
+
+ /** normalized [0..1] to control-value range
+ *
+ * Convert [0..1] to the control's range of this AutomationType
+ * using settings from Evoral::ParameterDescriptor.
+ *
+ * default for AutomationControl::interface_to_internal ();
+ */
+ float from_interface (float) const;
+
/** Set step, smallstep, and largestep, based on current description. */
void update_steps();