13
0

Fix plugin parameter controllers again (#3767).

git-svn-id: svn://localhost/ardour2/branches/3.0@8912 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2011-02-20 17:57:45 +00:00
parent 6898dd04a6
commit 279c9d8b4c
2 changed files with 11 additions and 18 deletions

View File

@ -88,6 +88,7 @@ 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;

View File

@ -1091,12 +1091,18 @@ PluginInsert::PluginControl::ui_to_user (double val) const
/** 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
{
if (_sr_dependent) {
val = val * _session.frame_rate ();
}
return user_to_ui (val);
return val;
}
XMLNode&
@ -1111,27 +1117,13 @@ PluginInsert::PluginControl::get_state ()
return node;
}
/** @return `user' val */
double
PluginInsert::PluginControl::get_value (void) const
PluginInsert::PluginControl::get_value () const
{
/* FIXME: probably should be taking out some lock here.. */
double val = _plugin->get_parameter (_list->parameter());
return val;
/*if (_toggled) {
return val;
} else {
if (_logarithmic) {
val = log(val);
}
return ((val - lower) / range);
}*/
return plugin_to_user (_plugin->get_parameter (_list->parameter()));
}
boost::shared_ptr<Plugin>