UI: Add editor_mixer route pointer to session so all UIs can know the same current_st...
authorLen Ovens <len@ovenwerks.net>
Mon, 4 Jul 2016 01:22:09 +0000 (18:22 -0700)
committerLen Ovens <len@ovenwerks.net>
Mon, 4 Jul 2016 01:22:09 +0000 (18:22 -0700)
gtk2_ardour/editor_mixer.cc
libs/ardour/ardour/session.h
libs/surfaces/osc/osc.cc

index 0109aa38c1107bd04f1b550e0785b17da6b35ee5..67b33a6c87fd3b8e510e83d342d5bd99b802ac7b 100644 (file)
@@ -197,21 +197,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 +225,22 @@ Editor::set_selected_mixer_strip (TimeAxisView& view)
                }
        }
 
+       _session->set_editor_mixer (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;
        }
index ebafdd82f67d97ca815b198edfc4288e12ec56d5..6c3d869013a0cabf8aa457af44835a5f96cf86e3 100644 (file)
@@ -818,6 +818,8 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
 
        boost::shared_ptr<Route> monitor_out() const { return _monitor_out; }
        boost::shared_ptr<Route> master_out() const { return _master_out; }
+       boost::weak_ptr<Route> get_editor_mixer() const { return _editor_mixer; }
+       void set_editor_mixer (boost::weak_ptr<Route> r) { _editor_mixer = r; }
 
        void globally_add_internal_sends (boost::shared_ptr<Route> dest, Placement p, bool);
        void globally_set_send_gains_from_track (boost::shared_ptr<Route> dest);
@@ -1867,6 +1869,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
 
        boost::shared_ptr<Route> _master_out;
        boost::shared_ptr<Route> _monitor_out;
+       boost::weak_ptr<Route> _editor_mixer;
 
        void auto_connect_master_bus ();
 
index a32e215290f1722f54d5e8f9857d85079f8275d0..57eb6c0f7a3cd8efa6d4df37ea8b926f3c64c4b1 100644 (file)
@@ -2617,7 +2617,7 @@ OSC::gui_selection_changed (StripableNotificationListPtr stripables)
        boost::shared_ptr<Stripable> strip;
 
        if (!stripables->empty()) {
-               strip = stripables->front().lock();
+               strip = boost::dynamic_pointer_cast<Stripable>(session->get_editor_mixer().lock());
        }
        if (strip) {
                for (uint32_t it = 0; it < _surface.size(); ++it) {