diff options
Diffstat (limited to 'gtk2_ardour/playlist_selection.h')
-rw-r--r-- | gtk2_ardour/playlist_selection.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/gtk2_ardour/playlist_selection.h b/gtk2_ardour/playlist_selection.h index 4fcf1c64c8..93aea79093 100644 --- a/gtk2_ardour/playlist_selection.h +++ b/gtk2_ardour/playlist_selection.h @@ -27,6 +27,20 @@ namespace ARDOUR { class Playlist; } -struct PlaylistSelection : std::list<boost::shared_ptr<ARDOUR::Playlist> > {}; +struct PlaylistSelection : std::list<boost::shared_ptr<ARDOUR::Playlist> > { +public: + const_iterator + get_nth(ARDOUR::DataType type, size_t nth) const { + size_t count = 0; + for (const_iterator l = begin(); l != end(); ++l) { + if ((*l)->data_type() == type) { + if (count++ == nth) { + return l; + } + } + } + return end(); + } +}; #endif /* __ardour_gtk_playlist_selection_h__ */ |