From 1d5cc25d94650f5e2e656ce7cd24ae5fea2ae6fc Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 23 Apr 2011 00:02:58 +0000 Subject: [PATCH] Add some assertions. git-svn-id: svn://localhost/ardour2/branches/3.0@9411 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/beats_frames_converter.cc | 2 ++ libs/timecode/src/bbt_time.cc | 3 +++ 2 files changed, 5 insertions(+) diff --git a/libs/ardour/beats_frames_converter.cc b/libs/ardour/beats_frames_converter.cc index 10a1d44321..a960f1a221 100644 --- a/libs/ardour/beats_frames_converter.cc +++ b/libs/ardour/beats_frames_converter.cc @@ -27,6 +27,8 @@ namespace ARDOUR { framecnt_t BeatsFramesConverter::to (double beats) const { + assert (beats >= 0); + return _tempo_map.framepos_plus_bbt (_origin_b, Timecode::BBT_Time(beats)) - _origin_b; } diff --git a/libs/timecode/src/bbt_time.cc b/libs/timecode/src/bbt_time.cc index 2ece391786..c48191abe8 100644 --- a/libs/timecode/src/bbt_time.cc +++ b/libs/timecode/src/bbt_time.cc @@ -17,6 +17,7 @@ */ #include +#include #include "timecode/bbt_time.h" @@ -31,6 +32,8 @@ BBT_Time::BBT_Time (double dbeats) always be zero. */ + assert (dbeats >= 0); + bars = 0; beats = rint (floor (dbeats)); ticks = rint (floor (BBT_Time::ticks_per_beat * fmod (dbeats, 1.0)));