- /* filter captured data before the diskstream sees it */
-
- filter_channels (bufs, get_capture_channel_mode(), get_capture_channel_mask());
-
- _silent = false;
-
- if ((dret = diskstream->process (bufs, transport_frame, nframes, playback_distance, (monitoring_state() == MonitoringDisk))) != 0) {
- need_butler = diskstream->commit (playback_distance);
- silence (nframes);
- return dret;
- }
-
- /* filter playback data before we do anything else */
-
- filter_channels (bufs, get_playback_channel_mode(), get_playback_channel_mask ());
-
- if (monitoring_state() == MonitoringInput) {
-
- /* not actually recording, but we want to hear the input material anyway,
- at least potentially (depending on monitoring options)
- */
-
- /* because the playback buffer is event based and not a
- * continuous stream, we need to make sure that we empty
- * it of events every cycle to avoid it filling up with events
- * read from disk, while we are actually monitoring input
- */
-
- diskstream->flush_playback (start_frame, end_frame);
-
- }
-
-
- /* append immediate messages to the first MIDI buffer (thus sending it to the first output port) */
-
- write_out_of_band_data (bufs, start_frame, end_frame, nframes);
-
- /* final argument: don't waste time with automation if we're not recording or rolling */
-
- process_output_buffers (bufs, start_frame, end_frame, nframes,
- declick, (!diskstream->record_enabled() && !_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);
+void
+MidiTrack::update_controls (BufferSet const& bufs)
+{
+ const MidiBuffer& buf = bufs.get_midi(0);
+ for (MidiBuffer::const_iterator e = buf.begin(); e != buf.end(); ++e) {
+ const Evoral::Event<samplepos_t>& ev = *e;
+ const Evoral::Parameter param = midi_parameter(ev.buffer(), ev.size());
+ const boost::shared_ptr<AutomationControl> control = automation_control (param);
+ if (control) {
+ double old = control->get_double (false, 0);
+ control->set_double (ev.value(), 0, false);
+ if (old != ev.value()) {
+ control->Changed (false, Controllable::NoGroup);
+ }