- boost::shared_ptr<RouteList> rl = routes.reader();
- for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
- boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (*i);
- if (tr && tr->record_enabled ()) {
- // tell it we've looped, so it can deal with the record state
- tr->transport_looped(_transport_frame);
+ // located outside the loop: cancel looping directly, this is called from event handling context
+
+ set_play_loop (false);
+
+ } else if (_transport_frame == al->start()) {
+
+ // located to start of loop - this is looping, basically
+
+ if (for_seamless_loop) {
+
+ // this is only necessary for seamless looping
+
+ boost::shared_ptr<RouteList> rl = routes.reader();
+
+ for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
+ boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (*i);
+
+ if (tr && tr->record_enabled ()) {
+ // tell it we've looped, so it can deal with the record state
+ tr->transport_looped (_transport_frame);
+ }