From 06cc5e5240cc2bfeb4e22c742a5705566bd11dbe Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 22 Jan 2014 13:06:58 +0100 Subject: [PATCH] fix bitslot already in use warning in e45151b89c64 route.cc was changed to create internal sends directly with role = Delivery::Aux; and not Delivery::Role (0). This change was motivated to initialize the panner for Aux-sends in the Delivery. Role(0) was used to override bitslot numbering during initial construction of the object when the state is loaded from XML after construction. This patch adds an explicit flag for that. (The previous Role(0) approach only worked for Aux-Sends but not Sends, anyway.) --- libs/ardour/ardour/internal_send.h | 2 +- libs/ardour/ardour/send.h | 4 ++-- libs/ardour/internal_send.cc | 4 ++-- libs/ardour/route.cc | 4 ++-- libs/ardour/send.cc | 8 ++++---- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/libs/ardour/ardour/internal_send.h b/libs/ardour/ardour/internal_send.h index 09b26d57d5..ea3d645754 100644 --- a/libs/ardour/ardour/internal_send.h +++ b/libs/ardour/ardour/internal_send.h @@ -28,7 +28,7 @@ namespace ARDOUR { class InternalSend : public Send { public: - InternalSend (Session&, boost::shared_ptr, boost::shared_ptr, boost::shared_ptr send_to, Delivery::Role role); + InternalSend (Session&, boost::shared_ptr, boost::shared_ptr, boost::shared_ptr send_to, Delivery::Role role = Delivery::Aux, bool ignore_bitslot = false); virtual ~InternalSend (); std::string display_name() const; diff --git a/libs/ardour/ardour/send.h b/libs/ardour/ardour/send.h index 118110f05a..6e2775286d 100644 --- a/libs/ardour/ardour/send.h +++ b/libs/ardour/ardour/send.h @@ -35,7 +35,7 @@ class Amp; class Send : public Delivery { public: - Send (Session&, boost::shared_ptr pannable, boost::shared_ptr, Delivery::Role r = Delivery::Send); + Send (Session&, boost::shared_ptr pannable, boost::shared_ptr, Delivery::Role r = Delivery::Send, bool ignore_bitslot = false); virtual ~Send (); uint32_t bit_slot() const { return _bitslot; } @@ -67,7 +67,7 @@ class Send : public Delivery std::string value_as_string (boost::shared_ptr) const; static uint32_t how_many_sends(); - static std::string name_and_id_new_send (Session&, Delivery::Role r, uint32_t&); + static std::string name_and_id_new_send (Session&, Delivery::Role r, uint32_t&, bool); protected: bool _metering; diff --git a/libs/ardour/internal_send.cc b/libs/ardour/internal_send.cc index dac1839a5e..1d4e18d06e 100644 --- a/libs/ardour/internal_send.cc +++ b/libs/ardour/internal_send.cc @@ -40,8 +40,8 @@ using namespace std; PBD::Signal1 InternalSend::CycleStart; -InternalSend::InternalSend (Session& s, boost::shared_ptr p, boost::shared_ptr mm, boost::shared_ptr sendto, Delivery::Role role) - : Send (s, p, mm, role) +InternalSend::InternalSend (Session& s, boost::shared_ptr p, boost::shared_ptr mm, boost::shared_ptr sendto, Delivery::Role role, bool ignore_bitslot) + : Send (s, p, mm, role, ignore_bitslot) { if (sendto) { if (use_target (sendto)) { diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index a9122ab673..9e649362ee 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -2496,7 +2496,7 @@ Route::set_processor_state (const XMLNode& node) if (prop->value() == "intsend") { - processor.reset (new InternalSend (_session, _pannable, _mute_master, boost::shared_ptr(), Delivery::Aux)); + processor.reset (new InternalSend (_session, _pannable, _mute_master, boost::shared_ptr(), Delivery::Aux, true)); } else if (prop->value() == "ladspa" || prop->value() == "Ladspa" || prop->value() == "lv2" || @@ -2512,7 +2512,7 @@ Route::set_processor_state (const XMLNode& node) } else if (prop->value() == "send") { - processor.reset (new Send (_session, _pannable, _mute_master)); + processor.reset (new Send (_session, _pannable, _mute_master, Delivery::Send, true)); } else { error << string_compose(_("unknown Processor type \"%1\"; ignored"), prop->value()) << endmsg; diff --git a/libs/ardour/send.cc b/libs/ardour/send.cc index 1664f42b35..71cab46879 100644 --- a/libs/ardour/send.cc +++ b/libs/ardour/send.cc @@ -44,9 +44,9 @@ using namespace PBD; using namespace std; string -Send::name_and_id_new_send (Session& s, Role r, uint32_t& bitslot) +Send::name_and_id_new_send (Session& s, Role r, uint32_t& bitslot, bool ignore_bitslot) { - if (r == Role (0)) { + if (ignore_bitslot) { /* this happens during initial construction of sends from XML, before they get ::set_state() called. lets not worry about it. @@ -70,8 +70,8 @@ Send::name_and_id_new_send (Session& s, Role r, uint32_t& bitslot) } -Send::Send (Session& s, boost::shared_ptr p, boost::shared_ptr mm, Role r) - : Delivery (s, p, mm, name_and_id_new_send (s, r, _bitslot), r) +Send::Send (Session& s, boost::shared_ptr p, boost::shared_ptr mm, Role r, bool ignore_bitslot) + : Delivery (s, p, mm, name_and_id_new_send (s, r, _bitslot, ignore_bitslot), r) , _metering (false) { if (_role == Listen) {