diff --git a/libs/ardour/ardour/location.h b/libs/ardour/ardour/location.h index 754ebb8075..52c445999f 100644 --- a/libs/ardour/ardour/location.h +++ b/libs/ardour/ardour/location.h @@ -53,6 +53,7 @@ class LIBARDOUR_API Location : public SessionHandleRef, public PBD::StatefulDest IsRangeMarker = 0x20, IsSessionRange = 0x40, IsSkip = 0x80, + IsSkipping = 0x100, /* skipping is active (or not) */ }; Location (Session &); @@ -86,6 +87,7 @@ class LIBARDOUR_API Location : public SessionHandleRef, public PBD::StatefulDest void set_cd (bool yn, void *src); void set_is_range_marker (bool yn, void* src); void set_skip (bool yn); + void set_skipping (bool yn); bool is_auto_punch () const { return _flags & IsAutoPunch; } bool is_auto_loop () const { return _flags & IsAutoLoop; } @@ -95,6 +97,7 @@ class LIBARDOUR_API Location : public SessionHandleRef, public PBD::StatefulDest bool is_session_range () const { return _flags & IsSessionRange; } bool is_range_marker() const { return _flags & IsRangeMarker; } bool is_skip() const { return _flags & IsSkip; } + bool is_skipping() const { return (_flags & IsSkip) && (_flags & IsSkipping); } bool matches (Flags f) const { return _flags & f; } Flags flags () const { return _flags; } diff --git a/libs/ardour/location.cc b/libs/ardour/location.cc index df65c5b341..6ce1b5f282 100644 --- a/libs/ardour/location.cc +++ b/libs/ardour/location.cc @@ -386,6 +386,17 @@ Location::set_skip (bool yn) } } +void +Location::set_skipping (bool yn) +{ + if (is_range_marker() && is_skip() && length() > 0) { + if (set_flag_internal (yn, IsSkipping)) { + flags_changed (this); + FlagsChanged (); + } + } +} + void Location::set_auto_punch (bool yn, void*) { diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 8139d260d1..2ca1c28cb8 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -1440,7 +1440,7 @@ Session::sync_locations_to_skips (Locations::LocationList& locations) location = *i; - if (location->is_skip()) { + if (location->is_skipping()) { SessionEvent* ev = new SessionEvent (SessionEvent::Skip, SessionEvent::Add, location->start(), location->end(), 1.0); queue_event (ev); }