+ Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK);
+ if (!lm.locked()) {
+ return 0;
+ }
+
+ assert(_active);
+
+ BufferSet& bufs = _session.get_route_buffers (n_process_buffers());
+
+ _silent = false;
+ _amp->apply_gain_automation(false);
+
+ if (_queue_panic) {
+ MidiBuffer& mbuf (bufs.get_midi (0));
+ _queue_panic = false;
+ for (uint8_t chn = 0; chn < 0xf; ++chn) {
+ uint8_t buf[3] = { ((uint8_t) (MIDI_CMD_CONTROL | chn)), ((uint8_t) MIDI_CTL_SUSTAIN), 0 };
+ mbuf.push_back(0, 3, buf);
+ buf[1] = MIDI_CTL_ALL_NOTES_OFF;
+ mbuf.push_back(0, 3, buf);
+ buf[1] = MIDI_CTL_RESET_CONTROLLERS;
+ mbuf.push_back(0, 3, buf);
+ }
+ }
+
+ process_output_buffers (bufs, start_frame, end_frame, nframes, declick, !_session.transport_stopped());
+
+ for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
+ boost::shared_ptr<Delivery> d = boost::dynamic_pointer_cast<Delivery> (*i);
+ if (d) {
+ d->flush_buffers (nframes);
+ }
+ }