From 759f1216afa4487441106d3b2c17e47651f57d11 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 18 Jan 2012 18:37:26 +0000 Subject: fix reload of session with new send naming in place, drop "aux-" prefix from name of aux sends git-svn-id: svn://localhost/ardour2/branches/3.0@11264 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/internal_send.cc | 2 +- libs/ardour/send.cc | 29 +++++++++++++++++++++++++---- 2 files changed, 26 insertions(+), 5 deletions(-) (limited to 'libs/ardour') diff --git a/libs/ardour/internal_send.cc b/libs/ardour/internal_send.cc index cb9043fcee..27e219dd22 100644 --- a/libs/ardour/internal_send.cc +++ b/libs/ardour/internal_send.cc @@ -325,7 +325,7 @@ string InternalSend::display_name () const { if (_role == Aux) { - return string_compose (X_("aux-%1"), _name); + return string_compose (X_("%1"), _name); } else { return _name; } diff --git a/libs/ardour/send.cc b/libs/ardour/send.cc index fb364e38d6..bacb381fe5 100644 --- a/libs/ardour/send.cc +++ b/libs/ardour/send.cc @@ -42,6 +42,15 @@ using namespace std; string Send::name_and_id_new_send (Session& s, Role r, uint32_t& bitslot) { + if (r == Role (0)) { + /* this happens during initial construction of sends from XML, + before they get ::set_state() called. lets not worry about + it. + */ + bitslot = 0; + return string (); + } + switch (r) { case Delivery::Aux: return string_compose (_("aux %1"), (bitslot = s.next_aux_send_id ()) + 1); @@ -61,6 +70,13 @@ Send::Send (Session& s, boost::shared_ptr p, boost::shared_ptrstate (full)); @@ -170,7 +189,7 @@ Send::set_state (const XMLNode& node, int version) Delivery::set_state (node, version); - /* don't try to reset bitslot if its already set: this can cause + /* don't try to reset bitslot if there is a node for it already: this can cause issues with the session's accounting of send ID's */ @@ -180,7 +199,8 @@ Send::set_state (const XMLNode& node, int version) } else if (_role == Delivery::Send) { _bitslot = _session.next_send_id (); } else { - // bitslot doesn't matter + // bitslot doesn't matter but make it zero anyway + _bitslot = 0; } } else { if (_role == Delivery::Aux) { @@ -192,7 +212,8 @@ Send::set_state (const XMLNode& node, int version) sscanf (prop->value().c_str(), "%" PRIu32, &_bitslot); _session.mark_send_id (_bitslot); } else { - // bitslot doesn't matter + // bitslot doesn't matter but make it zero anyway + _bitslot = 0; } } -- cgit v1.2.3