summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_routes.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2009-11-29 12:47:59 +0000
committerCarl Hetherington <carl@carlh.net>2009-11-29 12:47:59 +0000
commit515d19c74519599c53d6fc85c1af2647f390d95f (patch)
tree1f1dbbe3beccbe37872bf1ec565bc7aa7c6a240c /gtk2_ardour/editor_routes.cc
parentb88e7fdcca8ef8fa4c22f93c2934b30713ab4716 (diff)
Implement 2532: option to show tracks with regions under the playhead.
git-svn-id: svn://localhost/ardour2/branches/3.0@6207 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_routes.cc')
-rw-r--r--gtk2_ardour/editor_routes.cc28
1 files changed, 27 insertions, 1 deletions
diff --git a/gtk2_ardour/editor_routes.cc b/gtk2_ardour/editor_routes.cc
index 32dfa77f48..929240eca4 100644
--- a/gtk2_ardour/editor_routes.cc
+++ b/gtk2_ardour/editor_routes.cc
@@ -219,7 +219,7 @@ EditorRoutes::build_menu ()
items.push_back (MenuElem (_("Hide All Audio Tracks"), mem_fun (*this, &EditorRoutes::hide_all_audiotracks)));
items.push_back (MenuElem (_("Show All Audio Busses"), mem_fun (*this, &EditorRoutes::show_all_audiobus)));
items.push_back (MenuElem (_("Hide All Audio Busses"), mem_fun (*this, &EditorRoutes::hide_all_audiobus)));
-
+ items.push_back (MenuElem (_("Show Tracks With Regions Under Playhead"), mem_fun (*this, &EditorRoutes::show_tracks_with_regions_at_playhead)));
}
void
@@ -968,3 +968,29 @@ EditorRoutes::solo_changed_so_update_mute ()
update_mute_display (this);
}
+
+void
+EditorRoutes::show_tracks_with_regions_at_playhead ()
+{
+ boost::shared_ptr<RouteList> const r = _session->get_routes_with_regions_at (_session->transport_frame ());
+
+ set<TimeAxisView*> show;
+ for (RouteList::const_iterator i = r->begin(); i != r->end(); ++i) {
+ cout << "show " << (*i)->name() << "\n";
+ TimeAxisView* tav = _editor->axis_view_from_route (i->get ());
+ if (tav) {
+ show.insert (tav);
+ }
+ }
+
+ suspend_redisplay ();
+
+ TreeModel::Children rows = _model->children ();
+ for (TreeModel::Children::iterator i = rows.begin(); i != rows.end(); ++i) {
+ TimeAxisView* tv = (*i)[_columns.tv];
+ (*i)[_columns.visible] = (show.find (tv) != show.end());
+ }
+
+ resume_redisplay ();
+
+}