diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-11-15 19:33:09 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-11-15 19:33:09 +0000 |
commit | e2757229a74a17a76682b6c72868d8e4822b7678 (patch) | |
tree | 4216effdc70248f5504cb3ea435eb93259ec9866 /gtk2_ardour/editor_mixer.cc | |
parent | a7359ed2687fb124817f800280bf63dfc4d73322 (diff) |
provide link-editor-and-mixer-selection option. gui implementation is slightly hacky because of the implicit endless loop that the link creates
git-svn-id: svn://localhost/ardour2/branches/3.0@10624 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_mixer.cc')
-rw-r--r-- | gtk2_ardour/editor_mixer.cc | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/gtk2_ardour/editor_mixer.cc b/gtk2_ardour/editor_mixer.cc index 09e3764483..0817a31128 100644 --- a/gtk2_ardour/editor_mixer.cc +++ b/gtk2_ardour/editor_mixer.cc @@ -27,6 +27,8 @@ #include "pbd/enumwriter.h" +#include "ardour/rc_configuration.h" + #include "actions.h" #include "ardour_ui.h" #include "audio_time_axis.h" @@ -38,6 +40,7 @@ #include "gui_thread.h" #include "midi_time_axis.h" #include "mixer_strip.h" +#include "mixer_ui.h" #include "selection.h" #include "i18n.h" @@ -251,3 +254,35 @@ 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 (!ARDOUR::Config->get_link_editor_and_mixer_selection() || _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 */ +} |