diff options
author | Carl Hetherington <carl@carlh.net> | 2009-11-29 12:47:59 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2009-11-29 12:47:59 +0000 |
commit | 515d19c74519599c53d6fc85c1af2647f390d95f (patch) | |
tree | 1f1dbbe3beccbe37872bf1ec565bc7aa7c6a240c /gtk2_ardour | |
parent | b88e7fdcca8ef8fa4c22f93c2934b30713ab4716 (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')
-rw-r--r-- | gtk2_ardour/editor_routes.cc | 28 | ||||
-rw-r--r-- | gtk2_ardour/editor_routes.h | 1 |
2 files changed, 28 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 (); + +} diff --git a/gtk2_ardour/editor_routes.h b/gtk2_ardour/editor_routes.h index 454f850c52..e2e9f0110e 100644 --- a/gtk2_ardour/editor_routes.h +++ b/gtk2_ardour/editor_routes.h @@ -75,6 +75,7 @@ private: void hide_all_audiotracks (); void show_all_audiobus (); void hide_all_audiobus (); + void show_tracks_with_regions_at_playhead (); void display_drag_data_received ( Glib::RefPtr<Gdk::DragContext> const &, gint, gint, Gtk::SelectionData const &, guint, guint |