#include "time_selection.h"
-#include "i18n.h"
+#include "pbd/i18n.h"
using namespace ARDOUR;
using namespace PBD;
}
}
fatal << string_compose (_("programming error: request for non-existent audio range (%1)!"), which) << endmsg;
- /*NOTREACHED*/
+ abort(); /*NOTREACHED*/
return *(new AudioRange(0,0,0)); /* keep the compiler happy; never called */
}
return changed;
}
-framepos_t
+samplepos_t
TimeSelection::start ()
{
if (empty()) {
return 0;
}
- framepos_t first = max_framepos;
+ samplepos_t first = max_samplepos;
for (std::list<AudioRange>::iterator i = begin(); i != end(); ++i) {
if ((*i).start < first) {
return first;
}
-framepos_t
-TimeSelection::end_frame ()
+samplepos_t
+TimeSelection::end_sample ()
{
- framepos_t last = 0;
+ samplepos_t last = 0;
/* XXX make this work like RegionSelection: no linear search needed */
return last;
}
-framecnt_t
+samplecnt_t
TimeSelection::length()
{
- return end_frame() - start() + 1;
+ if (empty()) {
+ return 0;
+ }
+
+ return end_sample() - start() + 1;
}