add Session::transport_stopped_or_stopping()
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 30 Dec 2019 01:41:02 +0000 (18:41 -0700)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 30 Dec 2019 01:43:51 +0000 (18:43 -0700)
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

libs/ardour/ardour/session.h
libs/ardour/ardour/transport_fsm.h
libs/ardour/session_transport.cc

index d71134db7e1ee569bb0dfb7c1138d354ca3245f6..6ba15929d50c2e554add39eb66b64edc2cce727c 100644 (file)
@@ -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; }
index 26ccb787657970330ac9ae02d5da9c3ee3ab1d54..12550d92a7ac81834088091139564924b80868c3 100644 (file)
@@ -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; }
 
index b6c5d645035849691cfda6fddede7180a93862b7..79ffb927bfb712063dad28859047969985054c11 100644 (file)
@@ -2000,6 +2000,12 @@ Session::transport_stopped() const
        return _transport_fsm->stopped();
 }
 
+bool
+Session::transport_stopped_or_stopping() const
+{
+       return _transport_fsm->stopped() || _transport_fsm->stopping();
+}
+
 bool
 Session::transport_rolling() const
 {