summaryrefslogtreecommitdiff
path: root/libs/ardour/route.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/route.cc')
-rw-r--r--libs/ardour/route.cc51
1 files changed, 42 insertions, 9 deletions
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc
index 3c03d7c1a4..6409fb5bf0 100644
--- a/libs/ardour/route.cc
+++ b/libs/ardour/route.cc
@@ -3382,15 +3382,21 @@ Route::flush_processors ()
#ifdef __clang__
__attribute__((annotate("realtime")))
#endif
-void
+bool
Route::apply_processor_changes_rt ()
{
+ int emissions = EmitNone;
+
if (_pending_meter_point != _meter_point) {
Glib::Threads::RWLock::WriterLock pwl (_processor_lock, Glib::Threads::TRY_LOCK);
if (pwl.locked()) {
/* meters always have buffers for 'processor_max_streams'
* they can be re-positioned without re-allocation */
- set_meter_point_unlocked();
+ if (set_meter_point_unlocked()) {
+ emissions |= EmitMeterChanged | EmitMeterVisibilityChange;;
+ } else {
+ emissions |= EmitMeterChanged;
+ }
}
}
@@ -3401,15 +3407,38 @@ Route::apply_processor_changes_rt ()
if (pwl.locked()) {
apply_processor_order (_pending_processor_order);
setup_invisible_processors ();
-
changed = true;
g_atomic_int_set (&_pending_process_reorder, 0);
+ emissions |= EmitRtProcessorChange;
}
}
if (changed) {
- processors_changed (RouteProcessorChange (RouteProcessorChange::RealTimeChange)); /* EMIT SIGNAL */
set_processor_positions ();
}
+ if (emissions != 0) {
+ g_atomic_int_set (&_pending_signals, emissions);
+ return true;
+ }
+ return false;
+}
+
+void
+Route::emit_pending_signals ()
+{
+
+ int sig = g_atomic_int_and (&_pending_signals, 0);
+ if (sig & EmitMeterChanged) {
+ _meter->emit_configuration_changed();
+ meter_change (); /* EMIT SIGNAL */
+ if (sig & EmitMeterVisibilityChange) {
+ processors_changed (RouteProcessorChange (RouteProcessorChange::MeterPointChange, true)); /* EMIT SIGNAL */
+ } else {
+ processors_changed (RouteProcessorChange (RouteProcessorChange::MeterPointChange, false)); /* EMIT SIGNAL */
+ }
+ }
+ if (sig & EmitRtProcessorChange) {
+ processors_changed (RouteProcessorChange (RouteProcessorChange::RealTimeChange)); /* EMIT SIGNAL */
+ }
}
void
@@ -3423,7 +3452,13 @@ Route::set_meter_point (MeterPoint p, bool force)
Glib::Threads::Mutex::Lock lx (AudioEngine::instance()->process_lock ());
Glib::Threads::RWLock::WriterLock lm (_processor_lock);
_pending_meter_point = p;
- set_meter_point_unlocked();
+ _meter->emit_configuration_changed();
+ meter_change (); /* EMIT SIGNAL */
+ if (set_meter_point_unlocked()) {
+ processors_changed (RouteProcessorChange (RouteProcessorChange::MeterPointChange, true)); /* EMIT SIGNAL */
+ } else {
+ processors_changed (RouteProcessorChange (RouteProcessorChange::MeterPointChange, false)); /* EMIT SIGNAL */
+ }
} else {
_pending_meter_point = p;
}
@@ -3433,7 +3468,7 @@ Route::set_meter_point (MeterPoint p, bool force)
#ifdef __clang__
__attribute__((annotate("realtime")))
#endif
-void
+bool
Route::set_meter_point_unlocked ()
{
#ifndef NDEBUG
@@ -3502,9 +3537,7 @@ Route::set_meter_point_unlocked ()
* but all those signals are subscribed to with gui_thread()
* so we're safe.
*/
- meter_change (); /* EMIT SIGNAL */
- bool const meter_visibly_changed = (_meter->display_to_user() != meter_was_visible_to_user);
- processors_changed (RouteProcessorChange (RouteProcessorChange::MeterPointChange, meter_visibly_changed)); /* EMIT SIGNAL */
+ return (_meter->display_to_user() != meter_was_visible_to_user);
}
void