use new BasicUI and Session API to deal with transport state
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 30 Dec 2019 01:43:07 +0000 (18:43 -0700)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 30 Dec 2019 01:43:51 +0000 (18:43 -0700)
libs/surfaces/mackie/mackie_control_protocol.cc
libs/surfaces/mackie/mcp_buttons.cc

index 0888065fa3e1ffef061e3170adbc156b9bdc1c58..c975ede7c186ec694cdc4e1d2303404d9379871c 100644 (file)
@@ -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, ' ');
index 663ff6c0174e8cf0458d4c9c96652c9a35d72ae2..779bbbff2d11513edab5d9db7df10f0accc48589 100644 (file)
@@ -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