diff options
author | Len Ovens <len@ovenwerks.net> | 2018-10-19 08:49:30 -0700 |
---|---|---|
committer | Len Ovens <len@ovenwerks.net> | 2018-10-19 08:51:29 -0700 |
commit | 777fe3c68fef42d8fee79432830787bcebdfcb59 (patch) | |
tree | 4b0d87eea0d882eab29a04256b482fb17dad23b1 /libs/ardour | |
parent | 070f370e40d6257bd5ab6248999701f25af36973 (diff) |
Add personal monitor sends
Diffstat (limited to 'libs/ardour')
-rw-r--r-- | libs/ardour/ardour/delivery.h | 4 | ||||
-rw-r--r-- | libs/ardour/ardour/internal_send.h | 1 | ||||
-rw-r--r-- | libs/ardour/ardour/rc_configuration_vars.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/route.h | 1 | ||||
-rw-r--r-- | libs/ardour/ardour/send.h | 2 | ||||
-rw-r--r-- | libs/ardour/delivery.cc | 5 | ||||
-rw-r--r-- | libs/ardour/internal_send.cc | 17 | ||||
-rw-r--r-- | libs/ardour/route.cc | 49 | ||||
-rw-r--r-- | libs/ardour/send.cc | 12 |
9 files changed, 60 insertions, 33 deletions
diff --git a/libs/ardour/ardour/delivery.h b/libs/ardour/ardour/delivery.h index 451d7bdd0c..88db428600 100644 --- a/libs/ardour/ardour/delivery.h +++ b/libs/ardour/ardour/delivery.h @@ -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; } diff --git a/libs/ardour/ardour/internal_send.h b/libs/ardour/ardour/internal_send.h index 20f268e3d0..8547f73b08 100644 --- a/libs/ardour/ardour/internal_send.h +++ b/libs/ardour/ardour/internal_send.h @@ -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>); diff --git a/libs/ardour/ardour/rc_configuration_vars.h b/libs/ardour/ardour/rc_configuration_vars.h index 58aa7e571e..452a0822cc 100644 --- a/libs/ardour/ardour/rc_configuration_vars.h +++ b/libs/ardour/ardour/rc_configuration_vars.h @@ -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) diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index 152acf37e6..f9e0af30f3 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -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>); /** diff --git a/libs/ardour/ardour/send.h b/libs/ardour/ardour/send.h index 877e38eb17..9423791d82 100644 --- a/libs/ardour/ardour/send.h +++ b/libs/ardour/ardour/send.h @@ -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; } diff --git a/libs/ardour/delivery.cc b/libs/ardour/delivery.cc index 27a12dbc29..f9db910288 100644 --- a/libs/ardour/delivery.cc +++ b/libs/ardour/delivery.cc @@ -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 { diff --git a/libs/ardour/internal_send.cc b/libs/ardour/internal_send.cc index 8b2ace2654..e7b824f1b0 100644 --- a/libs/ardour/internal_send.cc +++ b/libs/ardour/internal_send.cc @@ -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; } @@ -430,20 +427,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) { if (_panshell) { diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 1eca850da3..746abc6efd 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -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 ()) { diff --git a/libs/ardour/send.cc b/libs/ardour/send.cc index a64a62f6a7..1bf1dadf4b 100644 --- a/libs/ardour/send.cc +++ b/libs/ardour/send.cc @@ -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; |