Tempo Marks : set point colour by discontinuity, display non-quarter pulse if we...
[ardour.git] / gtk2_ardour / editor_mixer.cc
index 0109aa38c1107bd04f1b550e0785b17da6b35ee5..51691136aea6d2848aaa9a216408fb15c3bd46ad 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;
        }
@@ -278,34 +285,3 @@ Editor::mixer_strip_width_changed ()
        editor_mixer_strip_width = current_mixer_strip->get_width_enum ();
 }
 
-void
-Editor::track_mixer_selection ()
-{
-       Mixer_UI::instance()->selection().RoutesChanged.connect (sigc::mem_fun (*this, &Editor::follow_mixer_selection));
-}
-
-void
-Editor::follow_mixer_selection ()
-{
-       if (_following_mixer_selection) {
-               return;
-       }
-
-       _following_mixer_selection = true;
-       selection->block_tracks_changed (true);
-
-       RouteUISelection& s (Mixer_UI::instance()->selection().routes);
-
-       selection->clear_tracks ();
-
-       for (RouteUISelection::iterator i = s.begin(); i != s.end(); ++i) {
-               TimeAxisView* tav = get_route_view_by_route_id ((*i)->route()->id());
-               if (tav) {
-                       selection->add (tav);
-               }
-       }
-
-       _following_mixer_selection = false;
-       selection->block_tracks_changed (false);
-       selection->TracksChanged (); /* EMIT SIGNAL */
-}