*/
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.
RegionSelection::RegionSelection (const RegionSelection& other)
: std::list<RegionView*>()
{
- 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);
/** 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
// remove from layer sorted list
_bylayer.remove (rv);
-
+
erase (r);
return true;
}
if (s == max_framepos) {
return 0;
}
-
+
return s;
}
{
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<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;
+}