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);
: 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));
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));
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
*/
} 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) {
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;
}
}