diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-12-10 19:20:15 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-12-10 19:20:15 +0000 |
commit | d23a6de077181caa24af52229bb040c87ed34ebd (patch) | |
tree | 664ec7adbdf87826aced9b8d02d6b2603bf5d61d /gtk2_ardour/time_axis_view.cc | |
parent | 6e211e27e2027da328b6fe117f10e1962c007afb (diff) |
fix for most (all? we can dream ...) issues involved in #4399 (editing multiply-applies operations to playlists used more than once), and as a side-issue, fix playlist selection which broke when we hid Diskstreams inside Tracks by using orig_track_id() rather than orig_diskstream_id()
git-svn-id: svn://localhost/ardour2/branches/3.0@10968 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/time_axis_view.cc')
-rw-r--r-- | gtk2_ardour/time_axis_view.cc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc index 56dd2b746d..e71bbe4778 100644 --- a/gtk2_ardour/time_axis_view.cc +++ b/gtk2_ardour/time_axis_view.cc @@ -1304,3 +1304,30 @@ TimeAxisView::reset_visual_state () set_height (preset_height (HeightNormal)); } } + +TrackViewList +TrackViewList::filter_to_unique_playlists () +{ + std::set<boost::shared_ptr<ARDOUR::Playlist> > playlists; + TrackViewList ts; + + for (iterator i = begin(); i != end(); ++i) { + RouteTimeAxisView* rtav = dynamic_cast<RouteTimeAxisView*> (*i); + if (!rtav) { + /* not a route: include it anyway */ + ts.push_back (*i); + } else { + boost::shared_ptr<ARDOUR::Track> t = rtav->track(); + if (t) { + if (playlists.insert (t->playlist()).second) { + /* playlist not seen yet */ + ts.push_back (*i); + } + } else { + /* not a track: include it anyway */ + ts.push_back (*i); + } + } + } + return ts; +} |