From 98966a0d1c9ee501e9913ecce7abc739fe62dba8 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 29 Mar 2024 12:42:04 -0600 Subject: [PATCH] add some enums and rc vars related to master send/return design --- libs/ardour/ardour/delivery.h | 4 ++- libs/ardour/ardour/mute_master.h | 11 +++---- libs/ardour/ardour/rc_configuration_vars.h | 1 + libs/ardour/delivery.cc | 35 ++++++++++++---------- libs/ardour/enums.cc | 2 ++ libs/ardour/mute_master.cc | 6 +++- libs/ardour/route.cc | 2 +- 7 files changed, 37 insertions(+), 24 deletions(-) diff --git a/libs/ardour/ardour/delivery.h b/libs/ardour/ardour/delivery.h index 5a3429f4e8..0880876cfb 100644 --- a/libs/ardour/ardour/delivery.h +++ b/libs/ardour/ardour/delivery.h @@ -56,7 +56,9 @@ public: /* aux - internal send used to deliver to any bus, by user request */ Aux = 0x10, /* foldback - internal send used only to deliver to a personal monitor bus */ - Foldback = 0x20 + Foldback = 0x20, + /* master send - used only with LiveTrax, delivers to master bus */ + MasterSend = 0x40 }; static bool role_requires_output_ports (Role r) { return r == Main || r == Send || r == Insert; } diff --git a/libs/ardour/ardour/mute_master.h b/libs/ardour/ardour/mute_master.h index d8d55851bf..88c9c3e434 100644 --- a/libs/ardour/ardour/mute_master.h +++ b/libs/ardour/ardour/mute_master.h @@ -42,11 +42,12 @@ class LIBARDOUR_API MuteMaster : public SessionHandleRef, public PBD::Stateful public: /** deliveries to mute when the channel is "muted" */ enum MutePoint { - PreFader = 0x1, ///< mute all pre-fader sends - PostFader = 0x2, ///< mute all post-fader sends - Listen = 0x4, ///< mute listen out - Main = 0x8, ///< mute main out - SurroundSend = 0x10 ///< mute surround send (if any) + PreFader = 0x1, ///< mute all pre-fader sends + PostFader = 0x2, ///< mute all post-fader sends + Listen = 0x4, ///< mute listen out + Main = 0x8, ///< mute main out + SurroundSend = 0x10, ///< mute surround send (if any) + MasterSend = 0x20 ///< mute master send (LiveTrax only) }; static const MutePoint AllPoints; diff --git a/libs/ardour/ardour/rc_configuration_vars.h b/libs/ardour/ardour/rc_configuration_vars.h index d6f35e1807..1a585490b1 100644 --- a/libs/ardour/ardour/rc_configuration_vars.h +++ b/libs/ardour/ardour/rc_configuration_vars.h @@ -129,6 +129,7 @@ CONFIG_VARIABLE (bool, mute_affects_post_fader, "mute-affects-post-fader", true) CONFIG_VARIABLE (bool, mute_affects_control_outs, "mute-affects-control-outs", true) CONFIG_VARIABLE (bool, mute_affects_main_outs, "mute-affects-main-outs", true) CONFIG_VARIABLE (bool, mute_affects_surround_sends, "mute-affects-surround-sends", true) +CONFIG_VARIABLE (bool, mute_affects_master_sends, "mute-affects-master-sends", true) CONFIG_VARIABLE (MonitorModel, monitoring_model, "monitoring-model", ExternalMonitoring) CONFIG_VARIABLE (ListenPosition, listen_position, "listen-position", AfterFaderListen) CONFIG_VARIABLE (PFLPosition, pfl_position, "pfl-position", PFLFromAfterProcessors) diff --git a/libs/ardour/delivery.cc b/libs/ardour/delivery.cc index 46d80f0d85..041e8e70d7 100644 --- a/libs/ardour/delivery.cc +++ b/libs/ardour/delivery.cc @@ -589,22 +589,25 @@ Delivery::target_gain () MuteMaster::MutePoint mp = MuteMaster::Main; // stupid gcc uninit warning switch (_role) { - case Main: - mp = MuteMaster::Main; - break; - case Listen: - mp = MuteMaster::Listen; - break; - case Send: - case Insert: - case Aux: - case Foldback: - if (_pre_fader) { - mp = MuteMaster::PreFader; - } else { - mp = MuteMaster::PostFader; - } - break; + case Main: + mp = MuteMaster::Main; + break; + case Listen: + mp = MuteMaster::Listen; + break; + case MasterSend: + mp = MuteMaster::MasterSend; + break; + case Send: + case Insert: + case Aux: + case Foldback: + if (_pre_fader) { + mp = MuteMaster::PreFader; + } else { + mp = MuteMaster::PostFader; + } + break; } gain_t desired_gain = _mute_master->mute_gain_at (mp); diff --git a/libs/ardour/enums.cc b/libs/ardour/enums.cc index 2dae7613e4..84f872f8ce 100644 --- a/libs/ardour/enums.cc +++ b/libs/ardour/enums.cc @@ -732,6 +732,7 @@ setup_enum_writer () REGISTER_CLASS_ENUM (Delivery, Main); REGISTER_CLASS_ENUM (Delivery, Aux); REGISTER_CLASS_ENUM (Delivery, Foldback); + REGISTER_CLASS_ENUM (Delivery, MasterSend); REGISTER_BITS (_Delivery_Role); REGISTER_CLASS_ENUM (MuteMaster, PreFader); @@ -739,6 +740,7 @@ setup_enum_writer () REGISTER_CLASS_ENUM (MuteMaster, Listen); REGISTER_CLASS_ENUM (MuteMaster, Main); REGISTER_CLASS_ENUM (MuteMaster, SurroundSend); + REGISTER_CLASS_ENUM (MuteMaster, MasterSend); REGISTER_BITS (_MuteMaster_MutePoint); REGISTER_CLASS_ENUM (IO, Input); diff --git a/libs/ardour/mute_master.cc b/libs/ardour/mute_master.cc index dbf5dbda19..5c1d762f9d 100644 --- a/libs/ardour/mute_master.cc +++ b/libs/ardour/mute_master.cc @@ -39,7 +39,7 @@ using namespace std; const string MuteMaster::xml_node_name (X_("MuteMaster")); const MuteMaster::MutePoint MuteMaster::AllPoints = MuteMaster::MutePoint( - PreFader|PostFader|Listen|Main|SurroundSend); + PreFader|PostFader|Listen|Main|SurroundSend|MasterSend); MuteMaster::MuteMaster (Session& s, Muteable& m, const std::string&) : SessionHandleRef (s) @@ -70,6 +70,10 @@ MuteMaster::MuteMaster (Session& s, Muteable& m, const std::string&) if (Config->get_mute_affects_surround_sends ()) { _mute_point = MutePoint (_mute_point | SurroundSend); } + + if (Config->get_mute_affects_master_sends ()) { + _mute_point = MutePoint (_mute_point | MasterSend); + } } void diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index c4e55db093..5819cc4a67 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -317,7 +317,7 @@ Route::init () } if (Profile->get_livetrax() && is_track()) { - _master_send.reset (new InternalSend (_session, _pannable, _mute_master, std::dynamic_pointer_cast (shared_from_this()), std::shared_ptr(), Delivery::Aux, false)); + _master_send.reset (new InternalSend (_session, _pannable, _mute_master, std::dynamic_pointer_cast (shared_from_this()), std::shared_ptr(), Delivery::MasterSend, false)); _master_send->set_display_to_user (false); }