FP8/16: Update Plugin List when Selection changes.
[ardour.git] / libs / surfaces / faderport8 / faderport8.cc
index 8405174ad5a433edb05fb80d16be34290b68609c..b10868aeede66b2ae0d5d14ca446c51f442090a8 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,10 +997,17 @@ 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);
-                       _ctrls.strip(id).select_button ().set_color ((*s)->presentation_info ().color());
+                       _ctrls.strip(id).set_select_button_color ((*s)->presentation_info ().color());
                        /* update selection lights */
                        _ctrls.strip(id).select_button ().set_active ((*s)->is_selected ());
                        _ctrls.strip(id).select_button ().set_blinking (*s == first_selected_stripable ());
@@ -1430,12 +1438,14 @@ FaderPort8::spill_plugins ()
 
        for (uint32_t i = 0; 0 != (proc = r->nth_plugin (i)); ++i) {
                if (!proc->display_to_user ()) {
+                       continue;
+               }
 #ifdef MIXBUS
-                       boost::shared_ptr<PluginInsert> pi = boost::dynamic_pointer_cast<PluginInsert> (proc);
-                       if (pi->is_channelstrip ()) // don't skip MB PRE
-#endif
+               /* don't show channelstrip plugins, use "well known" */
+               if (boost::dynamic_pointer_cast<PluginInsert> (proc)->is_channelstrip ()) {
                        continue;
                }
+#endif
                int n_controls = 0;
                set<Evoral::Parameter> p = proc->what_can_be_automated ();
                for (set<Evoral::Parameter>::iterator j = p.begin(); j != p.end(); ++j) {
@@ -1795,7 +1805,11 @@ FaderPort8::notify_stripable_property_changed (boost::weak_ptr<Stripable> ws, co
        uint8_t id = _assigned_strips[s];
 
        if (what_changed.contains (Properties::color)) {
-               _ctrls.strip(id).select_button ().set_color (s->presentation_info ().color());
+               _ctrls.strip(id).set_select_button_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)) {
@@ -1832,6 +1846,9 @@ FaderPort8::stripable_selection_changed ()
                                int wk = _showing_well_known;
                                drop_ctrl_connections ();
                                select_plugin (wk);
+                       } else if (_proc_params.size() == 0) {
+                               /* selecting plugin, update available */
+                               spill_plugins ();
                        }
                        return;
                case ModeSend: