Replace BasicUI transport_rolling with transport_stopped_or_stopping

For consistency with the underlying Session API, and to avoid an unfortunate
soft-overload with Session::transport_rolling() that does something different.
This commit is contained in:
David Robillard 2021-06-15 23:13:34 -04:00
parent 3e101dd895
commit def143bc64
11 changed files with 21 additions and 21 deletions

View file

@ -632,7 +632,7 @@ ContourDesignControlProtocol::shuttle_event (int position)
if (position != 0) {
if (_shuttle_was_zero) {
_was_rolling_before_shuttle = transport_rolling ();
_was_rolling_before_shuttle = !transport_stopped_or_stopping ();
}
const vector<double>& spds = _shuttle_speeds;
const double speed = position > 0 ? spds[position-1] : -spds[-position-1];

View file

@ -336,7 +336,7 @@ BasicUI::transport_play (bool from_last_start)
return;
}
bool rolling = transport_rolling();
bool rolling = !transport_stopped_or_stopping();
if (_session->get_play_loop()) {
@ -440,10 +440,10 @@ BasicUI::get_transport_speed () const
return _session->actual_speed ();
}
double
BasicUI::transport_rolling () const
bool
BasicUI::transport_stopped_or_stopping () const
{
return !_session->transport_stopped_or_stopping ();
return _session->transport_stopped_or_stopping ();
}
bool
@ -652,7 +652,7 @@ BasicUI::toggle_roll (bool roll_out_of_bounded_mode)
}
}
bool rolling = transport_rolling();
bool rolling = !transport_stopped_or_stopping();
if (rolling) {

View file

@ -70,7 +70,7 @@ class LIBCONTROLCP_API BasicUI {
void set_transport_speed (double speed);
double get_transport_speed () const;
double transport_rolling () const;
bool transport_stopped_or_stopping () const;
bool get_play_loop () const;
void jump_by_seconds (double sec, LocateTransportDisposition ltd = RollIfAppropriate);

View file

@ -135,7 +135,7 @@ FaderPort8::setup_actions ()
void
FaderPort8::button_play ()
{
if (transport_rolling ()) {
if (!transport_stopped_or_stopping ()) {
if (get_transport_speed() != 1.0) {
_session->request_roll (TRS_UI);
} else {
@ -149,7 +149,7 @@ FaderPort8::button_play ()
void
FaderPort8::button_stop ()
{
if (transport_rolling ()) {
if (!transport_stopped_or_stopping ()) {
transport_stop ();
} else {
AccessAction ("Transport", "GotoStart");
@ -571,7 +571,7 @@ FaderPort8::button_encoder ()
* the current position and we're not rolling.
*/
samplepos_t where = _session->audible_sample();
if (_session->transport_stopped_or_stopping() && locations()->mark_at (timepos_t (where), timecnt_t (_session->sample_rate() / 100.0))) {
if (transport_stopped_or_stopping() && locations()->mark_at (timepos_t (where), timecnt_t (_session->sample_rate() / 100.0))) {
return;
}

View file

@ -485,7 +485,7 @@ MackieControlProtocol::marker_release (Button &)
samplepos_t where = _session->audible_sample();
if (_session->transport_stopped_or_stopping() && locations()->mark_at (timepos_t (where), timecnt_t (_session->sample_rate() / 100.0))) {
if (transport_stopped_or_stopping() && locations()->mark_at (timepos_t (where), timecnt_t (_session->sample_rate() / 100.0))) {
return off;
}
@ -514,7 +514,7 @@ MackieControlProtocol::stop_press (Button &)
LedState
MackieControlProtocol::stop_release (Button &)
{
return _session->transport_stopped_or_stopping();
return transport_stopped_or_stopping();
}
LedState

View file

@ -127,7 +127,7 @@ Maschine2::notify_record_state_changed ()
void
Maschine2::notify_transport_state_changed ()
{
if (transport_rolling ()) {
if (!transport_stopped_or_stopping ()) {
_ctrl->button (M2Contols::Play)->set_color (COLOR_WHITE);
} else {
_ctrl->button (M2Contols::Play)->set_color (0);
@ -198,7 +198,7 @@ Maschine2::notify_history_changed ()
void
Maschine2::button_play ()
{
if (transport_rolling ()) {
if (!transport_stopped_or_stopping ()) {
transport_stop ();
} else {
transport_play ();
@ -226,7 +226,7 @@ Maschine2::button_metronom ()
void
Maschine2::button_rewind ()
{
goto_start (transport_rolling ());
goto_start (!transport_stopped_or_stopping ());
}
void

View file

@ -1298,7 +1298,7 @@ OSC::osc_toggle_roll (bool ret2strt)
return 0;
}
bool rolling = transport_rolling();
bool rolling = !transport_stopped_or_stopping();
if (rolling) {
_session->request_stop (ret2strt, true);

View file

@ -418,7 +418,7 @@ OSCGlobalObserver::send_transport_state_changed()
_osc.float_message (X_("/loop_toggle"), _osc.get_play_loop(), addr);
_osc.float_message (X_("/transport_play"), session->actual_speed() == 1.0, addr);
_osc.float_message (X_("/toggle_roll"), session->actual_speed() == 1.0, addr);
_osc.float_message (X_("/transport_stop"), session->transport_stopped_or_stopping(), addr);
_osc.float_message (X_("/transport_stop"), _osc.transport_stopped_or_stopping(), addr);
_osc.float_message (X_("/rewind"), session->actual_speed() < 0.0, addr);
_osc.float_message (X_("/ffwd"), (session->actual_speed() != 1.0 && session->actual_speed() > 0.0), addr);
}

View file

@ -458,7 +458,7 @@ US2400Protocol::marker_release (Button &)
samplepos_t where = _session->audible_sample();
if (_session->transport_stopped_or_stopping() && locations()->mark_at (timepos_t (where), timecnt_t (_session->sample_rate() / 100.0))) {
if (transport_stopped_or_stopping() && locations()->mark_at (timepos_t (where), timecnt_t (_session->sample_rate() / 100.0))) {
return off;
}
@ -487,7 +487,7 @@ US2400Protocol::stop_press (Button &)
LedState
US2400Protocol::stop_release (Button &)
{
return _session->transport_stopped_or_stopping();
return transport_stopped_or_stopping();
}
LedState

View file

@ -55,7 +55,7 @@ ArdourTransport::time () const
bool
ArdourTransport::roll () const
{
return basic_ui ().transport_rolling ();
return !basic_ui ().transport_stopped_or_stopping ();
}
void

View file

@ -299,7 +299,7 @@ WiimoteControlProtocol::update_led_state ()
}
// enable LED1 if Ardour is playing
if (transport_rolling ()) {
if (!transport_stopped_or_stopping ()) {
DEBUG_TRACE (DEBUG::WiimoteControl, "WiimoteControlProtocol::update_led_state playing, activate LED1\n");
state |= CWIID_LED1_ON;
}