Auditioner: add API for UI to run the synth (idle)
This allows the synth to process injected out-of-band MIDI data, such as Program/Patch Changes while audition is inactive.
This commit is contained in:
parent
604652b7d6
commit
4fe9d99674
|
@ -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; }
|
||||
|
|
|
@ -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<PluginInsert> (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<size_t> (1024, n_samples));
|
||||
pi->run (bufs, start, start + n_samples, 1.0, n_samples, false);
|
||||
}
|
||||
|
||||
void
|
||||
Auditioner::output_changed (IOChange change, void* /*src*/)
|
||||
|
|
Loading…
Reference in New Issue
Block a user