13
0

Fix auto-return, hopefully not at the expense of anything else.

git-svn-id: svn://localhost/ardour2/branches/3.0@4482 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2009-02-02 22:35:50 +00:00
parent 54afc94e62
commit 762b02bc95
7 changed files with 7 additions and 29 deletions

View File

@ -234,9 +234,7 @@ Editor::update_current_screen ()
{
if (session && session->engine().running()) {
nframes64_t frame;
frame = session->audible_frame();
nframes64_t const frame = session->audible_frame();
if (_dragging_playhead) {
goto almost_done;

View File

@ -1024,7 +1024,6 @@ class Session : public PBD::StatefulDestructible
bool auto_play_legal;
nframes_t _last_slave_transport_frame;
nframes_t maximum_output_latency;
nframes_t last_stop_frame;
volatile nframes64_t _requested_return_frame;
BufferSet* _scratch_buffers;
BufferSet* _silent_buffers;

View File

@ -1209,10 +1209,6 @@ Session::audible_frame () const
nframes_t offset;
nframes_t tf;
if (_transport_speed == 0.0f && non_realtime_work_pending()) {
return last_stop_frame;
}
/* the first of these two possible settings for "offset"
mean that the audible frame is stationary until
audio emerges from the latency compensation
@ -1259,7 +1255,6 @@ Session::audible_frame () const
if (!play_loop || !have_looped) {
if (tf < _last_roll_location + offset) {
return _last_roll_location;
}
}

View File

@ -355,7 +355,6 @@ Session::process_event (Event* ev)
case Event::LocateRollLocate:
// locate is handled by ::request_roll_at_and_return()
_requested_return_frame = ev->target_frame;
cerr << "Set RRF " << ev->target_frame << endl;
request_locate (ev->target2_frame, true);
break;

View File

@ -733,10 +733,6 @@ Session::track_slave_state(
<< " tf = " << _transport_frame << endl;
#endif
if (Config->get_slave_source() == JACK) {
last_stop_frame = _transport_frame;
}
stop_transport();
}

View File

@ -161,7 +161,6 @@ Session::first_stage_init (string fullpath, string snapshot_name)
auto_play_legal = false;
transport_sub_state = 0;
_transport_frame = 0;
last_stop_frame = 0;
end_location = new Location (0, 0, _("end"), Location::Flags ((Location::IsMark|Location::IsEnd)));
start_location = new Location (0, 0, _("start"), Location::Flags ((Location::IsMark|Location::IsStart)));
_end_location_is_free = true;

View File

@ -390,7 +390,10 @@ Session::non_realtime_stop (bool abort, int on_entry, bool& finished)
update_latency_compensation (true, abort);
}
if ((Config->get_slave_source() == None && Config->get_auto_return()) ||
bool const auto_return_enabled =
(Config->get_slave_source() == None && Config->get_auto_return());
if (auto_return_enabled ||
(post_transport_work & PostTransportLocate) ||
(_requested_return_frame >= 0) ||
synced_to_jack()) {
@ -399,9 +402,7 @@ Session::non_realtime_stop (bool abort, int on_entry, bool& finished)
flush_all_inserts ();
}
if (((Config->get_slave_source() == None && Config->get_auto_return()) ||
synced_to_jack() ||
_requested_return_frame >= 0) &&
if ((auto_return_enabled || synced_to_jack() || _requested_return_frame >= 0) &&
!(post_transport_work & PostTransportLocate)) {
bool do_locate = false;
@ -411,8 +412,7 @@ Session::non_realtime_stop (bool abort, int on_entry, bool& finished)
_requested_return_frame = -1;
do_locate = true;
} else {
_transport_frame = last_stop_frame;
_requested_return_frame = -1;
_transport_frame = _last_roll_location;
}
if (synced_to_jack() && !play_loop) {
@ -444,13 +444,6 @@ Session::non_realtime_stop (bool abort, int on_entry, bool& finished)
}
#endif
if (_requested_return_frame < 0) {
last_stop_frame = _transport_frame;
} else {
last_stop_frame = _requested_return_frame;
_requested_return_frame = -1;
}
have_looped = false;
send_full_time_code (0);
@ -896,7 +889,6 @@ Session::set_transport_speed (double speed, bool abort)
if ((_transport_speed && speed * _transport_speed < 0.0) || (_last_transport_speed * speed < 0.0) || (_last_transport_speed == 0.0f && speed < 0.0f)) {
post_transport_work = PostTransportWork (post_transport_work | PostTransportReverse);
last_stop_frame = _transport_frame;
}
_last_transport_speed = _transport_speed;