FP8/16 subscribe to panner changes (add/remove channel)
authorRobin Gareus <robin@gareus.org>
Thu, 21 Dec 2017 00:51:07 +0000 (01:51 +0100)
committerRobin Gareus <robin@gareus.org>
Thu, 21 Dec 2017 01:30:01 +0000 (02:30 +0100)
libs/surfaces/faderport8/faderport8.cc

index 8405174ad5a433edb05fb80d16be34290b68609c..bbb85faac505cf1f3da08d5460bfef51310b13f4 100644 (file)
@@ -37,6 +37,7 @@
 #include "ardour/debug.h"
 #include "ardour/midi_track.h"
 #include "ardour/midiport_manager.h"
+#include "ardour/panner_shell.h"
 #include "ardour/plugin.h"
 #include "ardour/plugin_insert.h"
 #include "ardour/processor.h"
@@ -996,6 +997,13 @@ FaderPort8::assign_stripables (bool select_only)
                (*s)->presentation_info ().PropertyChanged.connect (assigned_stripable_connections, MISSING_INVALIDATOR,
                                boost::bind (&FaderPort8::notify_stripable_property_changed, this, boost::weak_ptr<Stripable> (*s), _1), this);
 
+               if (boost::shared_ptr<Route> r = boost::dynamic_pointer_cast<Route>(*s)) {
+                       if (r->panner_shell()) {
+                               r->panner_shell()->Changed.connect (assigned_stripable_connections, MISSING_INVALIDATOR,
+                               boost::bind (&FaderPort8::notify_stripable_property_changed, this, boost::weak_ptr<Stripable> (*s), PropertyChange()), this);
+                       }
+               }
+
                if (select_only) {
                        /* used in send mode */
                        _ctrls.strip(id).set_text_line (3, (*s)->name (), true);
@@ -1798,6 +1806,10 @@ FaderPort8::notify_stripable_property_changed (boost::weak_ptr<Stripable> ws, co
                _ctrls.strip(id).select_button ().set_color (s->presentation_info ().color());
        }
 
+       if (what_changed.empty ()) {
+               _ctrls.strip(id).set_stripable (s, _ctrls.fader_mode() == ModePan);
+       }
+
        if (what_changed.contains (Properties::name)) {
                switch (_ctrls.fader_mode ()) {
                        case ModeSend: