From 28afaebdc4e25602dfc2d9dc73be9029fe445884 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 24 May 2016 11:54:44 -0400 Subject: [PATCH] fix SNAFU in which Stripable::rec_enable_control() was incorrectly defined as ::recenable_control() Make Mackie support code use the Stripable to access the rec-enable control while we're here --- libs/ardour/ardour/stripable.h | 2 +- libs/ardour/ardour/vca.h | 2 +- libs/ardour/session_state.cc | 2 +- libs/surfaces/mackie/mackie_control_protocol.cc | 2 +- libs/surfaces/mackie/strip.cc | 8 ++++---- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libs/ardour/ardour/stripable.h b/libs/ardour/ardour/stripable.h index cebe91a576..0ebd1f55ad 100644 --- a/libs/ardour/ardour/stripable.h +++ b/libs/ardour/ardour/stripable.h @@ -104,7 +104,7 @@ class LIBARDOUR_API Stripable : public SessionObject { virtual boost::shared_ptr trim_control() const = 0; virtual boost::shared_ptr monitoring_control() const = 0; - virtual boost::shared_ptr recenable_control() const { return boost::shared_ptr(); } + virtual boost::shared_ptr rec_enable_control() const { return boost::shared_ptr(); } /* "well-known" controls for panning. Any or all of these may return * null. diff --git a/libs/ardour/ardour/vca.h b/libs/ardour/ardour/vca.h index 65de6fb9ef..1583e453fc 100644 --- a/libs/ardour/ardour/vca.h +++ b/libs/ardour/ardour/vca.h @@ -104,7 +104,7 @@ class LIBARDOUR_API VCA : public Stripable, virtual boost::shared_ptr gain_control() const { return _gain_control; } virtual boost::shared_ptr solo_control() const { return _solo_control; } virtual boost::shared_ptr mute_control() const { return _mute_control; } - virtual boost::shared_ptr recenable_control() const { return _recenable_control; } + virtual boost::shared_ptr rec_enable_control() const { return _recenable_control; } virtual boost::shared_ptr monitoring_control() const { return _monitor_control; } /* null Stripable API, because VCAs don't have any of this */ diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 55258a3ead..54cb87b82f 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -3464,7 +3464,7 @@ Session::controllable_by_descriptor (const ControllableDescriptor& desc) break; case ControllableDescriptor::Recenable: - c = s->recenable_control (); + c = s->rec_enable_control (); break; case ControllableDescriptor::PanDirection: diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc index 4ff195d40c..f7c76e89db 100644 --- a/libs/surfaces/mackie/mackie_control_protocol.cc +++ b/libs/surfaces/mackie/mackie_control_protocol.cc @@ -2197,7 +2197,7 @@ MackieControlProtocol::down_controls (AutomationType p) break; case RecEnableAutomation: for (StripableList::iterator s = stripables.begin(); s != stripables.end(); ++s) { - boost::shared_ptr ac = (*s)->recenable_control(); + boost::shared_ptr ac = (*s)->rec_enable_control(); if (ac) { controls.push_back (ac); } diff --git a/libs/surfaces/mackie/strip.cc b/libs/surfaces/mackie/strip.cc index 4fdebb38d7..d60f4955b9 100644 --- a/libs/surfaces/mackie/strip.cc +++ b/libs/surfaces/mackie/strip.cc @@ -215,11 +215,11 @@ Strip::set_stripable (boost::shared_ptr r, bool /*with_messages*/) _stripable->gain_control()->Changed.connect(stripable_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_gain_changed, this, false), ui_context()); _stripable->PropertyChanged.connect (stripable_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_property_changed, this, _1), ui_context()); - boost::shared_ptr trk = boost::dynamic_pointer_cast(_stripable); + boost::shared_ptr rec_enable_control = _stripable->rec_enable_control (); - if (trk) { - _recenable->set_control (trk->rec_enable_control()); - trk->rec_enable_control()->Changed .connect(stripable_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_record_enable_changed, this), ui_context()); + if (rec_enable_control) { + _recenable->set_control (rec_enable_control); + rec_enable_control->Changed.connect (stripable_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_record_enable_changed, this), ui_context()); } // TODO this works when a currently-banked stripable is made inactive, but not