X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fplaylist_selection.h;h=93aea79093af941472fb61e4b9b2131abf5facc9;hb=e42699600b92db69a428979dc0412c96f7494141;hp=14366418e69af04852bbd23152063cbb7ac86a35;hpb=2e8f80e37a7d20deb3f138cd72c26f8c6de9d1ab;p=ardour.git diff --git a/gtk2_ardour/playlist_selection.h b/gtk2_ardour/playlist_selection.h index 14366418e6..93aea79093 100644 --- a/gtk2_ardour/playlist_selection.h +++ b/gtk2_ardour/playlist_selection.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2007 Paul Davis + Copyright (C) 2000-2007 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -27,6 +27,20 @@ namespace ARDOUR { class Playlist; } -struct PlaylistSelection : 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__ */