X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fregion_selection.cc;h=57ab59fd6864cb7e5a9b0f0bb7d879f2317efa67;hb=c358e77e1e81a68fcb8b18cd71a31c38262b2af7;hp=8ad7502414632acb873632296c19426d6499ceb9;hpb=fc5be662befcbf973db2f21066b1b1883da7acc8;p=ardour.git diff --git a/gtk2_ardour/region_selection.cc b/gtk2_ardour/region_selection.cc index 8ad7502414..57ab59fd68 100644 --- a/gtk2_ardour/region_selection.cc +++ b/gtk2_ardour/region_selection.cc @@ -33,7 +33,7 @@ using namespace PBD; */ RegionSelection::RegionSelection () { - RegionView::RegionViewGoingAway.connect (death_connection, MISSING_INVALIDATOR, ui_bind (&RegionSelection::remove_it, this, _1), gui_context()); + RegionView::RegionViewGoingAway.connect (death_connection, MISSING_INVALIDATOR, boost::bind (&RegionSelection::remove_it, this, _1), gui_context()); } /** Copy constructor. @@ -42,7 +42,7 @@ RegionSelection::RegionSelection () RegionSelection::RegionSelection (const RegionSelection& other) : std::list() { - RegionView::RegionViewGoingAway.connect (death_connection, MISSING_INVALIDATOR, ui_bind (&RegionSelection::remove_it, this, _1), gui_context()); + RegionView::RegionViewGoingAway.connect (death_connection, MISSING_INVALIDATOR, boost::bind (&RegionSelection::remove_it, this, _1), gui_context()); for (RegionSelection::const_iterator i = other.begin(); i != other.end(); ++i) { add (*i); @@ -87,7 +87,7 @@ bool RegionSelection::contains (RegionView* rv) const /** Add a region to the selection. * @param rv Region to add. - * @return false if we already had the region or if it cannot be added, + * @return false if we already had the region or if it cannot be added, * otherwise true. */ bool @@ -137,7 +137,7 @@ RegionSelection::remove (RegionView* rv) // remove from layer sorted list _bylayer.remove (rv); - + erase (r); return true; } @@ -260,7 +260,7 @@ RegionSelection::start () const if (s == max_framepos) { return 0; } - + return s; } @@ -269,8 +269,20 @@ RegionSelection::end_frame () const { framepos_t e = 0; for (RegionSelection::const_iterator i = begin(); i != end(); ++i) { - e = max (e, (*i)->region()->position () + (*i)->region()->length ()); + e = max (e, (*i)->region()->last_frame ()); } return e; } + +/** @return the playlists that the regions in the selection are on */ +set > +RegionSelection::playlists () const +{ + set > pl; + for (RegionSelection::const_iterator i = begin(); i != end(); ++i) { + pl.insert ((*i)->region()->playlist ()); + } + + return pl; +}