summaryrefslogtreecommitdiff
path: root/libs/ardour/session_process.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2006-08-31 13:23:43 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2006-08-31 13:23:43 +0000
commit21d85f1854461ab6209d23e278fe289505cd106c (patch)
tree0c6d154757bcfb6c49223e59fc75a433e8e79bb2 /libs/ardour/session_process.cc
parentdde980289aaf264863186eead99fd98a67cc6862 (diff)
merge changes from harrison branch back into trunk, by hand
git-svn-id: svn://localhost/ardour2/trunk@878 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/session_process.cc')
-rw-r--r--libs/ardour/session_process.cc45
1 files changed, 39 insertions, 6 deletions
diff --git a/libs/ardour/session_process.cc b/libs/ardour/session_process.cc
index 68ad11cf42..43849793d4 100644
--- a/libs/ardour/session_process.cc
+++ b/libs/ardour/session_process.cc
@@ -728,7 +728,8 @@ Session::process_without_events (jack_nframes_t nframes)
bool session_needs_butler = false;
jack_nframes_t stop_limit;
long frames_moved;
-
+ jack_nframes_t offset = 0;
+
{
if (post_transport_work & (PostTransportLocate|PostTransportStop)) {
no_roll (nframes, 0);
@@ -761,16 +762,20 @@ Session::process_without_events (jack_nframes_t nframes)
return;
}
- click (_transport_frame, nframes, 0);
+ if (maybe_sync_start (nframes, offset)) {
+ return;
+ }
+
+ click (_transport_frame, nframes, offset);
prepare_diskstreams ();
frames_moved = (long) floor (_transport_speed * nframes);
- if (process_routes (nframes, 0)) {
- no_roll (nframes, 0);
- return;
- }
+ if (process_routes (nframes, offset)) {
+ no_roll (nframes, offset);
+ return;
+ }
commit_diskstreams (nframes, session_needs_butler);
@@ -836,3 +841,31 @@ Session::process_audition (jack_nframes_t nframes)
}
}
+bool
+Session::maybe_sync_start (jack_nframes_t& nframes, jack_nframes_t& offset)
+{
+ jack_nframes_t sync_offset;
+
+ if (!waiting_for_sync_offset) {
+ return false;
+ }
+
+ if (_engine.get_sync_offset (sync_offset) && sync_offset < nframes) {
+
+ no_roll (sync_offset, 0);
+ nframes -= sync_offset;
+ offset += sync_offset;
+ waiting_for_sync_offset = false;
+
+ if (nframes == 0) {
+ return true; // done
+ }
+
+ } else {
+ no_roll (nframes, 0);
+ return true; // done
+ }
+
+ return false;
+}
+