Add personal monitor sends

This commit is contained in:
Len Ovens 2018-10-19 08:49:30 -07:00
parent 070f370e40
commit 777fe3c68f
11 changed files with 61 additions and 44 deletions

View File

@ -2697,15 +2697,6 @@ RCOptionEditor::RCOptionEditor ()
sigc::mem_fun (*_rc_config, &RCConfiguration::get_link_send_and_route_panner),
sigc::mem_fun (*_rc_config, &RCConfiguration::set_link_send_and_route_panner)
));
add_option (_("Mixer"), new OptionEditorHeading (_("Send Controls")));
add_option (_("Mixer"),
new BoolOption (
"hiding-aux-hides-connected-sends",
_("When Aux Bus is hidden the sends in the prosessor box that feed it will be hidden"),
sigc::mem_fun (*_rc_config, &RCConfiguration::get_hiding_aux_hides_connected_sends),
sigc::mem_fun (*_rc_config, &RCConfiguration::set_hiding_aux_hides_connected_sends)
));
}
/* Signal Flow */

View File

@ -48,7 +48,9 @@ public:
/* listen - internal send used only to deliver to control/monitor bus */
Listen = 0x8,
/* aux - internal send used to deliver to any bus, by user request */
Aux = 0x10
Aux = 0x10,
/* personal - internal send used only to deliver to a personal monitor bus */
Personal = 0x20
};
static bool role_requires_output_ports (Role r) { return r == Main || r == Send || r == Insert; }

View File

@ -76,7 +76,6 @@ private:
void send_from_going_away ();
void send_to_going_away ();
void send_to_property_changed (const PBD::PropertyChange&);
void send_to_pi_change (const PBD::PropertyChange&);
int connect_when_legal ();
void init_gain ();
int use_target (boost::shared_ptr<Route>);

View File

@ -142,8 +142,6 @@ CONFIG_VARIABLE (bool, quieten_at_speed, "quieten-at-speed", true)
CONFIG_VARIABLE (bool, link_send_and_route_panner, "link-send-and-route-panner", true)
CONFIG_VARIABLE (std::string, midi_audition_synth_uri, "midi-audition-synth-uri", "@default@")
CONFIG_VARIABLE (bool, hiding_aux_hides_connected_sends, "hiding-aux-hides-connected-sends", false)
/* click */
CONFIG_VARIABLE (bool, clicking, "clicking", false)

View File

