MIDI::Manager::instance()->cycle_end();
}
-void
-Session::prepare_diskstreams ()
-{
- boost::shared_ptr<DiskstreamList> dsl = diskstreams.reader();
- for (DiskstreamList::iterator i = dsl->begin(); i != dsl->end(); ++i) {
- (*i)->prepare ();
- }
-}
-
int
Session::fail_roll (nframes_t nframes)
{
}
int
-Session::process_routes (nframes_t nframes)
+Session::process_routes (nframes_t nframes, bool& need_butler)
{
bool record_active;
int declick = get_transport_declick_required();
(*i)->set_pending_declick (declick);
- if ((ret = (*i)->roll (nframes, start_frame, end_frame, declick, record_active, rec_monitors)) < 0) {
-
- /* we have to do this here. Route::roll() for an AudioTrack will have called AudioDiskstream::process(),
- and the DS will expect AudioDiskstream::commit() to be called. but we're aborting from that
- call path, so make sure we release any outstanding locks here before we return failure.
- */
-
- boost::shared_ptr<DiskstreamList> dsl = diskstreams.reader();
- for (DiskstreamList::iterator ids = dsl->begin(); ids != dsl->end(); ++ids) {
- (*ids)->recover ();
- }
-
+ if ((ret = (*i)->roll (nframes, start_frame, end_frame, declick, record_active, rec_monitors, need_butler)) < 0) {
stop_transport ();
return -1;
}
}
int
-Session::silent_process_routes (nframes_t nframes)
+Session::silent_process_routes (nframes_t nframes, bool& need_butler)
{
bool record_active = actively_recording();
int declick = get_transport_declick_required();
continue;
}
- if ((ret = (*i)->silent_roll (nframes, start_frame, end_frame, record_active, rec_monitors)) < 0) {
-
- /* we have to do this here. Route::roll() for an AudioTrack will have called AudioDiskstream::process(),
- and the DS will expect AudioDiskstream::commit() to be called. but we're aborting from that
- call path, so make sure we release any outstanding locks here before we return failure.
- */
-
- boost::shared_ptr<DiskstreamList> dsl = diskstreams.reader();
- for (DiskstreamList::iterator ids = dsl->begin(); ids != dsl->end(); ++ids) {
- (*ids)->recover ();
- }
-
+ if ((ret = (*i)->silent_roll (nframes, start_frame, end_frame, record_active, rec_monitors, need_butler)) < 0) {
stop_transport ();
return -1;
}
}
void
-Session::commit_diskstreams (nframes_t nframes, bool &needs_butler)
+Session::get_diskstream_statistics ()
{
int dret;
float pworst = 1.0f;
continue;
}
- /* force all diskstreams not handled by a Route to call do their stuff.
- Note: the diskstreams that were handled by a route will just return zero
- from this call, because they know they were processed. So in fact, this
- also runs commit() for every diskstream.
- */
-
- if ((dret = (*i)->process (_transport_frame, nframes, actively_recording(), get_rec_monitors_input())) == 0) {
- if ((*i)->commit (nframes)) {
- needs_butler = true;
- }
-
- } else if (dret < 0) {
- (*i)->recover();
- }
-
pworst = min (pworst, (*i)->playback_buffer_load());
cworst = min (cworst, (*i)->capture_buffer_load());
}
click (_transport_frame, this_nframes);
- /* now process frames between now and the first event in this block */
- prepare_diskstreams ();
-
- if (process_routes (this_nframes)) {
+ if (process_routes (this_nframes, session_needs_butler)) {
fail_roll (nframes);
return;
}
- commit_diskstreams (this_nframes, session_needs_butler);
-
nframes -= this_nframes;
if (frames_moved < 0) {
slave_speed));
}
-#if 0
- if (abs(average_slave_delta) > _slave->resolution()) {
+#if 1
+ if ((nframes_t) abs(average_slave_delta) > _slave->resolution()) {
cerr << "average slave delta greater than slave resolution (" << _slave->resolution() << "), going to silent motion\n";
goto silent_motion;
}
bool need_butler;
- prepare_diskstreams ();
- silent_process_routes (nframes);
- commit_diskstreams (nframes, need_butler);
+ silent_process_routes (nframes, need_butler);
if (need_butler) {
_butler->summon ();
click (_transport_frame, nframes);
- prepare_diskstreams ();
-
if (_transport_speed == 1.0) {
frames_moved = (long) nframes;
} else {
frames_moved = (long) interpolation.interpolate (0, nframes, 0, 0);
}
- if (process_routes (nframes)) {
+ if (process_routes (nframes, session_needs_butler)) {
fail_roll (nframes);
return;
}
- commit_diskstreams (nframes, session_needs_butler);
-
if (frames_moved < 0) {
decrement_transport_position (-frames_moved);
} else {
_butler->summon ();
}
+ /* if using a monitor section, run it because otherwise we don't hear anything */
+
+ if (auditioner->needs_monitor()) {
+ _monitor_out->passthru (_transport_frame, _transport_frame + nframes, nframes, false);
+ }
+
/* handle pending events */
while (pending_events.read (&ev, 1) == 1) {
process_event (ev);
}
- if (!auditioner->active()) {
+ if (!auditioner->auditioning()) {
/* auditioner no longer active, so go back to the normal process callback */
process_function = &Session::process_with_events;
}
}
}
-void
-Session::process_rtop (SessionEvent* ev)
-{
- ev->rt_slot ();
- ev->rt_return (ev);
-}