From a48cddf235d4274536acdd877f454f3a6662780c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 16 Jun 2021 00:40:08 -0400 Subject: [PATCH] Add BasicUI::transport_rolling() Now this name directly corresponds to the session method it wraps. Towards removing the direct use of Session by surfaces. --- libs/surfaces/control_protocol/basic_ui.cc | 6 ++++++ libs/surfaces/control_protocol/control_protocol/basic_ui.h | 1 + libs/surfaces/launch_control_xl/launch_control_xl.cc | 2 +- libs/surfaces/push2/buttons.cc | 4 ++-- libs/surfaces/push2/push2.cc | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/libs/surfaces/control_protocol/basic_ui.cc b/libs/surfaces/control_protocol/basic_ui.cc index 942ab24b68..c0f1215860 100644 --- a/libs/surfaces/control_protocol/basic_ui.cc +++ b/libs/surfaces/control_protocol/basic_ui.cc @@ -440,6 +440,12 @@ BasicUI::get_transport_speed () const return _session->actual_speed (); } +bool +BasicUI::transport_rolling () const +{ + return _session->transport_rolling (); +} + bool BasicUI::transport_stopped_or_stopping () const { diff --git a/libs/surfaces/control_protocol/control_protocol/basic_ui.h b/libs/surfaces/control_protocol/control_protocol/basic_ui.h index 7be6e96031..27d227dbca 100644 --- a/libs/surfaces/control_protocol/control_protocol/basic_ui.h +++ b/libs/surfaces/control_protocol/control_protocol/basic_ui.h @@ -70,6 +70,7 @@ class LIBCONTROLCP_API BasicUI { void set_transport_speed (double speed); double get_transport_speed () const; + bool transport_rolling() const; bool transport_stopped_or_stopping () const; bool get_play_loop () const; diff --git a/libs/surfaces/launch_control_xl/launch_control_xl.cc b/libs/surfaces/launch_control_xl/launch_control_xl.cc index 6fb15c9bfa..8414ba7679 100644 --- a/libs/surfaces/launch_control_xl/launch_control_xl.cc +++ b/libs/surfaces/launch_control_xl/launch_control_xl.cc @@ -713,7 +713,7 @@ LaunchControlXL::notify_transport_state_changed () { /* Button* b = id_button_map[Play]; - if (_session->transport_rolling()) { + if (transport_rolling ()) { b->set_state (LED::OneShot24th); b->set_color (LED::GreenFull); } else { diff --git a/libs/surfaces/push2/buttons.cc b/libs/surfaces/push2/buttons.cc index 4932fae752..f5fa6ffe17 100644 --- a/libs/surfaces/push2/buttons.cc +++ b/libs/surfaces/push2/buttons.cc @@ -360,7 +360,7 @@ Push2::button_play () } if (_modifier_state & ModShift) { - goto_start (_session->transport_rolling()); + goto_start (transport_rolling ()); return; } @@ -375,7 +375,7 @@ Push2::button_play () return; } - if (_session->transport_rolling ()) { + if (transport_rolling ()) { transport_stop (); } else { transport_play (); diff --git a/libs/surfaces/push2/push2.cc b/libs/surfaces/push2/push2.cc index 579963c555..56540ca420 100644 --- a/libs/surfaces/push2/push2.cc +++ b/libs/surfaces/push2/push2.cc @@ -909,7 +909,7 @@ Push2::notify_transport_state_changed () { boost::shared_ptr