diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index fb68e74e26..33b4b77f88 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -17,6 +17,8 @@ */ +#define __STDC_LIMIT_MACROS 1 +#include #include "pbd/memento_command.h" #include "pbd/basename.h" #include "ardour/diskstream.h" @@ -1892,6 +1894,22 @@ TrimDrag::aborted () } } +pair +TrimDrag::extent () const +{ + pair e = make_pair (INT64_MAX, 0); + + for (list::const_iterator i = _views.begin(); i != _views.end(); ++i) { + boost::shared_ptr r = (*i)->region (); + pair const t = make_pair (r->position(), r->position() + r->length ()); + e.first = min (e.first, t.first); + e.second = max (e.second, t.second); + } + + return e; +} + + MeterMarkerDrag::MeterMarkerDrag (Editor* e, ArdourCanvas::Item* i, bool c) : Drag (e, i), _copy (c) diff --git a/gtk2_ardour/editor_drag.h b/gtk2_ardour/editor_drag.h index 7347780019..119bcc34b1 100644 --- a/gtk2_ardour/editor_drag.h +++ b/gtk2_ardour/editor_drag.h @@ -224,7 +224,7 @@ public: RegionDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list const &); virtual ~RegionDrag () {} - std::pair extent () const; + virtual std::pair extent () const; protected: @@ -412,6 +412,8 @@ public: return false; } + std::pair extent () const; + private: Operation _operation;