mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-08 22:55:44 +01:00
libardour infrastructure support for skip ranges that can be turned on and off
This commit is contained in:
parent
12e7de3f48
commit
119c91813f
3 changed files with 15 additions and 1 deletions
|
|
@ -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; }
|
||||
|
|
|
|||
|
|
@ -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*)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue