From 52aa405ce3a35dcd01dcf3ae9f44ecb948d0485d Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 29 Dec 2019 18:43:37 -0700 Subject: [PATCH] use new Session API to deal with transport state Transition to use BasicUI button state API to come --- libs/surfaces/cc121/cc121.cc | 2 +- libs/surfaces/faderport/faderport.cc | 2 +- libs/surfaces/faderport8/actions.cc | 2 +- libs/surfaces/osc/osc_global_observer.cc | 2 +- libs/surfaces/us2400/mcp_buttons.cc | 4 ++-- libs/surfaces/us2400/us2400_control_protocol.cc | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libs/surfaces/cc121/cc121.cc b/libs/surfaces/cc121/cc121.cc index 6634a166a4..d04a88f5cd 100644 --- a/libs/surfaces/cc121/cc121.cc +++ b/libs/surfaces/cc121/cc121.cc @@ -680,7 +680,7 @@ CC121::map_transport_state () start_blinking (Play); } - get_button (Stop).set_led_state (_output_port, session->transport_stopped ()); + get_button (Stop).set_led_state (_output_port, session->transport_stopped_or_stopping ()); get_button (Rewind).set_led_state (_output_port, session->transport_speed() < 0.0); get_button (Ffwd).set_led_state (_output_port, session->transport_speed() > 1.0); get_button (Jog).set_led_state (_output_port, _jogmode == scroll); diff --git a/libs/surfaces/faderport/faderport.cc b/libs/surfaces/faderport/faderport.cc index e6be7fdac5..8f4954a3c2 100644 --- a/libs/surfaces/faderport/faderport.cc +++ b/libs/surfaces/faderport/faderport.cc @@ -718,7 +718,7 @@ FaderPort::map_transport_state () start_blinking (Play); } - get_button (Stop).set_led_state (_output_port, session->transport_stopped ()); + get_button (Stop).set_led_state (_output_port, session->transport_stopped_or_stopping ()); get_button (Rewind).set_led_state (_output_port, session->transport_speed() < 0.0); get_button (Ffwd).set_led_state (_output_port, session->transport_speed() > 1.0); } diff --git a/libs/surfaces/faderport8/actions.cc b/libs/surfaces/faderport8/actions.cc index b6b2e8de4f..27fdce1a66 100644 --- a/libs/surfaces/faderport8/actions.cc +++ b/libs/surfaces/faderport8/actions.cc @@ -588,7 +588,7 @@ FaderPort8::button_encoder () * the current position and we're not rolling. */ samplepos_t where = session->audible_sample(); - if (session->transport_stopped() && session->locations()->mark_at (where, session->sample_rate() / 100.0)) { + if (session->transport_stopped_or_stopping() && session->locations()->mark_at (where, session->sample_rate() / 100.0)) { return; } diff --git a/libs/surfaces/osc/osc_global_observer.cc b/libs/surfaces/osc/osc_global_observer.cc index 18c33ca9d5..d9d81c6ca8 100644 --- a/libs/surfaces/osc/osc_global_observer.cc +++ b/libs/surfaces/osc/osc_global_observer.cc @@ -415,7 +415,7 @@ OSCGlobalObserver::send_transport_state_changed() _osc.float_message (X_("/loop_toggle"), session->get_play_loop(), addr); _osc.float_message (X_("/transport_play"), session->transport_speed() == 1.0, addr); _osc.float_message (X_("/toggle_roll"), session->transport_speed() == 1.0, addr); - _osc.float_message (X_("/transport_stop"), session->transport_stopped(), addr); + _osc.float_message (X_("/transport_stop"), session->transport_stopped_or_stopping(), addr); _osc.float_message (X_("/rewind"), session->transport_speed() < 0.0, addr); _osc.float_message (X_("/ffwd"), (session->transport_speed() != 1.0 && session->transport_speed() > 0.0), addr); } diff --git a/libs/surfaces/us2400/mcp_buttons.cc b/libs/surfaces/us2400/mcp_buttons.cc index af0f268d1d..38657ef3aa 100644 --- a/libs/surfaces/us2400/mcp_buttons.cc +++ b/libs/surfaces/us2400/mcp_buttons.cc @@ -458,7 +458,7 @@ US2400Protocol::marker_release (Button &) samplepos_t where = session->audible_sample(); - if (session->transport_stopped() && session->locations()->mark_at (where, session->sample_rate() / 100.0)) { + if (session->transport_stopped_or_stopping() && session->locations()->mark_at (where, session->sample_rate() / 100.0)) { return off; } @@ -487,7 +487,7 @@ US2400Protocol::stop_press (Button &) LedState US2400Protocol::stop_release (Button &) { - return session->transport_stopped(); + return session->transport_stopped_or_stopping(); } LedState diff --git a/libs/surfaces/us2400/us2400_control_protocol.cc b/libs/surfaces/us2400/us2400_control_protocol.cc index 3deee55f41..1467d41770 100644 --- a/libs/surfaces/us2400/us2400_control_protocol.cc +++ b/libs/surfaces/us2400/us2400_control_protocol.cc @@ -1063,7 +1063,7 @@ US2400Protocol::notify_transport_state_changed() // switch various play and stop buttons on / off update_global_button (Button::Play, session->transport_speed() == 1.0); - update_global_button (Button::Stop, session->transport_stopped ()); + update_global_button (Button::Stop, session->transport_stopped_or_stopping ()); update_global_button (Button::Rewind, session->transport_speed() < 0.0); update_global_button (Button::Ffwd, session->transport_speed() > 1.0); -- 2.30.2