summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2019-12-29 18:41:02 -0700
committerPaul Davis <paul@linuxaudiosystems.com>2019-12-29 18:43:51 -0700
commit719c3f1457501c1b808c9c6edf977e2b7d07e744 (patch)
tree5ca663c3c9f6504dcb8c0af82de17155f2d0f734
parentaf30a6f001f0758155b3ece040fc2baa643a29de (diff)
add Session::transport_stopped_or_stopping()
Session::TransportStateChanged notifies about transport stop before the stop is complete (i.e. at the start of the declick). Various other objects (notably control surfaces) connect to this signal and use it to modify their displayed state. We need a method that can tell them we are stopped (or stopping) even though we are not "fully" stopped yet. This is that method
-rw-r--r--libs/ardour/ardour/session.h1
-rw-r--r--libs/ardour/ardour/transport_fsm.h1
-rw-r--r--libs/ardour/session_transport.cc6
3 files changed, 8 insertions, 0 deletions
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index d71134db7e..6ba15929d5 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -764,6 +764,7 @@ public:
}
double transport_speed() const { return _count_in_samples > 0 ? 0. : _transport_speed; }
bool transport_stopped() const;
+ bool transport_stopped_or_stopping() const;
bool transport_rolling() const;
bool silent () { return _silent; }
diff --git a/libs/ardour/ardour/transport_fsm.h b/libs/ardour/ardour/transport_fsm.h
index 26ccb78765..12550d92a7 100644
--- a/libs/ardour/ardour/transport_fsm.h
+++ b/libs/ardour/ardour/transport_fsm.h
@@ -148,6 +148,7 @@ struct TransportFSM
bool locating () const { return _motion_state == WaitingForLocate; }
bool rolling () const { return _motion_state == Rolling; }
bool stopped () const { return _motion_state == Stopped; }
+ bool stopping () const { return _motion_state == DeclickToStop; }
bool waiting_for_butler() const { return _butler_state == WaitingForButler; }
bool declick_in_progress() const { return _motion_state == DeclickToLocate || _motion_state == DeclickToStop; }
diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc
index b6c5d64503..79ffb927bf 100644
--- a/libs/ardour/session_transport.cc
+++ b/libs/ardour/session_transport.cc
@@ -2001,6 +2001,12 @@ Session::transport_stopped() const
}
bool
+Session::transport_stopped_or_stopping() const
+{
+ return _transport_fsm->stopped() || _transport_fsm->stopping();
+}
+
+bool
Session::transport_rolling() const
{
return _transport_speed != 0.0 && _count_in_samples == 0 && _remaining_latency_preroll == 0;