@ -412,6 +412,7 @@ public:
PBD::Signal1<void,void*> SelectedChanged;
int add_aux_send (boost::shared_ptr<Route>, boost::shared_ptr<Processor>);
int add_personal_send (boost::shared_ptr<Route>);
void remove_aux_or_listen (boost::shared_ptr<Route>);
/**

View File

@ -43,7 +43,7 @@ public:
uint32_t bit_slot() const { return _bitslot; }
bool display_to_user() const;
bool is_aux () const { return _role == Aux; }
bool is_personal () const { return _role == Personal; }
boost::shared_ptr<Amp> amp() const { return _amp; }
boost::shared_ptr<PeakMeter> meter() const { return _meter; }

View File

@ -63,7 +63,7 @@ Delivery::Delivery (Session& s, boost::shared_ptr<IO> io, boost::shared_ptr<Pann
{
if (pannable) {
bool is_send = false;
if (r & (Delivery::Send|Delivery::Aux)) is_send = true;
if (r & (Delivery::Send|Delivery::Aux|Delivery::Personal)) is_send = true;
_panshell = boost::shared_ptr<PannerShell>(new PannerShell (_name, _session, pannable, is_send));
}
@ -87,7 +87,7 @@ Delivery::Delivery (Session& s, boost::shared_ptr<Pannable> pannable, boost::sha
{
if (pannable) {
bool is_send = false;
if (r & (Delivery::Send|Delivery::Aux)) is_send = true;
if (r & (Delivery::Send|Delivery::Aux|Delivery::Personal)) is_send = true;
_panshell = boost::shared_ptr<PannerShell>(new PannerShell (_name, _session, pannable, is_send));
}
@ -556,6 +556,7 @@ Delivery::target_gain ()
case Send:
case Insert:
case Aux:
case Personal:
if (_pre_fader) {
mp = MuteMaster::PreFader;
} else {

View File

@ -112,9 +112,6 @@ InternalSend::use_target (boost::shared_ptr<Route> sendto)
_send_to->DropReferences.connect_same_thread (target_connections, boost::bind (&InternalSend::send_to_going_away, this));
_send_to->PropertyChanged.connect_same_thread (target_connections, boost::bind (&InternalSend::send_to_property_changed, this, _1));
_send_to->io_changed.connect_same_thread (target_connections, boost::bind (&InternalSend::target_io_changed, this));
boost::shared_ptr<Stripable> st_to = boost::dynamic_pointer_cast<Stripable> (_send_to);
st_to->presentation_info().PropertyChanged.connect_same_thread (target_connections, boost::bind (&InternalSend::send_to_pi_change, this, _1));
send_to_pi_change (Properties::hidden);
return 0;
}
@ -429,20 +426,6 @@ InternalSend::send_to_property_changed (const PropertyChange& what_changed)
}
}
void
InternalSend::send_to_pi_change (const PBD::PropertyChange& what_changed)
{
if (what_changed.contains (Properties::hidden)) {
boost::shared_ptr<Stripable> st_to = boost::dynamic_pointer_cast<Stripable> (_send_to);
if (Config->get_hiding_aux_hides_connected_sends()) {
set_display_to_user (!st_to->is_hidden ());
} else {
set_display_to_user (true);
}
_send_from->processors_changed (RouteProcessorChange ()); /* EMIT SIGNAL */
}
}
void
InternalSend::set_can_pan (bool yn)
{

View File

@ -3192,6 +3192,44 @@ Route::add_aux_send (boost::shared_ptr<Route> route, boost::shared_ptr<Processor
return 0;
}
int
Route::add_personal_send (boost::shared_ptr<Route> route)
{
assert (route != _session.monitor_out ());
boost::shared_ptr<Processor> before = before_processor_for_placement (PreFader);
{
Glib::Threads::RWLock::ReaderLock rm (_processor_lock);
for (ProcessorList::iterator x = _processors.begin(); x != _processors.end(); ++x) {
boost::shared_ptr<InternalSend> d = boost::dynamic_pointer_cast<InternalSend> (*x);
if (d && d->target_route() == route) {
/* already listening via the specified IO: do nothing */
return 0;
}
}
}
try {
boost::shared_ptr<InternalSend> listener;
{
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
listener.reset (new InternalSend (_session, _pannable, _mute_master, boost::dynamic_pointer_cast<ARDOUR::Route>(shared_from_this()), route, Delivery::Personal));
}
add_processor (listener, before);
} catch (failed_constructor& err) {
return -1;
}
return 0;
}
void
Route::remove_aux_or_listen (boost::shared_ptr<Route> route)
{
@ -4656,6 +4694,7 @@ Route::setup_invisible_processors ()
*/
ProcessorList new_processors;
ProcessorList personal_sends;
ProcessorList::iterator dr;
ProcessorList::iterator dw;
@ -4666,8 +4705,8 @@ Route::setup_invisible_processors ()
if ((*i)->display_to_user ()) {
new_processors.push_back (*i);
}
else if (auxsnd && auxsnd->is_aux ()) {
new_processors.push_back (*i);
else if (auxsnd && auxsnd->is_personal ()) {
personal_sends.push_back (*i);
}
}
@ -4720,6 +4759,12 @@ Route::setup_invisible_processors ()
new_processors.insert (meter_point, _meter);
}
/* Personal Sends */
for (ProcessorList::iterator i = personal_sends.begin(); i != personal_sends.end(); ++i) {
new_processors.insert (amp, (*i));
}
/* MONITOR SEND */
if (_monitor_send && !is_monitor ()) {

View File

@ -67,6 +67,8 @@ Send::name_and_id_new_send (Session& s, Role r, uint32_t& bitslot, bool ignore_b
return _("listen"); // no ports, no need for numbering
case Delivery::Send:
return string_compose (_("send %1"), (bitslot = s.next_send_id ()) + 1);
case Delivery::Personal:
return string_compose (_("personal %1"), (bitslot = s.next_aux_send_id ()) + 1);
default:
fatal << string_compose (_("programming error: send created using role %1"), enum_2_string (r)) << endmsg;
abort(); /*NOTREACHED*/
@ -101,8 +103,6 @@ Send::Send (Session& s, boost::shared_ptr<Pannable> p, boost::shared_ptr<MuteMas
_send_delay.reset (new DelayLine (_session, "Send-" + name()));
_thru_delay.reset (new DelayLine (_session, "Thru-" + name()));
_display_to_user = true;
if (panner_shell()) {
panner_shell()->Changed.connect_same_thread (*this, boost::bind (&Send::panshell_changed, this));
}
@ -297,7 +297,7 @@ Send::set_state (const XMLNode& node, int version)
*/
if ((prop = node.property ("bitslot")) == 0) {
if (_role == Delivery::Aux) {
if (_role == Delivery::Aux || _role == Delivery::Personal) {
_bitslot = _session.next_aux_send_id ();
} else if (_role == Delivery::Send) {
_bitslot = _session.next_send_id ();
@ -306,7 +306,7 @@ Send::set_state (const XMLNode& node, int version)
_bitslot = 0;
}
} else {
if (_role == Delivery::Aux) {
if (_role == Delivery::Aux || _role == Delivery::Personal) {
_session.unmark_aux_send_id (_bitslot);
_bitslot = string_to<uint32_t>(prop->value());
_session.mark_aux_send_id (_bitslot);
@ -451,11 +451,9 @@ Send::display_to_user () const
{
/* we ignore Deliver::_display_to_user */
if (_role == Listen) {
if (_role == Listen || _role == Personal) {
/* don't make the monitor/control/listen send visible */
return false;
} else if (_role == Aux) {
return _display_to_user;
}
return true;

View File

@ -6546,8 +6546,7 @@ OSC::cue_new_send (string rt_name, lo_message msg)
bool s_only = true;
if (!rt_send->feeds (aux, &s_only)) {
// create send
boost::shared_ptr<Processor> loc = rt_send->before_processor_for_placement (PreFader);
rt_send->add_aux_send (aux, loc);
rt_send->add_personal_send (aux);
boost::shared_ptr<Send> snd = rt_send->internal_send_for (aux);
session->dirty ();
return 0;