X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fplaylist_selection.h;h=93aea79093af941472fb61e4b9b2131abf5facc9;hb=0b5f2c5d5877de5787a884229f445bc52182f328;hp=4fcf1c64c8bd35358eb97dbf61cfc233d101fb5c;hpb=bb9cc45cd22af67ac275a5e73accbe14fee664d8;p=ardour.git 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 > {}; +struct PlaylistSelection : std::list > { +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__ */