AudioEngine::process_callback (pframes_t nframes)
{
Glib::Threads::Mutex::Lock tm (_process_lock, Glib::Threads::TRY_LOCK);
+ Port::set_speed_ratio (1.0);
PT_TIMING_REF;
PT_TIMING_CHECK (1);
if (_session == 0) {
if (!_freewheeling) {
- PortManager::cycle_start (nframes);
- PortManager::cycle_end (nframes);
+ PortManager::silence_outputs (nframes);
}
_processed_samples = next_processed_samples;
return 0;
}
+ if (!_freewheeling || Freewheel.empty()) {
+ // run a list of slaves here
+ // - multiple slaves (ow_many_dsp_threads() in paralell)
+ // - session can pick one (ask for position & speed)
+ // - GUI can display all
+ Port::set_speed_ratio (_session->engine_speed ());
+ }
+
/* tell all relevant objects that we're starting a new cycle */
InternalSend::CycleStart (nframes);
/* tell all Ports that we're starting a new cycle */
- PortManager::cycle_start (nframes);
+ PortManager::cycle_start (nframes, _session);
/* test if we are freewheeling and there are freewheel signals connected.
* ardour should act normally even when freewheeling unless /it/ is
if (_freewheeling && !Freewheel.empty()) {
Freewheel (nframes);
} else {
- _session->process (nframes);
+ if (Port::cycle_nframes () <= nframes) {
+ _session->process (Port::cycle_nframes ());
+ } else {
+ pframes_t remain = Port::cycle_nframes ();
+ while (remain > 0) {
+ pframes_t nf = std::min (remain, nframes);
+ _session->process (nf);
+ remain -= nf;
+ if (remain > 0) {
+ split_cycle (nf);
+ }
+ }
+ }
}
if (_freewheeling) {
- PortManager::cycle_end (nframes);
+ PortManager::cycle_end (nframes, _session);
return 0;
}
if (session_remove_pending && session_removal_countdown) {
- PortManager::fade_out (session_removal_gain, session_removal_gain_step, nframes);
+ PortManager::cycle_end_fade_out (session_removal_gain, session_removal_gain_step, nframes, _session);
if (session_removal_countdown > nframes) {
session_removal_countdown -= nframes;
}
session_removal_gain -= (nframes * session_removal_gain_step);
+ } else {
+ PortManager::cycle_end (nframes, _session);
}
- PortManager::cycle_end (nframes);
-
_processed_samples = next_processed_samples;
PT_TIMING_CHECK (2);