Match API: add rt_context option for en/disable_record()

This allows to call maybe_enable_record () from Lua session or DSP scripts
This commit is contained in:
Robin Gareus 2017-01-02 00:26:21 +01:00
parent f1abc95927
commit e3050d144a
2 changed files with 10 additions and 7 deletions

View File

@ -349,7 +349,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
}
bool record_enabling_legal () const;
void maybe_enable_record ();
void maybe_enable_record (bool rt_context = false);
void disable_record (bool rt_context, bool force = false);
void step_back_from_record ();

View File

@ -2015,7 +2015,7 @@ Session::step_back_from_record ()
}
void
Session::maybe_enable_record ()
Session::maybe_enable_record (bool rt_context)
{
if (_step_editors > 0) {
return;
@ -2024,12 +2024,15 @@ Session::maybe_enable_record ()
g_atomic_int_set (&_record_status, Enabled);
/* This function is currently called from somewhere other than an RT thread.
This save_state() call therefore doesn't impact anything. Doing it here
means that we save pending state of which sources the next record will use,
which gives us some chance of recovering from a crash during the record.
*/
* (except maybe lua scripts, which can use rt_context = true)
* This save_state() call therefore doesn't impact anything. Doing it here
* means that we save pending state of which sources the next record will use,
* which gives us some chance of recovering from a crash during the record.
*/
save_state ("", true);
if (!rt_context) {
save_state ("", true);
}
if (_transport_speed) {
if (!config.get_punch_in()) {