Fix off-by-one, start "Send" names at bitslot 1 (not 2)

Session::next_*_send_id() starts counting at bit 1.
Probably for historical reasons (bit zero = 1).
This commit is contained in:
Robin Gareus
2020-02-29 01:46:01 +01:00
parent 2b13cfa67c
commit 814af0f51c

View File

@@ -72,13 +72,14 @@ Send::name_and_id_new_send (Session& s, Role r, uint32_t& bitslot, bool ignore_b
switch (r) {
case Delivery::Aux:
return string_compose (_("aux %1"), (bitslot = s.next_aux_send_id ()) + 1);
return string_compose (_("aux %1"), (bitslot = s.next_aux_send_id ()));
case Delivery::Listen:
bitslot = 0; /* unused */
return _("listen"); // no ports, no need for numbering
case Delivery::Send:
return string_compose (_("send %1"), (bitslot = s.next_send_id ()) + 1);
return string_compose (_("send %1"), (bitslot = s.next_send_id ()));
case Delivery::Foldback:
return string_compose (_("foldback %1"), (bitslot = s.next_aux_send_id ()) + 1);
return string_compose (_("foldback %1"), (bitslot = s.next_aux_send_id ()));
default:
fatal << string_compose (_("programming error: send created using role %1"), enum_2_string (r)) << endmsg;
abort(); /*NOTREACHED*/
@@ -92,13 +93,6 @@ Send::Send (Session& s, boost::shared_ptr<Pannable> p, boost::shared_ptr<MuteMas
, _metering (false)
, _remove_on_disconnect (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");
boost::shared_ptr<AutomationList> gl (new AutomationList (Evoral::Parameter (BusSendLevel)));