provide new methods for BasicUI that wrap the "complexity" of how to show transport state via lit buttons

This commit is contained in:
Paul Davis
2019-12-29 18:42:34 -07:00
parent 6383d4f6a6
commit a8cc5b1303
2 changed files with 37 additions and 1 deletions

View File

@@ -188,7 +188,7 @@ BasicUI::remove_marker_at_playhead ()
void
BasicUI::rewind ()
{
session->request_transport_speed (session->transport_speed() - 1.5);
session->request_transport_speed (session->actual_speed() - 1.5);
}
void
@@ -203,6 +203,36 @@ BasicUI::transport_stop ()
session->request_transport_speed (0.0);
}
bool
BasicUI::stop_button_onoff () const
{
return session->transport_stopped_or_stopping ();
}
bool
BasicUI::play_button_onoff () const
{
return session->actual_speed() == 1.0;
}
bool
BasicUI::ffwd_button_onoff () const
{
return session->actual_speed() > 1.0;
}
bool
BasicUI::rewind_button_onoff () const
{
return session->actual_speed() < 0.0;
}
bool
BasicUI::loop_button_onoff () const
{
return session->get_play_loop();
}
void
BasicUI::transport_play (bool from_last_start)
{