diff --git a/libs/ardour/ardour/auditioner.h b/libs/ardour/ardour/auditioner.h index 4bbcf5e92f..f1fc8b4c3a 100644 --- a/libs/ardour/ardour/auditioner.h +++ b/libs/ardour/ardour/auditioner.h @@ -57,6 +57,8 @@ public: sampleoffset_t seek_sample() const { return _seeking ? _seek_sample : -1;} void seek_response(sampleoffset_t pos); + void idle_synth_update (); + MonitorState monitoring_state () const; bool needs_monitor() const { return via_monitor; } diff --git a/libs/ardour/auditioner.cc b/libs/ardour/auditioner.cc index e9613e7e23..391309a74a 100644 --- a/libs/ardour/auditioner.cc +++ b/libs/ardour/auditioner.cc @@ -551,6 +551,22 @@ Auditioner::seek_response (sampleoffset_t pos) { } } +void +Auditioner::idle_synth_update () +{ + if (auditioning() || !asynth) { + return; + } + auto pi = boost::dynamic_pointer_cast (asynth); + + /* Note: calling thread must have process buffers */ + BufferSet bufs; + samplepos_t start = 0; + pframes_t n_samples = 16; + /* MIDI buffers need to be able to hold patch/pgm change messages. (16 bytes + msg-size) per event */ + bufs.ensure_buffers (max (asynth->input_streams (), asynth->output_streams ()), std::max (1024, n_samples)); + pi->run (bufs, start, start + n_samples, 1.0, n_samples, false); +} void Auditioner::output_changed (IOChange change, void* /*src*/)