OSC: personal monitor send hidden follows aux hidden
authorLen Ovens <len@ovenwerks.net>
Tue, 16 Oct 2018 20:33:42 +0000 (13:33 -0700)
committerLen Ovens <len@ovenwerks.net>
Tue, 16 Oct 2018 20:56:52 +0000 (13:56 -0700)
libs/ardour/ardour/send.h
libs/ardour/route.cc
libs/ardour/send.cc
libs/surfaces/osc/osc.cc
libs/surfaces/osc/osc_cue_observer.cc
libs/surfaces/osc/osc_cue_observer.h

index c37055cd9465a0a1bd6efb7697ac882afec888ec..877e38eb17d4be50899c9f837478ffc9b2ea2545 100644 (file)
@@ -43,6 +43,7 @@ public:
        uint32_t bit_slot() const { return _bitslot; }
 
        bool display_to_user() const;
+       bool is_aux () const { return _role == Aux; }
 
        boost::shared_ptr<Amp> amp() const { return _amp; }
        boost::shared_ptr<PeakMeter> meter() const { return _meter; }
index d9cee574416eb77b23c877e2888539d1f1250636..1eca850da3518cbb926b12f0294e8f29aafa910e 100644 (file)
@@ -4662,9 +4662,13 @@ Route::setup_invisible_processors ()
        /* find visible processors */
 
        for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
+               boost::shared_ptr<Send> auxsnd = boost::dynamic_pointer_cast<Send> ((*i));
                if ((*i)->display_to_user ()) {
                        new_processors.push_back (*i);
                }
+               else if (auxsnd && auxsnd->is_aux ()) {
+                       new_processors.push_back (*i);
+               }
        }
 
        /* find the amp */
@@ -5642,7 +5646,7 @@ Route::send_pan_azi_controllable (uint32_t n) const
                }
        }
 #endif
-       
+
        return boost::shared_ptr<AutomationControl>();
 }
 
index dcea3fd5102b1e9eb1cef7d7e0b017769234eef3..a64a62f6a7a25d1678524487c229b60bbfab26f8 100644 (file)
@@ -101,6 +101,8 @@ 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));
        }
@@ -452,6 +454,8 @@ Send::display_to_user () const
        if (_role == Listen) {
                /* don't make the monitor/control/listen send visible */
                return false;
+       } else if (_role == Aux) {
+               return _display_to_user;
        }
 
        return true;
index 8d17a069416d6e1fa315556c224bdd3e7d78b31b..a5238fe7484664daa212cee9400d535e7c443e73 100644 (file)
@@ -6542,6 +6542,11 @@ OSC::cue_new_send (string rt_name, lo_message msg)
                                        // create send
                                        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 115fb66024f8f4c4a4ffa7387a806293469e1ca8..3a76e6fb71488186d83a3f4c5275a2ca75a4d853 100644 (file)
@@ -100,6 +100,7 @@ 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 ();
@@ -204,6 +205,9 @@ 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;
        }
@@ -218,6 +222,20 @@ 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 3dfe49472dff8ba474ce74ac2753a3107e4accb3..f85eb1e3d90d2ac7aa3724cc51693932c328f7e9 100644 (file)
@@ -57,11 +57,13 @@ class OSCCueObserver
        ArdourSurface::OSC::OSCSurface* sur;
        float _last_meter;
        float _last_signal;
+       bool _hidden;
        std::vector<uint32_t> gain_timeout;
        bool tick_enable;
        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);