diff options
author | Carl Hetherington <carl@carlh.net> | 2012-01-20 18:02:36 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2012-01-20 18:02:36 +0000 |
commit | d03d0363a469a98753a546570bda79f59cba405c (patch) | |
tree | a141e48e5e019b181f8c526fd02d95f0f10b88d0 /libs | |
parent | 24978033ef7b40ec5d408238421f42b3bc9821f3 (diff) |
Remove unused concept of user' values. Make user_to_ui
and ui_to_user virtual members of PBD::Controllable.
git-svn-id: svn://localhost/ardour2/branches/3.0@11286 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/ardour/plugin_insert.h | 4 | ||||
-rw-r--r-- | libs/ardour/plugin_insert.cc | 30 | ||||
-rw-r--r-- | libs/pbd/pbd/controllable.h | 15 |
3 files changed, 14 insertions, 35 deletions
diff --git a/libs/ardour/ardour/plugin_insert.h b/libs/ardour/ardour/plugin_insert.h index 48ce925d3f..f6afd13573 100644 --- a/libs/ardour/ardour/plugin_insert.h +++ b/libs/ardour/ardour/plugin_insert.h @@ -91,12 +91,8 @@ class PluginInsert : public Processor double user_to_ui (double) const; double ui_to_user (double) const; - double plugin_to_ui (double) const; - double plugin_to_user (double) const; private: - double user_to_plugin (double) const; - PluginInsert* _plugin; bool _logarithmic; bool _sr_dependent; diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc index 3120446aba..74f82aaade 100644 --- a/libs/ardour/plugin_insert.cc +++ b/libs/ardour/plugin_insert.cc @@ -1161,28 +1161,19 @@ PluginInsert::PluginControl::set_value (double user_val) { /* FIXME: probably should be taking out some lock here.. */ - double const plugin_val = user_to_plugin (user_val); - for (Plugins::iterator i = _plugin->_plugins.begin(); i != _plugin->_plugins.end(); ++i) { - (*i)->set_parameter (_list->parameter().id(), plugin_val); + (*i)->set_parameter (_list->parameter().id(), user_val); } boost::shared_ptr<Plugin> iasp = _plugin->_impulseAnalysisPlugin.lock(); if (iasp) { - iasp->set_parameter (_list->parameter().id(), plugin_val); + iasp->set_parameter (_list->parameter().id(), user_val); } AutomationControl::set_value (user_val); } double -PluginInsert::PluginControl::user_to_plugin (double val) const -{ - /* no known transformations at this time */ - return val; -} - -double PluginInsert::PluginControl::user_to_ui (double val) const { if (_logarithmic) { @@ -1206,20 +1197,6 @@ PluginInsert::PluginControl::ui_to_user (double val) const return val; } -/** Convert plugin values to UI values. See pbd/controllable.h */ -double -PluginInsert::PluginControl::plugin_to_ui (double val) const -{ - return user_to_ui (plugin_to_user (val)); -} - -double -PluginInsert::PluginControl::plugin_to_user (double val) const -{ - /* no known transformations at this time */ - return val; -} - XMLNode& PluginInsert::PluginControl::get_state () { @@ -1237,8 +1214,7 @@ double PluginInsert::PluginControl::get_value () const { /* FIXME: probably should be taking out some lock here.. */ - - return plugin_to_user (_plugin->get_parameter (_list->parameter())); + return _plugin->get_parameter (_list->parameter()); } boost::shared_ptr<Plugin> diff --git a/libs/pbd/pbd/controllable.h b/libs/pbd/pbd/controllable.h index 9c059e9401..f61a375ba7 100644 --- a/libs/pbd/pbd/controllable.h +++ b/libs/pbd/pbd/controllable.h @@ -43,13 +43,12 @@ class Controllable : public PBD::StatefulDestructible { Controllable (const std::string& name, Flag f = Flag (0)); virtual ~Controllable() { Destroyed (this); } - /* We express Controllable values in one of three ways: - * 1. `user' --- as presented to the user (e.g. dB, Hz etc.) - * 2. `UI' --- as used in some cases for the internal representation + /* We express Controllable values in one of two ways: + * 1. `UI' --- as used in some cases for the internal representation * of the UI. This may be the same as `user', or may be something * like the natural log of frequency in order that sliders operate * in a logarithmic fashion. - * 3. `plugin' --- as passed to a plugin. + * 2. `user' --- as passed to a plugin, and presented to the user. */ /** Set `user' value */ @@ -57,6 +56,14 @@ class Controllable : public PBD::StatefulDestructible { /** @return `user' value */ virtual double get_value (void) const = 0; + virtual double user_to_ui (double v) const { + return v; + } + + virtual double ui_to_user (double v) const { + return v; + } + PBD::Signal0<void> LearningFinished; static PBD::Signal3<void,PBD::Controllable*,int,int> CreateBinding; static PBD::Signal1<void,PBD::Controllable*> DeleteBinding; |