diff options
Diffstat (limited to 'gtk2_ardour/editor_mixer.cc')
-rw-r--r-- | gtk2_ardour/editor_mixer.cc | 65 |
1 files changed, 41 insertions, 24 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); |