summaryrefslogtreecommitdiff
path: root/libs/ardour/transport_fsm.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2019-11-15 15:51:58 -0700
committerPaul Davis <paul@linuxaudiosystems.com>2019-11-15 16:06:04 -0700
commita7613eb191f205788b4b7f0db21a391ca61e8d59 (patch)
treeb4c2cb8ec417c9e84aef5d0f7b0083189472ad08 /libs/ardour/transport_fsm.cc
parent4c688fe7f98ac8922afd9ea5a1d00857774a79c1 (diff)
consolidate setting of "get roll after locate" in TFSM
Diffstat (limited to 'libs/ardour/transport_fsm.cc')
-rw-r--r--libs/ardour/transport_fsm.cc27
1 files changed, 15 insertions, 12 deletions
diff --git a/libs/ardour/transport_fsm.cc b/libs/ardour/transport_fsm.cc
index 1905fdac86..d9d934597e 100644
--- a/libs/ardour/transport_fsm.cc
+++ b/libs/ardour/transport_fsm.cc
@@ -384,22 +384,24 @@ TransportFSM::start_declick_for_stop (Event const & s)
}
void
+TransportFSM::set_roll_after (bool with_roll) const
+{
+ if (with_roll == true) {
+ current_roll_after_locate_status = true;
+ } else if (with_roll == false) {
+ current_roll_after_locate_status = false;
+ }
+}
+
+void
TransportFSM::start_declick_for_locate (Event const & l)
{
assert (l.type == Locate);
- DEBUG_TRACE (DEBUG::TFSMEvents, "start_declick_for_locate\n");
+ DEBUG_TRACE (DEBUG::TFSMEvents, string_compose ("start_declick_for_locate, crals %1 with_roll %2 speed %3 sral %4\n", (bool) current_roll_after_locate_status, l.with_roll, api->speed(), api->should_roll_after_locate()));
_last_locate = l;
if (!current_roll_after_locate_status) {
- if (l.with_roll) {
- if (api->speed() != 0.) {
- current_roll_after_locate_status = true;
- } else {
- current_roll_after_locate_status = api->should_roll_after_locate();
- }
- } else {
- current_roll_after_locate_status = (api->speed() != 0.);
- }
+ set_roll_after (l.with_roll);
}
_last_stop = Event (StopTransport, false, false);
@@ -411,7 +413,8 @@ TransportFSM::start_locate_while_stopped (Event const & l) const
assert (l.type == Locate);
DEBUG_TRACE (DEBUG::TFSMEvents, "start_locate_while_stopped\n");
- current_roll_after_locate_status = l.with_roll ? true : api->should_roll_after_locate();
+ set_roll_after (l.with_roll);
+
api->locate (l.target, current_roll_after_locate_status.get(), l.with_flush, l.with_loop, l.force);
}
@@ -420,7 +423,7 @@ TransportFSM::locate_for_loop (Event const & l)
{
assert (l.type == Locate);
DEBUG_TRACE (DEBUG::TFSMEvents, string_compose ("locate_for_loop, wl = %1\n", l.with_loop));
- current_roll_after_locate_status = l.with_roll;
+ set_roll_after (l.with_roll);
_last_locate = l;
api->locate (l.target, l.with_roll, l.with_flush, l.with_loop, l.force);
}