- if ((prop = node.property ("bitslot")) == 0) {
- _bitslot = _session.next_send_id();
- } else {
- sscanf (prop->value().c_str(), "%" PRIu32, &_bitslot);
- _session.mark_send_id (_bitslot);
+ Delivery::set_state (node, version);
+
+ if (node.property ("ignore-bitslot") == 0) {
+
+ /* 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
+ */
+
+ if ((prop = node.property ("bitslot")) == 0) {
+ if (_role == Delivery::Aux) {
+ _bitslot = _session.next_aux_send_id ();
+ } else if (_role == Delivery::Send) {
+ _bitslot = _session.next_send_id ();
+ } else {
+ // bitslot doesn't matter but make it zero anyway
+ _bitslot = 0;
+ }
+ } else {
+ if (_role == Delivery::Aux) {
+ _session.unmark_aux_send_id (_bitslot);
+ sscanf (prop->value().c_str(), "%" PRIu32, &_bitslot);
+ _session.mark_aux_send_id (_bitslot);
+ } else if (_role == Delivery::Send) {
+ _session.unmark_send_id (_bitslot);
+ sscanf (prop->value().c_str(), "%" PRIu32, &_bitslot);
+ _session.mark_send_id (_bitslot);
+ } else {
+ // bitslot doesn't matter but make it zero anyway
+ _bitslot = 0;
+ }
+ }
+ }
+
+ XMLNodeList nlist = node.children();
+ for (XMLNodeIterator i = nlist.begin(); i != nlist.end(); ++i) {
+ if ((*i)->name() == X_("Processor")) {
+ _amp->set_state (**i, version);
+ }