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
This commit is contained in:
Paul Davis
2012-01-18 18:37:26 +00:00
parent 9524b08752
commit 759f1216af
2 changed files with 26 additions and 5 deletions

View File

@@ -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;
}

View File

@@ -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<Pannable> p, boost::shared_ptr<MuteMas
: Delivery (s, p, mm, name_and_id_new_send (s, r, _bitslot), r)
, _metering (false)
{
if (_role == Listen) {
/* we don't need to do this but it keeps things looking clean
in a debugger. _bitslot is not used by listen sends.
*/
_bitslot = 0;
}
boost_debug_shared_ptr_mark_interesting (this, "send");
_amp.reset (new Amp (_session));
@@ -152,7 +168,10 @@ Send::state (bool full)
node.add_property ("type", "send");
snprintf (buf, sizeof (buf), "%" PRIu32, _bitslot);
node.add_property ("bitslot", buf);
if (_role != Listen) {
node.add_property ("bitslot", buf);
}
node.add_child_nocopy (_amp->state (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;
}
}