Add personal monitor sends
authorLen Ovens <len@ovenwerks.net>
Fri, 19 Oct 2018 15:49:30 +0000 (08:49 -0700)
committerLen Ovens <len@ovenwerks.net>
Fri, 19 Oct 2018 15:51:29 +0000 (08:51 -0700)
gtk2_ardour/rc_option_editor.cc
libs/ardour/ardour/delivery.h
libs/ardour/ardour/internal_send.h
libs/ardour/ardour/rc_configuration_vars.h
libs/ardour/ardour/route.h
libs/ardour/ardour/send.h
libs/ardour/delivery.cc
libs/ardour/internal_send.cc
libs/ardour/route.cc
libs/ardour/send.cc
libs/surfaces/osc/osc.cc

index b7a6d367bf187f4cbaf797299b674aa9ac8c13a7..08d55a8f0e95fcbfbf3f08abb5a49fab560fe149 100644 (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 */
index 451d7bdd0ceb8635007020c2b3e62d0240b6706f..88db428600f370e968d56cda25d5a6fb60c206b7 100644 (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; }
index 20f268e3d04c3e23f6712db7c550a1bf1fd81633..8547f73b08ce4c404205ee56f79db15ca85b206d 100644 (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>);
index 58aa7e571e7ab0fb77448e3264a75ae86d852b07..452a0822cc7cea54d5458356dea5110b8f77e6b5 100644 (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)
index 152acf37e6c229478662c4bf70e4b2fef52363d1..f9e0af30f3e354f97c31e8868a8e3a77b4c491c4 100644 (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>);
 
        /**
index 877e38eb17d4be50899c9f837478ffc9b2ea2545..9423791d821b6707249f64ac7e40ae90b4632e47 100644 (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; }
index 27a12dbc29cdb77ad13dc20e91c69d7759c8d985..f9db91028821434dbd8121f504262b174141bed9 100644 (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 {
index 8b2ace2654f024d4a3e74b490f3ff030881c1f31..e7b824f1b0d899002800bf310985834732e78098 100644 (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)
 {
index 1eca850da3518cbb926b12f0294e8f29aafa910e..746abc6efdf0636cab8a5c14eabe71386a56bb61 100644 (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 ()) {
index a64a62f6a7a25d1678524487c229b60bbfab26f8..1bf1dadf4bce461209229fcf41932a751a364418 100644 (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;
index 337fefc4221eb2879613680fc5c93877c19f2a74..31002b7ceffe7fe9eb46e2a33929836e6b253b47 100644 (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;