From cdec333bfe870fdbbbcaaaabe4b4aa98ccc9f0e8 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 8 Nov 2017 18:05:04 +0100 Subject: move rt-stop to route currently this is only used to resolve midi events for plugins (this is conceptually not correct, note offs should be resolved by the disk-reader only), but it calls into all processors now (incl disk-reader if present), which is handy (e.g. flush delaylins) --- libs/ardour/ardour/route.h | 5 +++-- libs/ardour/ardour/track.h | 1 - libs/ardour/route.cc | 12 ++++++++++++ libs/ardour/track.cc | 14 -------------- 4 files changed, 15 insertions(+), 17 deletions(-) diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index bd283d27ac..d3a4a5d35f 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -150,8 +150,9 @@ public: virtual bool can_record() { return false; } - virtual void non_realtime_transport_stop (samplepos_t now, bool flush); - virtual void realtime_handle_transport_stopped () {} + void non_realtime_transport_stop (samplepos_t now, bool flush); + void realtime_handle_transport_stopped (); + virtual void realtime_locate () {} virtual void non_realtime_locate (samplepos_t); void set_loop (ARDOUR::Location *); diff --git a/libs/ardour/ardour/track.h b/libs/ardour/ardour/track.h index b1700fb382..148fec652d 100644 --- a/libs/ardour/ardour/track.h +++ b/libs/ardour/ardour/track.h @@ -139,7 +139,6 @@ public: int can_internal_playback_seek (samplecnt_t); int internal_playback_seek (samplecnt_t); void non_realtime_locate (samplepos_t); - void realtime_handle_transport_stopped (); void non_realtime_speed_change (); int overwrite_existing_buffers (); samplecnt_t get_captured_samples (uint32_t n = 0) const; diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index fab5beb766..fba39744fa 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -3412,6 +3412,18 @@ Route::non_realtime_transport_stop (samplepos_t now, bool flush) } } +void +Route::realtime_handle_transport_stopped () +{ + Glib::Threads::RWLock::ReaderLock lm (_processor_lock); + + /* currently only by Plugin, queue note-off events */ + for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) { + (*i)->realtime_handle_transport_stopped (); + } +} + + void Route::input_change_handler (IOChange change, void * /*src*/) { diff --git a/libs/ardour/track.cc b/libs/ardour/track.cc index d992aae079..072ae27d08 100644 --- a/libs/ardour/track.cc +++ b/libs/ardour/track.cc @@ -542,20 +542,6 @@ Track::transport_looped (samplepos_t p) return _disk_writer->transport_looped (p); } -void -Track::realtime_handle_transport_stopped () -{ - Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK); - - if (!lm.locked ()) { - return; - } - - for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) { - (*i)->realtime_handle_transport_stopped (); - } -} - void Track::transport_stopped_wallclock (struct tm & n, time_t t, bool g) { -- cgit v1.2.3