summaryrefslogtreecommitdiff
path: root/libs/ardour/send.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2012-01-18 18:37:26 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2012-01-18 18:37:26 +0000
commit759f1216afa4487441106d3b2c17e47651f57d11 (patch)
treec1439c9f44117bd4e8536c0b7eeaa7fa69b8c4e5 /libs/ardour/send.cc
parent9524b08752f22684c472acd5b3184d5c786e7103 (diff)
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
Diffstat (limited to 'libs/ardour/send.cc')
-rw-r--r--libs/ardour/send.cc29
1 files changed, 25 insertions, 4 deletions
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<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;
}
}