Update codec-quality display when ExportFormat changes
[ardour.git] / gtk2_ardour / playlist_selection.h
index 14366418e69af04852bbd23152063cbb7ac86a35..93aea79093af941472fb61e4b9b2131abf5facc9 100644 (file)
@@ -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<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__ */