summaryrefslogtreecommitdiff
path: root/libs/ardour/audioengine.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2007-05-01 23:26:14 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2007-05-01 23:26:14 +0000
commit0c7b7216efc71e9b3851f1b43f2191a99619ff25 (patch)
treeb957a47485c09a107bcce162d1bcf25caa81800a /libs/ardour/audioengine.cc
parentcdaec2d09e86e28d38d5d472a90032984b0bfcb0 (diff)
initial fixes to get build to work without new JACK MIDI, and to get it running with an older session, at least somewhat
git-svn-id: svn://localhost/ardour2/branches/midi@1773 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/audioengine.cc')
-rw-r--r--libs/ardour/audioengine.cc53
1 files changed, 31 insertions, 22 deletions
diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc
index 0bfa18be72..273829fa75 100644
--- a/libs/ardour/audioengine.cc
+++ b/libs/ardour/audioengine.cc
@@ -304,26 +304,13 @@ AudioEngine::process_callback (nframes_t nframes)
return 0;
}
- boost::shared_ptr<Ports> p = ports.reader();
-
- // Prepare ports (ie read data if necessary)
- for (Ports::iterator i = p->begin(); i != p->end(); ++i)
- (*i)->cycle_start(nframes);
-
- session->process (nframes);
-
- if (!_running) {
+ if (run_process_cycle (session, nframes)) {
/* we were zombified, maybe because a ladspa plugin took
too long, or jackd exited, or something like that.
*/
-
_processed_frames = next_processed_frames;
return 0;
}
-
- // Finalize ports (ie write data if necessary)
- for (Ports::iterator i = p->begin(); i != p->end(); ++i)
- (*i)->cycle_end();
if (last_monitor_check + monitor_check_interval < next_processed_frames) {
@@ -350,6 +337,28 @@ AudioEngine::process_callback (nframes_t nframes)
}
int
+AudioEngine::run_process_cycle (Session* s, jack_nframes_t nframes)
+{
+ boost::shared_ptr<Ports> p = ports.reader();
+
+ // Prepare ports (ie read data if necessary)
+ for (Ports::iterator i = p->begin(); i != p->end(); ++i)
+ (*i)->cycle_start (nframes);
+
+ s->process (nframes);
+
+ if (!_running) {
+ return -1;
+ }
+
+ // Finalize ports (ie write data if necessary)
+ for (Ports::iterator i = p->begin(); i != p->end(); ++i)
+ (*i)->cycle_end ();
+
+ return 0;
+}
+
+int
AudioEngine::_sample_rate_callback (nframes_t nframes, void *arg)
{
return static_cast<AudioEngine *> (arg)->jack_sample_rate_callback (nframes);
@@ -447,14 +456,14 @@ AudioEngine::set_session (Session *s)
can before we really start running.
*/
- session->process (blocksize);
- session->process (blocksize);
- session->process (blocksize);
- session->process (blocksize);
- session->process (blocksize);
- session->process (blocksize);
- session->process (blocksize);
- session->process (blocksize);
+ run_process_cycle (session, blocksize);
+ run_process_cycle (session, blocksize);
+ run_process_cycle (session, blocksize);
+ run_process_cycle (session, blocksize);
+ run_process_cycle (session, blocksize);
+ run_process_cycle (session, blocksize);
+ run_process_cycle (session, blocksize);
+ run_process_cycle (session, blocksize);
}
}