summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-04-04 13:19:09 +0000
committerCarl Hetherington <carl@carlh.net>2011-04-04 13:19:09 +0000
commit071d1185f62ef003c3f3cf7bf29651ddad396147 (patch)
tree58010a12282b4f066fd0a416781addc2b2bd3cc6
parent3d21df3a159c45d97b9107d433c4b16b37ca172a (diff)
Slightly grubby fix to restore plugin output meters (#3926).
git-svn-id: svn://localhost/ardour2/branches/3.0@9278 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--gtk2_ardour/generic_pluginui.cc15
-rw-r--r--gtk2_ardour/plugin_ui.h1
2 files changed, 9 insertions, 7 deletions
diff --git a/gtk2_ardour/generic_pluginui.cc b/gtk2_ardour/generic_pluginui.cc
index fdf0d62482..d1eddcfa68 100644
--- a/gtk2_ardour/generic_pluginui.cc
+++ b/gtk2_ardour/generic_pluginui.cc
@@ -145,7 +145,6 @@ GenericPluginUI::~GenericPluginUI ()
void
GenericPluginUI::build ()
-
{
guint32 i = 0;
guint32 x = 0;
@@ -386,9 +385,6 @@ GenericPluginUI::ControlUI*
GenericPluginUI::build_control_ui (guint32 port_index, boost::shared_ptr<AutomationControl> mcontrol)
{
ControlUI* control_ui = 0;
- if (!mcontrol) {
- return control_ui;
- }
Plugin::ParameterDescriptor desc;
@@ -402,6 +398,7 @@ GenericPluginUI::build_control_ui (guint32 port_index, boost::shared_ptr<Automat
control_ui->label.set_text (desc.label);
control_ui->label.set_alignment (0.0, 0.5);
control_ui->label.set_name ("PluginParameterLabel");
+ control_ui->port_index = port_index;
control_ui->set_spacing (5);
@@ -487,7 +484,9 @@ GenericPluginUI::build_control_ui (guint32 port_index, boost::shared_ptr<Automat
/* create the controller */
- control_ui->controller = AutomationController::create(insert, mcontrol->parameter(), mcontrol);
+ if (mcontrol) {
+ control_ui->controller = AutomationController::create(insert, mcontrol->parameter(), mcontrol);
+ }
/* XXX this code is not right yet, because it doesn't handle
the absence of bounds in any sensible fashion.
@@ -591,7 +590,9 @@ GenericPluginUI::build_control_ui (guint32 port_index, boost::shared_ptr<Automat
output_controls.push_back (control_ui);
}
- mcontrol->Changed.connect (control_connections, invalidator (*this), boost::bind (&GenericPluginUI::ui_parameter_changed, this, control_ui), gui_context());
+ if (mcontrol) {
+ mcontrol->Changed.connect (control_connections, invalidator (*this), boost::bind (&GenericPluginUI::ui_parameter_changed, this, control_ui), gui_context());
+ }
return control_ui;
}
@@ -763,7 +764,7 @@ void
GenericPluginUI::output_update ()
{
for (vector<ControlUI*>::iterator i = output_controls.begin(); i != output_controls.end(); ++i) {
- float val = plugin->get_parameter ((*i)->parameter().id());
+ float val = plugin->get_parameter ((*i)->port_index);
char buf[32];
snprintf (buf, sizeof(buf), "%.2f", val);
(*i)->display_label->set_text (buf);
diff --git a/gtk2_ardour/plugin_ui.h b/gtk2_ardour/plugin_ui.h
index 31a00ad9b3..3d0a121e09 100644
--- a/gtk2_ardour/plugin_ui.h
+++ b/gtk2_ardour/plugin_ui.h
@@ -201,6 +201,7 @@ class GenericPluginUI : public PlugUIBase, public Gtk::VBox
/* FIXME: Unify with AutomationController */
struct ControlUI : public Gtk::HBox {
+ uint32_t port_index;
boost::shared_ptr<ARDOUR::AutomationControl> control;
Evoral::Parameter parameter() { return control->parameter(); }