diff options
-rw-r--r-- | gtk2_ardour/generic_pluginui.cc | 2 | ||||
-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 |
4 files changed, 15 insertions, 36 deletions
diff --git a/gtk2_ardour/generic_pluginui.cc b/gtk2_ardour/generic_pluginui.cc index fc76cd57ef..671cc988ac 100644 --- a/gtk2_ardour/generic_pluginui.cc +++ b/gtk2_ardour/generic_pluginui.cc @@ -594,7 +594,7 @@ GenericPluginUI::build_control_ui (guint32 port_index, boost::shared_ptr<Automat } - adj->set_value (pc->plugin_to_ui (plugin->get_parameter (port_index))); + adj->set_value (pc->user_to_ui (plugin->get_parameter (port_index))); /* XXX memory leak: SliderController not destroyed by ControlUI destructor, and manage() reports object hierarchy 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; |