summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk2_ardour/editor_mixer.cc65
-rw-r--r--gtk2_ardour/editor_selection.cc14
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());
}