X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Ftime_selection.cc;h=2f40dcb8e4afe0a06c80f963193fa94660bb1caf;hb=1de584961a746090583a4c97251f25924d6e03ad;hp=4bc0e2a96ab7c3c8754aa58095e148d43b3c4fe7;hpb=a2897ecef6da6a458aa1de8c2d9973a1e809dca2;p=ardour.git diff --git a/gtk2_ardour/time_selection.cc b/gtk2_ardour/time_selection.cc index 4bc0e2a96a..2f40dcb8e4 100644 --- a/gtk2_ardour/time_selection.cc +++ b/gtk2_ardour/time_selection.cc @@ -20,11 +20,11 @@ #include #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 */ } @@ -103,5 +103,9 @@ TimeSelection::end_frame () framecnt_t TimeSelection::length() { + if (empty()) { + return 0; + } + return end_frame() - start() + 1; }