add left/right side trim cursors and use them for region trimming, as appropriate
[ardour.git] / libs / ardour / location.cc
index 6aa2f8faed80fba2a3a660628fa86332c064caf7..7202e1ef035def7603447ef8fe9ca5630ac9887e 100644 (file)
@@ -89,7 +89,7 @@ Location::set_start (nframes64_t s)
                return -1;
        }
 
-       if (((is_auto_punch() || is_auto_loop()) && s >= _end) || s > _end) {
+       if (((is_auto_punch() || is_auto_loop()) && s >= _end) || (!is_mark() && s > _end)) {
                return -1;
        }
 
@@ -151,8 +151,10 @@ Location::set_end (nframes64_t e)
 int
 Location::set (nframes64_t start, nframes64_t end)
 {
-       set_start (start);
-       set_end (end);
+       int const s = set_start (start);
+       int const e = set_end (end);
+
+       return (s == 0 && e == 0) ? 0 : -1;
 }
 
 int
@@ -546,6 +548,8 @@ Locations::clear_ranges ()
 void
 Locations::add (Location *loc, bool make_current)
 {
+       assert (loc);
+       
        {
                Glib::Mutex::Lock lm (lock);
                locations.push_back (loc);