add Location::set_skip() to allow toggling of skip-functionality for a given Location
authorPaul Davis <paul@linuxaudiosystems.com>
Sat, 20 Sep 2014 03:21:17 +0000 (23:21 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Sat, 20 Sep 2014 03:21:31 +0000 (23:21 -0400)
libs/ardour/ardour/location.h
libs/ardour/location.cc

index b3a4e3ff24f49bbb2551e0bcf556d72f0239ce1f..754ebb80758472aec8429295ecf9b599b8d9c610 100644 (file)
@@ -85,6 +85,7 @@ class LIBARDOUR_API Location : public SessionHandleRef, public PBD::StatefulDest
        void set_hidden (bool yn, void *src);
        void set_cd (bool yn, void *src);
        void set_is_range_marker (bool yn, void* src);
+        void set_skip (bool yn);
 
        bool is_auto_punch () const { return _flags & IsAutoPunch; }
        bool is_auto_loop () const { return _flags & IsAutoLoop; }
index 94afad679d86e760f06ec8202189d547311367ff..df65c5b341ddc6ce15287c7ec49c10a0037722e2 100644 (file)
@@ -375,6 +375,17 @@ Location::set_is_range_marker (bool yn, void*)
        }
 }
 
+void
+Location::set_skip (bool yn)
+{
+        if (is_range_marker() && length() > 0) {
+                if (set_flag_internal (yn, IsSkip)) {
+                        flags_changed (this);
+                        FlagsChanged ();
+                }
+        }
+}
+
 void
 Location::set_auto_punch (bool yn, void*)
 {
@@ -648,6 +659,7 @@ Locations::Locations (Session& s)
        Location::changed.connect_same_thread (*this, boost::bind (&Locations::location_changed, this, _1));
        Location::start_changed.connect_same_thread (*this, boost::bind (&Locations::location_changed, this, _1));
        Location::end_changed.connect_same_thread (*this, boost::bind (&Locations::location_changed, this, _1));
+       Location::flags_changed.connect_same_thread (*this, boost::bind (&Locations::location_changed, this, _1));
 }
 
 Locations::~Locations ()