diff --git a/gtk2_ardour/generic_pluginui.cc b/gtk2_ardour/generic_pluginui.cc index c77f7e7d74..07573c1454 100644 --- a/gtk2_ardour/generic_pluginui.cc +++ b/gtk2_ardour/generic_pluginui.cc @@ -218,7 +218,7 @@ GenericPluginUI::build () continue; } - if (cui->control || cui->clickbox || cui->combo) { + if (cui->controller || cui->clickbox || cui->combo) { box->pack_start (*cui, false, false); @@ -461,9 +461,8 @@ GenericPluginUI::build_control_ui (guint32 port_index, boost::shared_ptrcontroller = AutomationController::create(insert, mcontrol->parameter(), 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. */ @@ -664,7 +663,9 @@ GenericPluginUI::update_control_display (ControlUI* cui) } } - cui->controller->display_effective_value(); + if( cui->controller ) { + cui->controller->display_effective_value(); + } /*} else { diff --git a/libs/ardour/ardour/plugin_insert.h b/libs/ardour/ardour/plugin_insert.h index 859c707c79..28c7718971 100644 --- a/libs/ardour/ardour/plugin_insert.h +++ b/libs/ardour/ardour/plugin_insert.h @@ -81,14 +81,14 @@ class PluginInsert : public Processor struct PluginControl : public AutomationControl { - PluginControl (PluginInsert& p, boost::shared_ptr list); + PluginControl (PluginInsert* p, const Parameter ¶m, + boost::shared_ptr list = boost::shared_ptr()); void set_value (float val); float get_value (void) const; private: - PluginInsert& _plugin; - boost::shared_ptr _list; + PluginInsert* _plugin; bool _logarithmic; bool _toggled; }; diff --git a/libs/ardour/automatable.cc b/libs/ardour/automatable.cc index ea14fa648b..c9f774d441 100644 --- a/libs/ardour/automatable.cc +++ b/libs/ardour/automatable.cc @@ -28,6 +28,7 @@ #include #include #include +#include #include "i18n.h" @@ -394,6 +395,8 @@ Automatable::control_factory(const Evoral::Parameter& param) Evoral::Control* control = NULL; if (param.type() >= MidiCCAutomation && param.type() <= MidiChannelPressureAutomation) { control = new MidiTrack::MidiControl((MidiTrack*)this, param); + } else if (param.type() == PluginAutomation) { + control = new PluginInsert::PluginControl((PluginInsert*)this, param); } else { control = new AutomationControl(_a_session, param); } diff --git a/libs/ardour/automation_list.cc b/libs/ardour/automation_list.cc index b9aeabb4b5..c8a5ba7a39 100644 --- a/libs/ardour/automation_list.cc +++ b/libs/ardour/automation_list.cc @@ -388,7 +388,7 @@ AutomationList::set_state (const XMLNode& node) } if ((prop = node.property (X_("automation-id"))) != 0){ - _parameter = Parameter(prop->value()); + _parameter = Evoral::Parameter(prop->value()); } else { warning << "Legacy session: automation list has no automation-id property."; } diff --git a/libs/ardour/meter.cc b/libs/ardour/meter.cc index 8ad5e391a2..5b3b2e5f9e 100644 --- a/libs/ardour/meter.cc +++ b/libs/ardour/meter.cc @@ -37,7 +37,7 @@ PeakMeter::run_in_place (BufferSet& bufs, nframes_t start_frame, nframes_t end_f { uint32_t n = 0; uint32_t meterable = std::min(bufs.count().n_total(), (uint32_t)_peak_power.size()); - uint32_t limit = std::min (meterable, bufs.count().n_midi()); + uint32_t limit = std::min (meterable, (uint32_t)bufs.count().n_midi()); // Meter what we have (midi) for ( ; n < limit; ++n) { diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc index e9956836b5..bd1323b0f1 100644 --- a/libs/ardour/plugin_insert.cc +++ b/libs/ardour/plugin_insert.cc @@ -80,7 +80,7 @@ PluginInsert::PluginInsert (Session& s, const XMLNode& node) throw failed_constructor(); } - // set_automatable (); + set_automatable (); { Glib::Mutex::Lock em (_session.engine().process_lock()); @@ -229,7 +229,7 @@ PluginInsert::set_automatable () Parameter param(*i); param.set_range(desc.lower, desc.upper, _plugins.front()->default_value(i->id())); boost::shared_ptr list(new AutomationList(param)); - add_control(boost::shared_ptr(new PluginControl(*this, list))); + add_control(boost::shared_ptr(new PluginControl(this, *i, list))); } } } @@ -852,13 +852,12 @@ PluginInsert::type () } } -PluginInsert::PluginControl::PluginControl (PluginInsert& p, boost::shared_ptr list) - : AutomationControl (p.session(), list->parameter(), list, p.describe_parameter(list->parameter())) +PluginInsert::PluginControl::PluginControl (PluginInsert* p, const Parameter ¶m, boost::shared_ptr list) + : AutomationControl (p->session(), param, list, p->describe_parameter(param)) , _plugin (p) - , _list (list) { Plugin::ParameterDescriptor desc; - p.plugin(0)->get_parameter_descriptor (list->parameter().id(), desc); + p->plugin(0)->get_parameter_descriptor (param.id(), desc); _logarithmic = desc.logarithmic; _toggled = desc.toggled; } @@ -892,8 +891,8 @@ PluginInsert::PluginControl::set_value (float val) } - for (vector >::iterator i = _plugin._plugins.begin(); - i != _plugin._plugins.end(); ++i) { + for (vector >::iterator i = _plugin->_plugins.begin(); + i != _plugin->_plugins.end(); ++i) { (*i)->set_parameter (_list->parameter().id(), val); } @@ -905,7 +904,7 @@ PluginInsert::PluginControl::get_value (void) const { /* FIXME: probably should be taking out some lock here.. */ - float val = _plugin.get_parameter (_list->parameter()); + float val = _plugin->get_parameter (_list->parameter()); return val;