-AudioTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, bool& need_butler)
-{
- Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK);
-
- if (!lm.locked()) {
- boost::shared_ptr<AudioDiskstream> diskstream = audio_diskstream();
- framecnt_t playback_distance = diskstream->calculate_playback_distance(nframes);
- if (can_internal_playback_seek(llabs(playback_distance))) {
- /* TODO should declick */
- internal_playback_seek(playback_distance);
- }
- return 0;
- }
-
- framepos_t transport_frame;
- boost::shared_ptr<AudioDiskstream> diskstream = audio_diskstream();
-
- if (n_outputs().n_total() == 0 && _processors.empty()) {
- return 0;
- }
-
- if (!_active) {
- silence (nframes);
- if (_meter_point == MeterInput && (_monitoring & MonitorInput || _diskstream->record_enabled())) {
- _meter->reset();
- }
- return 0;
- }
-
- transport_frame = _session.transport_frame();
-
- int dret;
- framecnt_t playback_distance;
-
- if ((nframes = check_initial_delay (nframes, transport_frame)) == 0) {
-
- /* need to do this so that the diskstream sets its
- playback distance to zero, thus causing diskstream::commit
- to do nothing.
- */
-
- BufferSet bufs; /* empty set, no matter - nothing will happen */
-
- dret = diskstream->process (bufs, transport_frame, 0, playback_distance, false);
- need_butler = diskstream->commit (playback_distance);
- return dret;
- }
-
- _silent = false;
- _amp->apply_gain_automation(false);
-
- BufferSet& bufs = _session.get_route_buffers (n_process_buffers ());
-
- fill_buffers_with_input (bufs, _input, nframes);
-
- if (_meter_point == MeterInput && (_monitoring & MonitorInput || _diskstream->record_enabled())) {
- _meter->run (bufs, start_frame, end_frame, nframes, true);
- }
-
- if ((dret = diskstream->process (bufs, transport_frame, nframes, playback_distance, (monitoring_state() == MonitoringDisk))) != 0) {
- need_butler = diskstream->commit (playback_distance);
- silence (nframes);
- return dret;
- }
-
- process_output_buffers (bufs, start_frame, end_frame, nframes, declick, (!diskstream->record_enabled() && _session.transport_rolling()));
-
- need_butler = diskstream->commit (playback_distance);
-
- return 0;
-}
-
-int
-AudioTrack::export_stuff (BufferSet& buffers, framepos_t start, framecnt_t nframes,
- boost::shared_ptr<Processor> endpoint, bool include_endpoint, bool for_export)