13
0

Factor out stop limit computation into its own method. Ignore stop-at-session-end if there is a punch range and punch-in is enabled (#4022).

git-svn-id: svn://localhost/ardour2/branches/3.0@9457 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2011-05-02 22:21:59 +00:00
parent 988348185e
commit a4b1a1bb14
2 changed files with 16 additions and 34 deletions

View File

@ -253,7 +253,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
return (RecordState) g_atomic_int_get (&_record_status);
}
bool actively_recording () {
bool actively_recording () const {
return record_status() == Recording;
}
@ -1498,6 +1498,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
void end_time_changed (framepos_t);
void set_track_monitor_input_status (bool);
framepos_t compute_stop_limit () const;
boost::shared_ptr<Speakers> _speakers;
};

View File

@ -254,7 +254,6 @@ Session::process_with_events (pframes_t nframes)
pframes_t this_nframes;
framepos_t end_frame;
bool session_needs_butler = false;
framepos_t stop_limit;
framecnt_t frames_moved;
/* make sure the auditioner is silent */
@ -362,16 +361,7 @@ Session::process_with_events (pframes_t nframes)
send_midi_time_code_for_cycle (_transport_frame, end_frame, nframes);
}
if (actively_recording()) {
stop_limit = max_framepos;
} else {
if (Config->get_stop_at_session_end()) {
stop_limit = current_end_frame();
} else {
stop_limit = max_framepos;
}
}
framepos_t stop_limit = compute_stop_limit ();
if (maybe_stop (stop_limit)) {
no_roll (nframes);
@ -769,18 +759,7 @@ Session::follow_slave_silently (pframes_t nframes, float slave_speed)
increment_transport_position (frames_moved);
}
framepos_t stop_limit;
if (actively_recording()) {
stop_limit = max_framepos;
} else {
if (Config->get_stop_at_session_end()) {
stop_limit = current_end_frame();
} else {
stop_limit = max_framepos;
}
}
framepos_t const stop_limit = compute_stop_limit ();
maybe_stop (stop_limit);
}
}
@ -789,7 +768,6 @@ void
Session::process_without_events (pframes_t nframes)
{
bool session_needs_butler = false;
framepos_t stop_limit;
framecnt_t frames_moved;
if (!process_can_proceed()) {
@ -820,15 +798,7 @@ Session::process_without_events (pframes_t nframes)
send_midi_time_code_for_cycle (_transport_frame, _transport_frame + frames_moved, nframes);
}
if (actively_recording()) {
stop_limit = max_framepos;
} else {
if (Config->get_stop_at_session_end()) {
stop_limit = current_end_frame();
} else {
stop_limit = max_framepos;
}
}
framepos_t const stop_limit = compute_stop_limit ();
if (maybe_stop (stop_limit)) {
fail_roll (nframes);
@ -1174,3 +1144,14 @@ Session::process_event (SessionEvent* ev)
}
}
framepos_t
Session::compute_stop_limit () const
{
bool const punching = (config.get_punch_in () && _locations->auto_punch_location());
if (!actively_recording() && !punching && Config->get_stop_at_session_end()) {
return current_end_frame ();
}
return max_framepos;
}