fix issue with solo-in-place
[ardour.git] / gtk2_ardour / editor_mixer.cc
index 0109aa38c1107bd04f1b550e0785b17da6b35ee5..0c0348383f2a577a3423dc9144acbbc63eec6476 100644 (file)
@@ -30,6 +30,8 @@
 
 #include "ardour/rc_configuration.h"
 
+#include "control_protocol/control_protocol.h"
+
 #include "actions.h"
 #include "ardour_ui.h"
 #include "audio_time_axis.h"
@@ -44,7 +46,7 @@
 #include "selection.h"
 #include "ui_config.h"
 
-#include "i18n.h"
+#include "pbd/i18n.h"
 
 using namespace std;
 using namespace Gtkmm2ext;
@@ -197,21 +199,6 @@ Editor::set_selected_mixer_strip (TimeAxisView& view)
                return;
        }
 
-       Glib::RefPtr<Gtk::Action> act = ActionManager::get_action (X_("Editor"), X_("show-editor-mixer"));
-
-       if (act) {
-               Glib::RefPtr<Gtk::ToggleAction> tact = Glib::RefPtr<Gtk::ToggleAction>::cast_dynamic(act);
-               if (!tact || !tact->get_active()) {
-                       /* not showing mixer strip presently */
-                       return;
-               }
-       }
-
-       if (current_mixer_strip == 0) {
-               create_editor_mixer ();
-       }
-
-
        // if this is an automation track, then we shold the mixer strip should
        // show the parent
 
@@ -240,6 +227,26 @@ Editor::set_selected_mixer_strip (TimeAxisView& view)
                }
        }
 
+       /* Typically this is set by changing the TAV selection but if for any
+          reason we decide to show a different strip for some reason, make
+          sure that control surfaces can find it.
+       */
+       ARDOUR::ControlProtocol::set_first_selected_stripable (route);
+
+       Glib::RefPtr<Gtk::Action> act = ActionManager::get_action (X_("Editor"), X_("show-editor-mixer"));
+
+       if (act) {
+               Glib::RefPtr<Gtk::ToggleAction> tact = Glib::RefPtr<Gtk::ToggleAction>::cast_dynamic(act);
+               if (!tact || !tact->get_active()) {
+                       /* not showing mixer strip presently */
+                       return;
+               }
+       }
+
+       if (current_mixer_strip == 0) {
+               create_editor_mixer ();
+       }
+
        if (current_mixer_strip->route() == route) {
                return;
        }
@@ -294,12 +301,12 @@ Editor::follow_mixer_selection ()
        _following_mixer_selection = true;
        selection->block_tracks_changed (true);
 
-       RouteUISelection& s (Mixer_UI::instance()->selection().routes);
+       AxisViewSelection& s (Mixer_UI::instance()->selection().axes);
 
        selection->clear_tracks ();
 
-       for (RouteUISelection::iterator i = s.begin(); i != s.end(); ++i) {
-               TimeAxisView* tav = get_route_view_by_route_id ((*i)->route()->id());
+       for (AxisViewSelection::iterator i = s.begin(); i != s.end(); ++i) {
+               TimeAxisView* tav = axis_view_from_stripable ((*i)->stripable());
                if (tav) {
                        selection->add (tav);
                }