From: Paul Davis Date: Tue, 9 Aug 2011 21:17:55 +0000 (+0000) Subject: attempt to prevent dropping into record if rolling in reverse (should fix #4254) X-Git-Tag: 3.0-alpha10~28 X-Git-Url: https://git.carlh.net/gitweb/?a=commitdiff_plain;h=db78ba19fff5bfeebe662ccc8bf5ef41d0b41b60;p=ardour.git attempt to prevent dropping into record if rolling in reverse (should fix #4254) git-svn-id: svn://localhost/ardour2/branches/3.0@9971 d708f5d6-7413-0410-9779-e7cbd77b26cf --- diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 2be3af3c0f..631a20aac7 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -985,13 +985,18 @@ Session::handle_locations_changed (Locations::LocationList& locations) void Session::enable_record () { + if (_transport_speed < 0.0) { + /* no recording in reverse */ + return; + } + while (1) { RecordState rs = (RecordState) g_atomic_int_get (&_record_status); if (rs == Recording) { break; } - + if (g_atomic_int_compare_and_exchange (&_record_status, rs, Recording)) { _last_record_location = _transport_frame; diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc index 5fc073d93e..ca6b4da319 100644 --- a/libs/ardour/session_transport.cc +++ b/libs/ardour/session_transport.cc @@ -958,6 +958,11 @@ Session::set_transport_speed (double speed, bool abort, bool clear_state) return; } + if (actively_recording() && speed < 0.0) { + /* no reverse during recording */ + return; + } + _target_transport_speed = fabs(speed); /* 8.0 max speed is somewhat arbitrary but based on guestimates regarding disk i/o capability