From 220fa45d353bbbbdfcb6efb906189173bb4d88e9 Mon Sep 17 00:00:00 2001 From: Len Ovens Date: Mon, 26 Aug 2019 12:52:21 -0700 Subject: [PATCH] Add signal for foldback send add or remove --- libs/ardour/ardour/session.h | 8 ++++++-- libs/ardour/route.cc | 11 +++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 81c692580a..d2d0b39dbd 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -425,6 +425,10 @@ public: */ PBD::Signal2 > RouteRemovedFromRouteGroup; + /** Emitted when a foldback send is created or deleted + */ + PBD::Signal0 FBSendsChanged; + /* Step Editing status changed */ PBD::Signal1 StepEditStatusChange; @@ -1782,9 +1786,9 @@ public: f ( (*i).second ); } } - + bool playlist_is_active( boost::shared_ptr); - + private: void reset_write_sources (bool mark_write_complete, bool force = false); SourceMap sources; diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 075ccd72c1..962f23bda1 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -3312,6 +3312,7 @@ Route::add_foldback_send (boost::shared_ptr route) } catch (failed_constructor& err) { return -1; } + _session.FBSendsChanged (); return 0; } @@ -3321,6 +3322,7 @@ Route::remove_aux_or_listen (boost::shared_ptr route) { ProcessorStreams err; ProcessorList::iterator tmp; + bool do_fb_signal = false; { Glib::Threads::RWLock::ReaderLock rl(_processor_lock); @@ -3339,6 +3341,11 @@ Route::remove_aux_or_listen (boost::shared_ptr route) boost::shared_ptr d = boost::dynamic_pointer_cast(*x); if (d && d->target_route() == route) { + boost::shared_ptr snd = boost::dynamic_pointer_cast(d); + if (snd && snd->is_foldback()) { + do_fb_signal = true; + } + rl.release (); if (remove_processor (*x, &err, false) > 0) { rl.acquire (); @@ -3358,6 +3365,10 @@ Route::remove_aux_or_listen (boost::shared_ptr route) } } } + if (do_fb_signal) { + _session.FBSendsChanged (); + } + } void