Remove internal edit mode and add "content" tool.
[ardour.git] / gtk2_ardour / region_selection.cc
index 333e2104ad8f49244affffc5883c939f162ad763..54e5aa3acce47b69ff6fb737253bdf6bdaee29a7 100644 (file)
@@ -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*>()
 {
-       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);
@@ -73,6 +73,7 @@ void
 RegionSelection::clear_all()
 {
        clear();
+       pending.clear ();
        _bylayer.clear();
 }
 
@@ -269,8 +270,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<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;
+}