From 22cfe21abde9a55d36551147a05e30574f5e1fa5 Mon Sep 17 00:00:00 2001 From: Sampo Savolainen Date: Tue, 22 May 2007 19:26:37 +0000 Subject: [PATCH] Stop sends and inserts from re-registering their own ID when set_state() is called git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@1910 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/insert.cc | 7 ++++++- libs/ardour/send.cc | 8 +++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/libs/ardour/insert.cc b/libs/ardour/insert.cc index ccc73946b5..f8650c7ee1 100644 --- a/libs/ardour/insert.cc +++ b/libs/ardour/insert.cc @@ -860,6 +860,7 @@ PortInsert::init () PortInsert::PortInsert (Session& s, const XMLNode& node) : Insert (s, "will change", PreFader) { + bitslot = 0xffffffff; if (set_state (node)) { throw failed_constructor(); } @@ -943,8 +944,12 @@ PortInsert::set_state(const XMLNode& node) if ((prop = node.property ("bitslot")) == 0) { bitslot = _session.next_insert_id(); } else { + uint32_t old_bitslot = bitslot; sscanf (prop->value().c_str(), "%" PRIu32, &bitslot); - _session.mark_insert_id (bitslot); + + if (old_bitslot != bitslot) { + _session.mark_insert_id (bitslot); + } } for (niter = nlist.begin(); niter != nlist.end(); ++niter) { diff --git a/libs/ardour/send.cc b/libs/ardour/send.cc index faafa3295e..614195ac2d 100644 --- a/libs/ardour/send.cc +++ b/libs/ardour/send.cc @@ -44,6 +44,8 @@ Send::Send (Session& s, const XMLNode& node) _metering = false; expected_inputs = 0; + bitslot = 0xffffffff; + if (set_state (node)) { throw failed_constructor(); } @@ -92,8 +94,12 @@ Send::set_state(const XMLNode& node) if ((prop = node.property ("bitslot")) == 0) { bitslot = _session.next_send_id(); } else { + uint32_t old_bitslot = bitslot; sscanf (prop->value().c_str(), "%" PRIu32, &bitslot); - _session.mark_send_id (bitslot); + + if (bitslot != old_bitslot) { + _session.mark_send_id (bitslot); + } } /* Send has regular IO automation (gain, pan) */