summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2019-12-29 18:43:07 -0700
committerPaul Davis <paul@linuxaudiosystems.com>2019-12-29 18:43:51 -0700
commite46e6f12a33373e187e5ce97973cc4a30d073f40 (patch)
tree6ded69b3c6487b385b3ccf2204f62b24f89ff34b
parenta8cc5b13031f7116cede2495db2a6f632bd0b81d (diff)
use new BasicUI and Session API to deal with transport state
-rw-r--r--libs/surfaces/mackie/mackie_control_protocol.cc12
-rw-r--r--libs/surfaces/mackie/mcp_buttons.cc4
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