summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-02-15 01:42:48 +0000
committerCarl Hetherington <carl@carlh.net>2011-02-15 01:42:48 +0000
commitea11968f95c626fcba3f31423ed9de13c258bcdc (patch)
tree051d0df74da5196f0c3032cfa7c34d2df46184e5 /libs/ardour/ardour
parent4aaa507472ebc7752b32bb4398e694120acd98ee (diff)
Clean up and hopefully fix handling of logarithmic plugin parameters (fixes #3769).
git-svn-id: svn://localhost/ardour2/branches/3.0@8850 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r--libs/ardour/ardour/automation_control.h21
-rw-r--r--libs/ardour/ardour/plugin.h4
-rw-r--r--libs/ardour/ardour/plugin_insert.h11
3 files changed, 21 insertions, 15 deletions
diff --git a/libs/ardour/ardour/automation_control.h b/libs/ardour/ardour/automation_control.h
index 006e74346f..d786f28ab6 100644
--- a/libs/ardour/ardour/automation_control.h
+++ b/libs/ardour/ardour/automation_control.h
@@ -74,21 +74,26 @@ public:
return ((ARDOUR::AutomationList*)_list.get())->stop_touch(mark, when);
}
- /** Set the value and do the right thing based on automation state
- * (e.g. record if necessary, etc.)
- */
- void set_value(double val);
-
- /** Get the current effective value based on automation state.
- */
- double get_value() const;
+ void set_value (double);
+ double get_value () const;
double lower() const { return parameter().min(); }
double upper() const { return parameter().max(); }
const ARDOUR::Session& session() const { return _session; }
+ /** Convert user values to UI values. See pbd/controllable.h */
+ virtual double user_to_ui (double val) const {
+ return val;
+ }
+
+ /** Convert UI values to user values. See pbd/controllable.h */
+ virtual double ui_to_user (double val) const {
+ return val;
+ }
+
protected:
+
ARDOUR::Session& _session;
};
diff --git a/libs/ardour/ardour/plugin.h b/libs/ardour/ardour/plugin.h
index 00ed6bdc94..f2af0360fc 100644
--- a/libs/ardour/ardour/plugin.h
+++ b/libs/ardour/ardour/plugin.h
@@ -90,8 +90,8 @@ class Plugin : public PBD::StatefulDestructible, public Latent
bool logarithmic;
bool sr_dependent;
std::string label;
- float lower;
- float upper;
+ float lower; ///< if this is a frequency, it will be in Hz (not a fraction of the sample rate)
+ float upper; ///< if this is a frequency, it will be in Hz (not a fraction of the sample rate)
float step;
float smallstep;
float largestep;
diff --git a/libs/ardour/ardour/plugin_insert.h b/libs/ardour/ardour/plugin_insert.h
index ea7a081c22..45a0478584 100644
--- a/libs/ardour/ardour/plugin_insert.h
+++ b/libs/ardour/ardour/plugin_insert.h
@@ -85,13 +85,16 @@ class PluginInsert : public Processor
double get_value (void) const;
XMLNode& get_state();
- bool logarithmic () const {
- return _logarithmic;
- }
+ double user_to_ui (double) const;
+ double ui_to_user (double) const;
+ double plugin_to_ui (double) const;
private:
+ double user_to_plugin (double) const;
+
PluginInsert* _plugin;
bool _logarithmic;
+ bool _sr_dependent;
bool _toggled;
};
@@ -117,8 +120,6 @@ class PluginInsert : public Processor
return _splitting;
}
- std::string value_as_string (boost::shared_ptr<AutomationControl>) const;
-
PBD::Signal2<void,BufferSet*, BufferSet*> AnalysisDataGathered;
/** Emitted when the return value of splitting () has changed */
PBD::Signal0<void> SplittingChanged;