13
0

follow to 103dd00357441, continuing to refine/fix signal flow for livetrax

This commit is contained in:
Paul Davis 2024-05-15 16:11:22 -06:00
parent 70a86561e7
commit 6a081375ca
5 changed files with 70 additions and 15 deletions

View File

@ -1037,14 +1037,17 @@ public:
uint32_t next_send_id();
uint32_t next_surround_send_id();
uint32_t next_aux_send_id();
uint32_t next_direct_out_id();
uint32_t next_return_id();
uint32_t next_insert_id();
void mark_send_id (uint32_t);
void mark_direct_out_id (uint32_t);
void mark_surround_send_id (uint32_t);
void mark_aux_send_id (uint32_t);
void mark_return_id (uint32_t);
void mark_insert_id (uint32_t);
void unmark_send_id (uint32_t);
void unmark_direct_out_id (uint32_t);
void unmark_surround_send_id (uint32_t);
void unmark_aux_send_id (uint32_t);
void unmark_return_id (uint32_t);
@ -2113,6 +2116,7 @@ private:
boost::dynamic_bitset<uint32_t> send_bitset;
boost::dynamic_bitset<uint32_t> surround_send_bitset;
boost::dynamic_bitset<uint32_t> aux_send_bitset;
boost::dynamic_bitset<uint32_t> direct_out_bitset;
boost::dynamic_bitset<uint32_t> return_bitset;
boost::dynamic_bitset<uint32_t> insert_bitset;

View File

@ -41,7 +41,7 @@ const string MuteMaster::xml_node_name (X_("MuteMaster"));
const MuteMaster::MutePoint MuteMaster::AllPoints = MuteMaster::MutePoint(
PreFader|PostFader|Listen|Main|SurroundSend);
MuteMaster::MuteMaster (Session& s, Muteable& m, const std::string&)
MuteMaster::MuteMaster (Session& s, Muteable& m, const std::string& name)
: SessionHandleRef (s)
, _muteable (&m)
, _mute_point (MutePoint (0))
@ -50,7 +50,6 @@ MuteMaster::MuteMaster (Session& s, Muteable& m, const std::string&)
, _soloed_by_others (false)
, _muted_by_masters (0)
{
if (Config->get_mute_affects_pre_fader ()) {
_mute_point = MutePoint (_mute_point | PreFader);
}
@ -70,6 +69,10 @@ MuteMaster::MuteMaster (Session& s, Muteable& m, const std::string&)
if (Config->get_mute_affects_surround_sends ()) {
_mute_point = MutePoint (_mute_point | SurroundSend);
}
#ifdef LIVETRAX
_mute_point = MutePoint (_mute_point | PreFader);
#endif
}
void
@ -150,6 +153,10 @@ MuteMaster::set_state (const XMLNode& node, int version)
{
node.get_property ("mute-point", _mute_point);
#ifdef LIVETRAX
_mute_point = MutePoint (_mute_point | PreFader);
#endif
if (!node.get_property ("muted", _muted_by_self)) {
_muted_by_self = (_mute_point != MutePoint (0));
}

View File

@ -3324,16 +3324,7 @@ Route::set_processor_state (XMLNode const& node, int version, XMLProperty const*
if (prop->value() == "intsend") {
XMLProperty const * role_prop = node.property (X_("role"));
if (role_prop && role_prop->value() == "DirectOuts") {
if (Profile->get_livetrax()) {
create_direct_outs ();
assert (_direct_outs);
processor = _direct_outs;
}
} else {
processor.reset (new InternalSend (_session, _pannable, _mute_master, std::dynamic_pointer_cast<ARDOUR::Route>(shared_from_this()), std::shared_ptr<Route>(), Delivery::Aux, true));
}
} else if (prop->value() == "ladspa" || prop->value() == "Ladspa" ||
prop->value() == "lv2" ||
@ -3357,7 +3348,13 @@ Route::set_processor_state (XMLNode const& node, int version, XMLProperty const*
} else if (prop->value() == "send") {
XMLProperty const * role_prop = node.property (X_("role"));
if (role_prop && role_prop->value() == "DirectOuts") {
_direct_outs.reset (new Send (_session, _pannable, _mute_master, Delivery::DirectOuts, true));
processor = _direct_outs;
} else {
processor.reset (new Send (_session, _pannable, _mute_master, Delivery::Send, true));
}
std::shared_ptr<Send> send = std::dynamic_pointer_cast<Send> (processor);
send->SelfDestruct.connect_same_thread (*send, boost::bind (&Route::processor_selfdestruct, this, std::weak_ptr<Processor> (processor)));
if (send->output()) {

View File

@ -89,7 +89,7 @@ Send::name_and_id_new_send (Session& s, Role r, uint32_t& bitslot, bool ignore_b
case Delivery::Foldback:
return string_compose (_("foldback %1"), (bitslot = s.next_aux_send_id ()));
case Delivery::DirectOuts:
return string_compose (_("directs %1"), (bitslot = s.next_aux_send_id ()));
return string_compose (_("directs %1"), (bitslot = s.next_direct_out_id ()));
default:
fatal << string_compose (_("programming error: send created using role %1"), enum_2_string (r)) << endmsg;
abort(); /*NOTREACHED*/
@ -414,6 +414,10 @@ Send::set_state (const XMLNode& node, int version)
_session.unmark_send_id (_bitslot);
_bitslot = string_to<uint32_t>(prop->value());
_session.mark_send_id (_bitslot);
} else if (_role == Delivery::DirectOuts) {
_session.unmark_direct_out_id (_bitslot);
_bitslot = string_to<uint32_t>(prop->value());
_session.mark_direct_out_id (_bitslot);
} else {
// bitslot doesn't matter but make it zero anyway
_bitslot = 0;
@ -559,7 +563,7 @@ Send::set_name (const string& new_name)
bool
Send::display_to_user () const
{
if (_role == Delivery::DirectOuts && Profile->get_livetrax()) {
if (_role == DirectOuts) {
return false;
}

View File

@ -6024,6 +6024,26 @@ Session::next_aux_send_id ()
}
}
uint32_t
Session::next_direct_out_id ()
{
/* this doesn't really loop forever. just think about it */
while (true) {
for (boost::dynamic_bitset<uint32_t>::size_type n = 1; n < direct_out_bitset.size(); ++n) {
if (!direct_out_bitset[n]) {
direct_out_bitset[n] = true;
return n;
}
}
/* none available, so resize and try again */
direct_out_bitset.resize (direct_out_bitset.size() + 16, false);
}
}
uint32_t
Session::next_return_id ()
{
@ -6068,6 +6088,18 @@ Session::mark_aux_send_id (uint32_t id)
aux_send_bitset[id] = true;
}
void
Session::mark_direct_out_id (uint32_t id)
{
if (id >= direct_out_bitset.size()) {
direct_out_bitset.resize (id+16, false);
}
if (direct_out_bitset[id]) {
warning << string_compose (_("direct out ID %1 appears to be in use already"), id) << endmsg;
}
direct_out_bitset[id] = true;
}
void
Session::mark_surround_send_id (uint32_t id)
{
@ -6115,6 +6147,17 @@ Session::unmark_send_id (uint32_t id)
}
}
void
Session::unmark_direct_out_id (uint32_t id)
{
if (deletion_in_progress ()) {
return;
}
if (id < direct_out_bitset.size()) {
direct_out_bitset[id] = false;
}
}
void
Session::unmark_aux_send_id (uint32_t id)
{