NO-OP; Backport changes from Mixbus branch
[ardour.git] / gtk2_ardour / time_selection.cc
index 064e654cff21cda513fb29bcac6433d518f2e875..2f40dcb8e4afe0a06c80f963193fa94660bb1caf 100644 (file)
 #include <algorithm>
 
 #include "pbd/error.h"
-#include "ardour/ardour.h"
+#include "ardour/types.h"
 
 #include "time_selection.h"
 
-#include "i18n.h"
+#include "pbd/i18n.h"
 
 using namespace ARDOUR;
 using namespace PBD;
@@ -38,7 +38,7 @@ TimeSelection::operator[] (uint32_t which)
                }
        }
        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 */
 }
 
@@ -55,9 +55,9 @@ TimeSelection::consolidate ()
                                continue;
                        }
 
-                       if ((*a).coverage ((*b).start, (*b).end) != OverlapNone) {
-                               (*a).start = std::min ((*a).start, (*b).start);
-                               (*a).end = std::max ((*a).end, (*b).end);
+                       if (a->coverage (b->start, b->end) != Evoral::OverlapNone) {
+                               a->start = std::min (a->start, b->start);
+                               a->end = std::max (a->end, b->end);
                                erase (b);
                                changed = true;
                                goto restart;
@@ -103,5 +103,9 @@ TimeSelection::end_frame ()
 framecnt_t
 TimeSelection::length()
 {
+       if (empty()) {
+               return 0;
+       }
+
        return end_frame() - start() + 1;
 }