From e46e6f12a33373e187e5ce97973cc4a30d073f40 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 29 Dec 2019 18:43:07 -0700 Subject: [PATCH] use new BasicUI and Session API to deal with transport state --- libs/surfaces/mackie/mackie_control_protocol.cc | 12 +++++++----- libs/surfaces/mackie/mcp_buttons.cc | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc index 0888065fa3..c975ede7c1 100644 --- a/libs/surfaces/mackie/mackie_control_protocol.cc +++ b/libs/surfaces/mackie/mackie_control_protocol.cc @@ -486,6 +486,8 @@ MackieControlProtocol::set_active (bool yn) redisplay_connection = redisplay_timeout->connect (sigc::mem_fun (*this, &MackieControlProtocol::redisplay)); redisplay_timeout->attach (main_loop()->get_context()); + notify_transport_state_changed (); + } else { BaseUI::quit (); @@ -1342,11 +1344,11 @@ MackieControlProtocol::notify_transport_state_changed() } // switch various play and stop buttons on / off - update_global_button (Button::Loop, session->get_play_loop()); - update_global_button (Button::Play, session->transport_speed() == 1.0); - update_global_button (Button::Stop, session->transport_stopped ()); - update_global_button (Button::Rewind, session->transport_speed() < 0.0); - update_global_button (Button::Ffwd, session->transport_speed() > 1.0); + update_global_button (Button::Loop, loop_button_onoff ()); + update_global_button (Button::Play, play_button_onoff ()); + update_global_button (Button::Stop, stop_button_onoff ()); + update_global_button (Button::Rewind, rewind_button_onoff ()); + update_global_button (Button::Ffwd, ffwd_button_onoff ()); // sometimes a return to start leaves time code at old time _timecode_last = string (10, ' '); diff --git a/libs/surfaces/mackie/mcp_buttons.cc b/libs/surfaces/mackie/mcp_buttons.cc index 663ff6c017..779bbbff2d 100644 --- a/libs/surfaces/mackie/mcp_buttons.cc +++ b/libs/surfaces/mackie/mcp_buttons.cc @@ -472,7 +472,7 @@ MackieControlProtocol::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; } @@ -501,7 +501,7 @@ MackieControlProtocol::stop_press (Button &) LedState MackieControlProtocol::stop_release (Button &) { - return session->transport_stopped(); + return session->transport_stopped_or_stopping(); } LedState