libardour infrastructure support for skip ranges that can be turned on and off

This commit is contained in:
Paul Davis 2014-09-21 17:38:11 -04:00
parent 12e7de3f48
commit 119c91813f
3 changed files with 15 additions and 1 deletions

View file

@ -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; }

View file

@ -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*)
{

View file

@ -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);
}