#include <glibmm/thread.h>
#include "pbd/xml++.h"
-#include "pbd/stacktrace.h"
-#include "pbd/enumwriter.h"
#include "ardour/debug.h"
-#include "ardour/file_source.h"
#include "ardour/filter.h"
#include "ardour/playlist.h"
#include "ardour/playlist_source.h"
#include "ardour/region_factory.h"
#include "ardour/session.h"
#include "ardour/source.h"
-#include "ardour/source_factory.h"
#include "ardour/tempo.h"
-#include "ardour/utils.h"
#include "i18n.h"
using namespace PBD;
namespace ARDOUR {
+ class Progress;
namespace Properties {
PBD::PropertyDescriptor<bool> muted;
PBD::PropertyDescriptor<bool> opaque;
{
_start = s;
}
+
+framepos_t
+Region::earliest_possible_position () const
+{
+ if (_start > _position) {
+ return 0;
+ } else {
+ return _position - _start;
+ }
+}
+
+framecnt_t
+Region::latest_possible_frame () const
+{
+ framecnt_t minlen = max_framecnt;
+
+ for (SourceList::const_iterator i = _sources.begin(); i != _sources.end(); ++i) {
+ /* non-audio regions have a length that may vary based on their
+ * position, so we have to pass it in the call.
+ */
+ minlen = min (minlen, (*i)->length (_position));
+ }
+
+ /* the latest possible last frame is determined by the current
+ * position, plus the shortest source extent past _start.
+ */
+
+ return _position + (minlen - _start) - 1;
+}
+