summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_mixer.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2010-08-20 21:34:18 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2010-08-20 21:34:18 +0000
commitc2e491b8fcadba0da7ab8415a6357cfba88a431d (patch)
tree266c28a245be897668d5e343e5e28faae30983a0 /gtk2_ardour/editor_mixer.cc
parentda4dee659bf0e834161ab7f8e48f9c4062ffe722 (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/editor_mixer.cc')
-rw-r--r--gtk2_ardour/editor_mixer.cc65
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);