clean up plugin-ui meter layout
[ardour.git] / gtk2_ardour / time_selection.cc
index 4bc0e2a96ab7c3c8754aa58095e148d43b3c4fe7..a0f33e8c99fd0db7aabe36275e8d3799a46e03f7 100644 (file)
@@ -20,7 +20,7 @@
 #include <algorithm>
 
 #include "pbd/error.h"
-#include "ardour/ardour.h"
+#include "ardour/types.h"
 
 #include "time_selection.h"
 
@@ -103,5 +103,9 @@ TimeSelection::end_frame ()
 framecnt_t
 TimeSelection::length()
 {
+       if (empty()) {
+               return 0;
+       }
+
        return end_frame() - start() + 1;
 }