mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 07:45:00 +01:00
part 1 of replicating semantics of ARDOUR_UI::toggle_roll() in BasicUI::toggle_roll()
This can be done better, even without sharing code
This commit is contained in:
parent
3e443bc237
commit
7b25a89944
2 changed files with 62 additions and 6 deletions
|
|
@ -29,6 +29,7 @@
|
||||||
#include "ardour/session.h"
|
#include "ardour/session.h"
|
||||||
#include "ardour/location.h"
|
#include "ardour/location.h"
|
||||||
#include "ardour/tempo.h"
|
#include "ardour/tempo.h"
|
||||||
|
#include "ardour/transport_master_manager.h"
|
||||||
#include "ardour/utils.h"
|
#include "ardour/utils.h"
|
||||||
|
|
||||||
#include "control_protocol/basic_ui.h"
|
#include "control_protocol/basic_ui.h"
|
||||||
|
|
@ -205,6 +206,8 @@ BasicUI::transport_stop ()
|
||||||
void
|
void
|
||||||
BasicUI::transport_play (bool from_last_start)
|
BasicUI::transport_play (bool from_last_start)
|
||||||
{
|
{
|
||||||
|
/* ::toggle_roll() is smarter and preferred */
|
||||||
|
|
||||||
if (!session) {
|
if (!session) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -486,12 +489,65 @@ BasicUI::toggle_click ()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
BasicUI::toggle_roll ()
|
BasicUI::toggle_roll (bool roll_out_of_bounded_mode)
|
||||||
{
|
{
|
||||||
if (session->transport_rolling()) {
|
/* TO BE KEPT IN SYNC WITH ARDOUR_UI::toggle_roll() */
|
||||||
transport_stop ();
|
|
||||||
} else {
|
if (!session) {
|
||||||
transport_play (false);
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (session->is_auditioning()) {
|
||||||
|
session->cancel_audition ();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (session->config.get_external_sync()) {
|
||||||
|
switch (TransportMasterManager::instance().current()->type()) {
|
||||||
|
case Engine:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
/* transport controlled by the master */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool rolling = session->transport_rolling();
|
||||||
|
|
||||||
|
if (rolling) {
|
||||||
|
|
||||||
|
if (roll_out_of_bounded_mode) {
|
||||||
|
/* drop out of loop/range playback but leave transport rolling */
|
||||||
|
|
||||||
|
if (session->get_play_loop()) {
|
||||||
|
|
||||||
|
if (session->actively_recording()) {
|
||||||
|
/* actually stop transport because
|
||||||
|
otherwise the captured data will make
|
||||||
|
no sense.
|
||||||
|
*/
|
||||||
|
session->request_play_loop (false, true);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
session->request_play_loop (false, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (session->get_play_range ()) {
|
||||||
|
|
||||||
|
session->request_cancel_play_range ();
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
session->request_stop (true, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else { /* not rolling */
|
||||||
|
|
||||||
|
if (session->get_play_loop() && Config->get_loop_is_mode()) {
|
||||||
|
session->request_locate (session->locations()->auto_loop_location()->start(), true);
|
||||||
|
} else {
|
||||||
|
session->request_transport_speed (1.0f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,7 @@ class LIBCONTROLCP_API BasicUI {
|
||||||
void quick_snapshot_stay ();
|
void quick_snapshot_stay ();
|
||||||
void quick_snapshot_switch ();
|
void quick_snapshot_switch ();
|
||||||
|
|
||||||
void toggle_roll(); //this provides the same operation as the "spacebar", it's a lot smarter than "play".
|
void toggle_roll(bool roll_out_of_bounded_mode=true); //this provides the same operation as the "spacebar", it's a lot smarter than "play".
|
||||||
|
|
||||||
void stop_forget();
|
void stop_forget();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue