Add lots of asserts to try to track down #3553.
authorCarl Hetherington <carl@carlh.net>
Fri, 26 Nov 2010 22:45:20 +0000 (22:45 +0000)
committerCarl Hetherington <carl@carlh.net>
Fri, 26 Nov 2010 22:45:20 +0000 (22:45 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@8096 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/location.cc

index 7dce787b6099d5026fb1d7eb0478994ccf999e25..4f90b322826974b67307a18678d643042090a490 100644 (file)
@@ -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;
 }