+
+framepos_t
+RegionSelection::start () const
+{
+ framepos_t s = max_framepos;
+ for (RegionSelection::const_iterator i = begin(); i != end(); ++i) {
+ s = min (s, (*i)->region()->position ());
+ }
+
+ if (s == max_framepos) {
+ return 0;
+ }
+
+ return s;
+}
+
+framepos_t
+RegionSelection::end_frame () const
+{
+ framepos_t e = 0;
+ for (RegionSelection::const_iterator i = begin(); i != end(); ++i) {
+ e = max (e, (*i)->region()->last_frame ());
+ }
+
+ return e;
+}
+
+/** @return the playlists that the regions in the selection are on */
+set<boost::shared_ptr<Playlist> >
+RegionSelection::playlists () const
+{
+ set<boost::shared_ptr<Playlist> > pl;
+ for (RegionSelection::const_iterator i = begin(); i != end(); ++i) {
+ pl.insert ((*i)->region()->playlist ());
+ }
+
+ return pl;
+}