summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorBen Loftis <ben@harrisonconsoles.com>2020-02-23 08:49:40 -0600
committerBen Loftis <ben@harrisonconsoles.com>2020-02-23 09:02:25 -0600
commit3e77680a57ee28571ec5558845df2ad82246741a (patch)
tree9c61e27c16296fddc998505997db424ff23ea6c6 /libs
parent276baee8ad4931b62613aa38f214ade45072ecf5 (diff)
surfaces transport hotfix: surfaces should query the transport state via BasicUI, when possible
Diffstat (limited to 'libs')
-rw-r--r--libs/surfaces/cc121/cc121.cc2
-rw-r--r--libs/surfaces/contourdesign/contourdesign.cc2
-rw-r--r--libs/surfaces/faderport/faderport.cc2
-rw-r--r--libs/surfaces/faderport8/actions.cc14
-rw-r--r--libs/surfaces/faderport8/callbacks.cc11
-rw-r--r--libs/surfaces/frontier/tranzport/tranzport_control_protocol.cc8
-rw-r--r--libs/surfaces/mackie/mcp_buttons.cc4
-rw-r--r--libs/surfaces/maschine2/callbacks.cc6
-rw-r--r--libs/surfaces/osc/osc.cc2
-rw-r--r--libs/surfaces/tranzport/button_events.cc2
-rw-r--r--libs/surfaces/tranzport/show.cc4
-rw-r--r--libs/surfaces/tranzport/wheel.cc8
-rw-r--r--libs/surfaces/tranzport/wheel_modes.cc4
-rw-r--r--libs/surfaces/us2400/mcp_buttons.cc4
-rw-r--r--libs/surfaces/wiimote/wiimote.cc2
15 files changed, 35 insertions, 40 deletions
diff --git a/libs/surfaces/cc121/cc121.cc b/libs/surfaces/cc121/cc121.cc
index 06b5d26334..96d32fa65e 100644
--- a/libs/surfaces/cc121/cc121.cc
+++ b/libs/surfaces/cc121/cc121.cc
@@ -669,7 +669,7 @@ CC121::map_transport_state ()
{
get_button (Loop).set_led_state (_output_port, session->get_play_loop());
- float ts = session->transport_speed();
+ float ts = get_transport_speed();
if (ts == 0) {
stop_blinking (Play);
diff --git a/libs/surfaces/contourdesign/contourdesign.cc b/libs/surfaces/contourdesign/contourdesign.cc
index cceb605104..d53403b454 100644
--- a/libs/surfaces/contourdesign/contourdesign.cc
+++ b/libs/surfaces/contourdesign/contourdesign.cc
@@ -627,7 +627,7 @@ ContourDesignControlProtocol::shuttle_event (int position)
if (position != 0) {
if (_shuttle_was_zero) {
- _was_rolling_before_shuttle = session->transport_rolling ();
+ _was_rolling_before_shuttle = transport_rolling ();
}
const vector<double>& spds = _shuttle_speeds;
const double speed = position > 0 ? spds[position-1] : -spds[-position-1];
diff --git a/libs/surfaces/faderport/faderport.cc b/libs/surfaces/faderport/faderport.cc
index b3ed8214d1..eaed7bee1f 100644
--- a/libs/surfaces/faderport/faderport.cc
+++ b/libs/surfaces/faderport/faderport.cc
@@ -685,7 +685,7 @@ FaderPort::map_transport_state ()
{
get_button (Loop).set_led_state (_output_port, session->get_play_loop());
- float ts = session->transport_speed();
+ float ts = get_transport_speed();
if (ts == 0) {
stop_blinking (Play);
diff --git a/libs/surfaces/faderport8/actions.cc b/libs/surfaces/faderport8/actions.cc
index 69ac03a90a..2e6b5c7b00 100644
--- a/libs/surfaces/faderport8/actions.cc
+++ b/libs/surfaces/faderport8/actions.cc
@@ -135,8 +135,8 @@ FaderPort8::setup_actions ()
void
FaderPort8::button_play ()
{
- if (session->transport_rolling ()) {
- if (session->transport_speed () != 1.0) {
+ if (transport_rolling ()) {
+ if (get_transport_speed() != 1.0) {
session->request_transport_speed (1.0);
} else {
transport_stop ();
@@ -149,7 +149,7 @@ FaderPort8::button_play ()
void
FaderPort8::button_stop ()
{
- if (session->transport_rolling ()) {
+ if (transport_rolling ()) {
transport_stop ();
} else {
AccessAction ("Transport", "GotoStart");
@@ -315,20 +315,20 @@ FaderPort8::button_varispeed (bool ffw)
// switch play direction, if needed
if (ffw) {
- if (session->transport_speed () <= 0) {
+ if (get_transport_speed() <= 0) {
session->request_transport_speed (1.0);
return ;
}
} else {
- if (session->transport_speed () >= 0) {
+ if (get_transport_speed() >= 0) {
session->request_transport_speed (-1.0);
return ;
}
}
- // incremetally increase speed. double speed every 10 clicks
+ // incrementally increase speed by semitones
// (keypress auto-repeat is 100ms)
float maxspeed = Config->get_shuttle_max_speed();
- float speed = exp2f(0.1f) * session->transport_speed ();
+ float speed = exp2f(1.0/12.0) * get_transport_speed();
speed = std::max (-maxspeed, std::min (maxspeed, speed));
session->request_transport_speed (speed, false);
}
diff --git a/libs/surfaces/faderport8/callbacks.cc b/libs/surfaces/faderport8/callbacks.cc
index 185f5dd4ef..aa38578fea 100644
--- a/libs/surfaces/faderport8/callbacks.cc
+++ b/libs/surfaces/faderport8/callbacks.cc
@@ -125,16 +125,11 @@ FaderPort8::notify_parameter_changed (std::string param)
void
FaderPort8::notify_transport_state_changed ()
{
- if (session->transport_rolling ()) {
- _ctrls.button (FP8Controls::BtnPlay).set_active (true);
- _ctrls.button (FP8Controls::BtnStop).set_active (false);
- } else {
- _ctrls.button (FP8Controls::BtnPlay).set_active (false);
- _ctrls.button (FP8Controls::BtnStop).set_active (true);
- }
+ _ctrls.button (FP8Controls::BtnPlay).set_active (get_transport_speed()==1.0);
+ _ctrls.button (FP8Controls::BtnStop).set_active (get_transport_speed()==0.0);
/* set rewind/fastforward lights */
- const float ts = session->transport_speed ();
+ const float ts = get_transport_speed();
FP8ButtonInterface& b_rew = _ctrls.button (FP8Controls::BtnRewind);
FP8ButtonInterface& b_ffw = _ctrls.button (FP8Controls::BtnFastForward);
diff --git a/libs/surfaces/frontier/tranzport/tranzport_control_protocol.cc b/libs/surfaces/frontier/tranzport/tranzport_control_protocol.cc
index f3256c8852..a55b718415 100644
--- a/libs/surfaces/frontier/tranzport/tranzport_control_protocol.cc
+++ b/libs/surfaces/frontier/tranzport/tranzport_control_protocol.cc
@@ -1706,16 +1706,16 @@ void
TranzportControlProtocol::shuttle ()
{
if (_datawheel < WheelDirectionThreshold) {
- if (session->transport_speed() < 0) {
+ if (get_transport_speed() < 0) {
session->request_transport_speed (1.0);
} else {
- session->request_transport_speed_nonzero (session->transport_speed() + 0.1);
+ session->request_transport_speed_nonzero (get_transport_speed() + 0.1);
}
} else {
- if (session->transport_speed() > 0) {
+ if (get_transport_speed() > 0) {
session->request_transport_speed (-1.0);
} else {
- session->request_transport_speed_nonzero (session->transport_speed() - 0.1);
+ session->request_transport_speed_nonzero (get_transport_speed() - 0.1);
}
}
}
diff --git a/libs/surfaces/mackie/mcp_buttons.cc b/libs/surfaces/mackie/mcp_buttons.cc
index 779bbbff2d..23ea77c94a 100644
--- a/libs/surfaces/mackie/mcp_buttons.cc
+++ b/libs/surfaces/mackie/mcp_buttons.cc
@@ -511,7 +511,7 @@ MackieControlProtocol::play_press (Button &)
again, jump back to where we started last time
*/
- transport_play (session->transport_speed() == 1.0);
+ transport_play (get_transport_speed() == 1.0);
return none;
}
@@ -823,7 +823,7 @@ MackieControlProtocol::cancel_release (Button &)
LedState
MackieControlProtocol::user_a_press (Button &)
{
- transport_play (session->transport_speed() == 1.0);
+ transport_play (get_transport_speed() == 1.0);
return off;
}
LedState
diff --git a/libs/surfaces/maschine2/callbacks.cc b/libs/surfaces/maschine2/callbacks.cc
index 815322517e..27945aa05e 100644
--- a/libs/surfaces/maschine2/callbacks.cc
+++ b/libs/surfaces/maschine2/callbacks.cc
@@ -127,7 +127,7 @@ Maschine2::notify_record_state_changed ()
void
Maschine2::notify_transport_state_changed ()
{
- if (session->transport_rolling ()) {
+ if (transport_rolling ()) {
_ctrl->button (M2Contols::Play)->set_color (COLOR_WHITE);
} else {
_ctrl->button (M2Contols::Play)->set_color (0);
@@ -198,7 +198,7 @@ Maschine2::notify_history_changed ()
void
Maschine2::button_play ()
{
- if (session->transport_rolling ()) {
+ if (transport_rolling ()) {
transport_stop ();
} else {
transport_play ();
@@ -226,7 +226,7 @@ Maschine2::button_metronom ()
void
Maschine2::button_rewind ()
{
- goto_start (session->transport_rolling ());
+ goto_start (transport_rolling ());
}
void
diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc
index 5e336e653d..4daf6dd6f9 100644
--- a/libs/surfaces/osc/osc.cc
+++ b/libs/surfaces/osc/osc.cc
@@ -3182,7 +3182,7 @@ OSC::transport_speed (lo_message msg)
return;
}
check_surface (msg);
- double ts = session->transport_speed ();
+ double ts = get_transport_speed();
lo_message reply = lo_message_new ();
lo_message_add_double (reply, ts);
diff --git a/libs/surfaces/tranzport/button_events.cc b/libs/surfaces/tranzport/button_events.cc
index bac2a218e5..eeb16d702a 100644
--- a/libs/surfaces/tranzport/button_events.cc
+++ b/libs/surfaces/tranzport/button_events.cc
@@ -359,7 +359,7 @@ TranzportControlProtocol::button_event_footswitch_press (bool shifted)
void
TranzportControlProtocol::button_event_footswitch_release (bool shifted)
{
- if(session->transport_speed() == 0.0)
+ if(get_transport_speed() == 0.0)
{
transport_play ();
}
diff --git a/libs/surfaces/tranzport/show.cc b/libs/surfaces/tranzport/show.cc
index 027485b944..bf302add9e 100644
--- a/libs/surfaces/tranzport/show.cc
+++ b/libs/surfaces/tranzport/show.cc
@@ -120,7 +120,7 @@ void TranzportControlProtocol::show_mini_meter()
static uint32_t last_meter_fill_r = 0;
uint32_t meter_size;
- float speed = fabsf(session->transport_speed());
+ float speed = fabsf(get_transport_speed());
char buf[meter_buf_size];
if (speed == 1.0) {
@@ -301,7 +301,7 @@ TranzportControlProtocol::show_bbt (samplepos_t where)
last_ticks = bbt.ticks;
last_where = where;
- float speed = fabsf(session->transport_speed());
+ float speed = fabsf(get_transport_speed());
if (speed == 1.0) {
sprintf (buf, "%03" PRIu32 "%1" PRIu32, bbt.bars,bbt.beats); // switch to hex one day
diff --git a/libs/surfaces/tranzport/wheel.cc b/libs/surfaces/tranzport/wheel.cc
index 00a66f9943..6d86f76733 100644
--- a/libs/surfaces/tranzport/wheel.cc
+++ b/libs/surfaces/tranzport/wheel.cc
@@ -187,16 +187,16 @@ void
TranzportControlProtocol::shuttle ()
{
if (_datawheel < WheelDirectionThreshold) {
- if (session->transport_speed() < 0) {
+ if (get_transport_speed() < 0) {
session->request_transport_speed (1.0);
} else {
- session->request_transport_speed_nonzero (session->transport_speed() + 0.1);
+ session->request_transport_speed_nonzero (get_transport_speed() + 0.1);
}
} else {
- if (session->transport_speed() > 0) {
+ if (session->get_transport_speed() > 0) {
session->request_transport_speed (-1.0);
} else {
- session->request_transport_speed_nonzero (session->transport_speed() - 0.1);
+ session->request_transport_speed_nonzero (get_transport_speed() - 0.1);
}
}
}
diff --git a/libs/surfaces/tranzport/wheel_modes.cc b/libs/surfaces/tranzport/wheel_modes.cc
index 1882ad534c..f235c1f348 100644
--- a/libs/surfaces/tranzport/wheel_modes.cc
+++ b/libs/surfaces/tranzport/wheel_modes.cc
@@ -95,11 +95,11 @@ TranzportControlProtocol::show_wheel_mode ()
{
string text;
- // if(session->transport_speed() != 0) {
+ // if(get_transport_speed() != 0) {
// if session-transport_speed() < 1.0) show_big_bar/beat
// if ? greater. dont
- if(session->transport_speed() != 0) {
+ if(get_transport_speed() != 0) {
show_mini_meter();
} else {
diff --git a/libs/surfaces/us2400/mcp_buttons.cc b/libs/surfaces/us2400/mcp_buttons.cc
index 38657ef3aa..c5331bff24 100644
--- a/libs/surfaces/us2400/mcp_buttons.cc
+++ b/libs/surfaces/us2400/mcp_buttons.cc
@@ -497,7 +497,7 @@ US2400Protocol::play_press (Button &)
again, jump back to where we started last time
*/
- transport_play (session->transport_speed() == 1.0);
+ transport_play (get_transport_speed() == 1.0);
return none;
}
@@ -821,7 +821,7 @@ US2400Protocol::cancel_release (Button &)
LedState
US2400Protocol::user_a_press (Button &)
{
- transport_play (session->transport_speed() == 1.0);
+ transport_play (get_transport_speed() == 1.0);
return off;
}
LedState
diff --git a/libs/surfaces/wiimote/wiimote.cc b/libs/surfaces/wiimote/wiimote.cc
index 08be28aba4..7a14e146ae 100644
--- a/libs/surfaces/wiimote/wiimote.cc
+++ b/libs/surfaces/wiimote/wiimote.cc
@@ -299,7 +299,7 @@ WiimoteControlProtocol::update_led_state ()
}
// enable LED1 if Ardour is playing
- if (session->transport_rolling ()) {
+ if (transport_rolling ()) {
DEBUG_TRACE (DEBUG::WiimoteControl, "WiimoteControlProtocol::update_led_state playing, activate LED1\n");
state |= CWIID_LED1_ON;
}