diff options
author | Robin Gareus <robin@gareus.org> | 2017-01-02 00:26:21 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-01-02 00:26:21 +0100 |
commit | e3050d144abde891e10a1ef15f68691d72623d7d (patch) | |
tree | 2d469d126b0651893f1c3d11ffe4273bcbe6210d /libs/ardour/session.cc | |
parent | f1abc959272c8359f00043dec4a36f7f0e6016e8 (diff) |
Match API: add rt_context option for en/disable_record()
This allows to call maybe_enable_record () from Lua session or DSP scripts
Diffstat (limited to 'libs/ardour/session.cc')
-rw-r--r-- | libs/ardour/session.cc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index c373539ad6..acde864009 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -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()) { |