diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-08-20 21:34:18 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-08-20 21:34:18 +0000 |
commit | c2e491b8fcadba0da7ab8415a6357cfba88a431d (patch) | |
tree | 266c28a245be897668d5e343e5e28faae30983a0 /gtk2_ardour | |
parent | da4dee659bf0e834161ab7f8e48f9c4062ffe722 (diff) |
version of 6997 from 2.x: if selecting an automation track, show its parent in the editor mixer strip, plus don't deselect a track when the editor mixer strip is hidden
git-svn-id: svn://localhost/ardour2/branches/3.0@7660 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/editor_mixer.cc | 65 | ||||
-rw-r--r-- | gtk2_ardour/editor_selection.cc | 14 |
2 files changed, 48 insertions, 31 deletions
diff --git a/gtk2_ardour/editor_mixer.cc b/gtk2_ardour/editor_mixer.cc index 8cffd5c64b..de06c146b1 100644 --- a/gtk2_ardour/editor_mixer.cc +++ b/gtk2_ardour/editor_mixer.cc @@ -23,16 +23,18 @@ #include "pbd/enumwriter.h" -#include "editor.h" -#include "mixer_strip.h" +#include "actions.h" #include "ardour_ui.h" -#include "selection.h" #include "audio_time_axis.h" -#include "actions.h" +#include "automation_time_axis.h" +#include "editor.h" #include "editor_routes.h" #include "editor_route_groups.h" #include "editor_regions.h" #include "gui_thread.h" +#include "midi_time_axis.h" +#include "mixer_strip.h" +#include "selection.h" #include "i18n.h" @@ -160,9 +162,7 @@ Editor::create_editor_mixer () void Editor::set_selected_mixer_strip (TimeAxisView& view) { - RouteTimeAxisView* at; - - if (!_session || (at = dynamic_cast<RouteTimeAxisView*>(&view)) == 0) { + if (!_session) { return; } @@ -180,32 +180,49 @@ Editor::set_selected_mixer_strip (TimeAxisView& view) create_editor_mixer (); } - /* might be nothing to do */ - if (current_mixer_strip->route() == at->route()) { + // if this is an automation track, then we shold the mixer strip should + // show the parent + + boost::shared_ptr<ARDOUR::Route> route; + AutomationTimeAxisView* atv; + + if ((atv = dynamic_cast<AutomationTimeAxisView*>(&view)) != 0) { + + AudioTimeAxisView *parent = dynamic_cast<AudioTimeAxisView*>(view.get_parent()); + + if (parent) { + route = parent->route (); + } + + } else { + + AudioTimeAxisView* at = dynamic_cast<AudioTimeAxisView*> (&view); + + if (at) { + route = at->route(); + } else { + MidiTimeAxisView* mt = dynamic_cast<MidiTimeAxisView*> (&view); + if (mt) { + route = mt->route(); + } + } + } + + if (current_mixer_strip->route() == route) { return; } - current_mixer_strip->set_route (at->route()); - current_mixer_strip->set_width_enum (editor_mixer_strip_width, (void*) this); + if (route) { + current_mixer_strip->set_route (route); + current_mixer_strip->set_width_enum (editor_mixer_strip_width, (void*) this); + } } void Editor::current_mixer_strip_hidden () { - for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) { - - RouteTimeAxisView* tmp; - - if ((tmp = dynamic_cast<RouteTimeAxisView*>(*i)) != 0) { - if (tmp->route() == current_mixer_strip->route()) { - (*i)->set_selected (false); - break; - } - } - } - - Glib::RefPtr<Gtk::Action> act = ActionManager::get_action (X_("Editor"), X_("show-editor-mixer")); + 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); tact->set_active (false); diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc index 854d4ad985..e99b31c478 100644 --- a/gtk2_ardour/editor_selection.cc +++ b/gtk2_ardour/editor_selection.cc @@ -797,13 +797,13 @@ Editor::track_selection_changed () } for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) { - (*i)->set_selected (find (selection->tracks.begin(), selection->tracks.end(), *i) != selection->tracks.end()); - - TimeAxisView::Children c = (*i)->get_child_list (); - for (TimeAxisView::Children::iterator j = c.begin(); j != c.end(); ++j) { - (*j)->set_selected (find (selection->tracks.begin(), selection->tracks.end(), j->get()) != selection->tracks.end()); - } - } + (*i)->set_selected (find (selection->tracks.begin(), selection->tracks.end(), *i) != selection->tracks.end()); + + TimeAxisView::Children c = (*i)->get_child_list (); + for (TimeAxisView::Children::iterator j = c.begin(); j != c.end(); ++j) { + (*j)->set_selected (find (selection->tracks.begin(), selection->tracks.end(), j->get()) != selection->tracks.end()); + } + } ActionManager::set_sensitive (ActionManager::track_selection_sensitive_actions, !selection->tracks.empty()); } |