summaryrefslogtreecommitdiff
path: root/libs/ardour/audioengine.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/audioengine.cc')
-rw-r--r--libs/ardour/audioengine.cc68
1 files changed, 34 insertions, 34 deletions
diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc
index 273829fa75..3b85ea2147 100644
--- a/libs/ardour/audioengine.cc
+++ b/libs/ardour/audioengine.cc
@@ -304,13 +304,26 @@ AudioEngine::process_callback (nframes_t nframes)
return 0;
}
- if (run_process_cycle (session, nframes)) {
- /* we were zombified, maybe because a ladspa plugin took
- too long, or jackd exited, or something like that.
- */
+ 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);
+ }
+
+ if (session) {
+ session->process (nframes);
+ }
+
+ if (!_running) {
_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) {
@@ -337,28 +350,6 @@ 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);
@@ -456,14 +447,23 @@ AudioEngine::set_session (Session *s)
can before we really start running.
*/
- 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);
+ boost::shared_ptr<Ports> p = ports.reader();
+
+ for (Ports::iterator i = p->begin(); i != p->end(); ++i)
+ (*i)->cycle_start (blocksize);
+
+ s->process (blocksize);
+ s->process (blocksize);
+ s->process (blocksize);
+ s->process (blocksize);
+ s->process (blocksize);
+ s->process (blocksize);
+ s->process (blocksize);
+ s->process (blocksize);
+
+ for (Ports::iterator i = p->begin(); i != p->end(); ++i)
+ (*i)->cycle_end ();
+
}
}