From 80c0400cda944aceff67e15d9a990b46edbc6a09 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 16 Sep 2014 21:32:58 -0400 Subject: [PATCH] initial attempt to push certain kinds of Locations into LocateRoll events on the timeline for skip lists --- libs/ardour/session.cc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index c371073863..e7dd6a9cd1 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -1295,6 +1295,7 @@ Session::set_auto_loop_location (Location* location) void Session::locations_added (Location *) { + _locations->apply (*this, &Session::sync_locations_to_skips); set_dirty (); } @@ -1330,6 +1331,8 @@ Session::handle_locations_changed (Locations::LocationList& locations) } } + sync_locations_to_skips (locations); + if (!set_loop) { set_auto_loop_location (0); } @@ -1340,6 +1343,25 @@ Session::handle_locations_changed (Locations::LocationList& locations) set_dirty(); } +void +Session::sync_locations_to_skips (Locations::LocationList& locations) +{ + Locations::LocationList::iterator i; + Location* location; + + clear_events (SessionEvent::LocateRoll); + + for (i = locations.begin(); i != locations.end(); ++i) { + + location = *i; + + if (location->is_range_marker()) { + SessionEvent* ev = new SessionEvent (SessionEvent::LocateRoll, SessionEvent::Add, location->start(), location->end(), 1.0); + queue_event (ev); + } + } +} + void Session::enable_record () {