From 1f8d176c1380951246e83d14d408c7515ca8b7ca Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 26 Nov 2010 22:45:20 +0000 Subject: Add lots of asserts to try to track down #3553. git-svn-id: svn://localhost/ardour2/branches/3.0@8096 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/location.cc | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'libs/ardour') diff --git a/libs/ardour/location.cc b/libs/ardour/location.cc index 7dce787b60..4f90b32282 100644 --- a/libs/ardour/location.cc +++ b/libs/ardour/location.cc @@ -50,7 +50,8 @@ Location::Location (Session& s) , _locked (false) , _position_lock_style (AudioTime) { - + assert (_start >= 0); + assert (_end >= 0); } Location::Location (Session& s, framepos_t sample_start, framepos_t sample_end, const std::string &name, Flags bits) @@ -63,6 +64,9 @@ Location::Location (Session& s, framepos_t sample_start, framepos_t sample_end, , _position_lock_style (AudioTime) { recompute_bbt_from_frames (); + + assert (_start >= 0); + assert (_end >= 0); } Location::Location (const Location& other) @@ -79,6 +83,9 @@ Location::Location (const Location& other) /* copy is not locked even if original was */ _locked = false; + + assert (_start >= 0); + assert (_end >= 0); } Location::Location (Session& s, const XMLNode& node) @@ -92,6 +99,9 @@ Location::Location (Session& s, const XMLNode& node) if (set_state (node, Stateful::loading_state_version)) { throw failed_constructor (); } + + assert (_start >= 0); + assert (_end >= 0); } Location* @@ -115,6 +125,9 @@ Location::operator= (const Location& other) /* "changed" not emitted on purpose */ + assert (_start >= 0); + assert (_end >= 0); + return this; } @@ -143,9 +156,14 @@ Location::set_start (framepos_t s, bool force, bool allow_bbt_recompute) if (allow_bbt_recompute) { recompute_bbt_from_frames (); } + start_changed (this); /* EMIT SIGNAL */ end_changed (this); /* EMIT SIGNAL */ } + + assert (_start >= 0); + assert (_end >= 0); + return 0; } @@ -164,6 +182,8 @@ Location::set_start (framepos_t s, bool force, bool allow_bbt_recompute) } } + assert (_start >= 0); + return 0; } @@ -195,6 +215,10 @@ Location::set_end (framepos_t e, bool force, bool allow_bbt_recompute) start_changed (this); /* EMIT SIGNAL */ end_changed (this); /* EMIT SIGNAL */ } + + assert (_start >= 0); + assert (_end >= 0); + return 0; } @@ -212,6 +236,8 @@ Location::set_end (framepos_t e, bool force, bool allow_bbt_recompute) } } + assert (_end >= 0); + return 0; } @@ -245,6 +271,9 @@ Location::move_to (framepos_t pos) changed (this); /* EMIT SIGNAL */ } + assert (_start >= 0); + assert (_end >= 0); + return 0; } @@ -465,6 +494,9 @@ Location::set_state (const XMLNode& node, int /*version*/) changed (this); /* EMIT SIGNAL */ + assert (_start >= 0); + assert (_end >= 0); + return 0; } -- cgit v1.2.3