Option to hide send if aux is hidden
authorLen Ovens <len@ovenwerks.net>
Wed, 17 Oct 2018 22:58:08 +0000 (15:58 -0700)
committerLen Ovens <len@ovenwerks.net>
Wed, 17 Oct 2018 22:59:00 +0000 (15:59 -0700)
gtk2_ardour/rc_option_editor.cc
libs/ardour/ardour/internal_send.h
libs/ardour/ardour/rc_configuration_vars.h
libs/ardour/internal_send.cc
libs/surfaces/osc/osc.cc
libs/surfaces/osc/osc_cue_observer.cc
libs/surfaces/osc/osc_cue_observer.h

index 08d55a8f0e95fcbfbf3f08abb5a49fab560fe149..b7a6d367bf187f4cbaf797299b674aa9ac8c13a7 100644 (file)
@@ -2697,6 +2697,15 @@ 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 8547f73b08ce4c404205ee56f79db15ca85b206d..20f268e3d04c3e23f6712db7c550a1bf1fd81633 100644 (file)
@@ -76,6 +76,7 @@ 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 452a0822cc7cea54d5458356dea5110b8f77e6b5..58aa7e571e7ab0fb77448e3264a75ae86d852b07 100644 (file)
@@ -142,6 +142,8 @@ 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 9749dab7603aacb0c84aa4404f6a4dcbea7c8ab0..0292badefacc400ac32598c45af4bf7b84b988be 100644 (file)
@@ -112,6 +112,9 @@ 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;
 }
@@ -426,6 +429,20 @@ 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 24fa6fcdfe0a38fee60f8ac01fd645c441f79750..337fefc4221eb2879613680fc5c93877c19f2a74 100644 (file)
@@ -6549,10 +6549,6 @@ OSC::cue_new_send (string rt_name, lo_message msg)
                                        boost::shared_ptr<Processor> loc = rt_send->before_processor_for_placement (PreFader);
                                        rt_send->add_aux_send (aux, loc);
                                        boost::shared_ptr<Send> snd = rt_send->internal_send_for (aux);
-                                       if (snd->gain_control() && aux->is_hidden ()) {
-                                               snd->set_display_to_user (false);
-                                               rt_send->processors_changed (RouteProcessorChange ()); /* EMIT SIGNAL */
-                                       }
                                        session->dirty ();
                                        return 0;
                                } else {
index 3a76e6fb71488186d83a3f4c5275a2ca75a4d853..115fb66024f8f4c4a4ffa7387a806293469e1ca8 100644 (file)
@@ -100,7 +100,6 @@ OSCCueObserver::refresh_strip (boost::shared_ptr<ARDOUR::Stripable> new_strip, S
        send_gain_message (0, _strip->gain_control(), true);
 
        send_init ();
-       hidden_changed ();
 
        tick_enable = true;
        tick ();
@@ -205,9 +204,6 @@ OSCCueObserver::send_restart ()
 void
 OSCCueObserver::name_changed (const PBD::PropertyChange& what_changed, uint32_t id)
 {
-       if (_hidden != _strip->is_hidden ()) {
-               hidden_changed ();
-       }
        if (!what_changed.contains (ARDOUR::Properties::name)) {
            return;
        }
@@ -222,20 +218,6 @@ OSCCueObserver::name_changed (const PBD::PropertyChange& what_changed, uint32_t
        }
 }
 
-void
-OSCCueObserver::hidden_changed ()
-{
-       _hidden = _strip->is_hidden ();
-       for (uint32_t i = 0; i < sends.size(); i++) {
-               boost::shared_ptr<Route> r = boost::dynamic_pointer_cast<Route> (sends[i]);
-               boost::shared_ptr<Send> send = r->internal_send_for (boost::dynamic_pointer_cast<Route> (_strip));
-               if (_hidden == send->display_to_user ()) {
-                       send->set_display_to_user (!_hidden);
-                       r->processors_changed (RouteProcessorChange ()); /* EMIT SIGNAL */
-               }
-       }
-}
-
 void
 OSCCueObserver::send_change_message (string path, uint32_t id, boost::shared_ptr<Controllable> controllable)
 {
index f85eb1e3d90d2ac7aa3724cc51693932c328f7e9..086303273269e62faf290b2849f9a8feb798b8ff 100644 (file)
@@ -63,7 +63,6 @@ class OSCCueObserver
        std::vector<float> _last_gain;
 
        void name_changed (const PBD::PropertyChange& what_changed, uint32_t id);
-       void hidden_changed (void);
        void send_change_message (std::string path, uint32_t id, boost::shared_ptr<PBD::Controllable> controllable);
        void send_gain_message (uint32_t id, boost::shared_ptr<PBD::Controllable> controllable, bool force);
        void send_enabled_message (std::string path, uint32_t id, boost::shared_ptr<ARDOUR::Processor> proc);