diff options
author | Robin Gareus <robin@gareus.org> | 2020-04-23 05:19:01 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-04-23 05:23:31 +0200 |
commit | 54bc1018d51eedab16da6b2148a145b445af0b03 (patch) | |
tree | 221efb3d851cd4ee25d44048be875576508fe070 | |
parent | 6fbcf837793ec9a8347fd2d12823b9e56587ffc0 (diff) |
Fix MIDI auditioning
The Auditioner is not part of the session route-list and the
auditioner route's I/O latency is never updated.
Session::process_audition() does not handle pre-roll either,
so it need to be zeroed, otherwise Route::roll skips samples.
This has lead to initial samples being skipped, IFF the
auditioner's output-port had non-zero latency.
Since private port-latencies are usually only set for routes
in the route-list, and _remaining_latency_preroll is reset
at transport-stop, this *usually* worked...
Last but not least, MIDI notes need to be resolved when seeking.
-rw-r--r-- | libs/ardour/ardour/auditioner.h | 2 | ||||
-rw-r--r-- | libs/ardour/auditioner.cc | 7 | ||||
-rw-r--r-- | libs/ardour/session_transport.cc | 1 |
3 files changed, 9 insertions, 1 deletions
diff --git a/libs/ardour/ardour/auditioner.h b/libs/ardour/ardour/auditioner.h index 624df0c0d1..6ca51fc0d6 100644 --- a/libs/ardour/ardour/auditioner.h +++ b/libs/ardour/ardour/auditioner.h @@ -91,6 +91,8 @@ public: void set_audition_synth_info(PluginInfoPtr in) { audition_synth_info = in; } + samplecnt_t output_latency () const { return 0; } + private: PluginInfoPtr audition_synth_info; //we will use this to create a new synth on-the-fly each time an audition is requested diff --git a/libs/ardour/auditioner.cc b/libs/ardour/auditioner.cc index 079677ae4c..6b1921a2f8 100644 --- a/libs/ardour/auditioner.cc +++ b/libs/ardour/auditioner.cc @@ -440,7 +440,12 @@ Auditioner::play_audition (samplecnt_t nframes) _seek_complete = false; _seeking = false; _seek_sample = -1; - _disk_reader->reset_tracker(); + if (_midi_audition) { + /* Force MIDI note tracker to resolve any notes that are + * still playing -> set DR::run_must_resolve */ + _disk_reader->set_pending_overwrite (PlaylistModified); + _disk_reader->overwrite_existing_buffers (); + } } if(!_seeking) { diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc index b2364054fa..8bba6757d2 100644 --- a/libs/ardour/session_transport.cc +++ b/libs/ardour/session_transport.cc @@ -695,6 +695,7 @@ Session::butler_completed_transport_work () if (ptw & PostTransportAudition) { if (auditioner && auditioner->auditioning()) { + _remaining_latency_preroll = 0; process_function = &Session::process_audition; } else { process_function = &Session::process_with_events; |