mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 00:04:56 +01:00
Consolidate rt processor-changed signal emission
Prefer a single signal and bit flags, instead of individual signals. This allows to call resort_route() at most once (if at all for certain changes). Notably Mixbus comp/gate/eq type changes can use NoProcessorChange to only request a GUI update.
This commit is contained in:
parent
e734acfa6b
commit
b14ce31372
3 changed files with 27 additions and 26 deletions
|
|
@ -1055,6 +1055,10 @@ inline Route::PluginSetupOptions operator&= (Route::PluginSetupOptions& a, const
|
||||||
return a = static_cast<Route::PluginSetupOptions> (static_cast <int>(a) & static_cast<int> (b));
|
return a = static_cast<Route::PluginSetupOptions> (static_cast <int>(a) & static_cast<int> (b));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline RouteProcessorChange::Type operator|= (RouteProcessorChange::Type& a, const RouteProcessorChange::Type& b) {
|
||||||
|
return a = static_cast<RouteProcessorChange::Type> (static_cast <int>(a) | static_cast<int> (b));
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
Route::add_processors (const ProcessorList& others, std::shared_ptr<Processor> before, ProcessorStreams* err)
|
Route::add_processors (const ProcessorList& others, std::shared_ptr<Processor> before, ProcessorStreams* err)
|
||||||
{
|
{
|
||||||
|
|
@ -4231,20 +4235,20 @@ void
|
||||||
Route::emit_pending_signals ()
|
Route::emit_pending_signals ()
|
||||||
{
|
{
|
||||||
int sig = _pending_signals.fetch_and (0);
|
int sig = _pending_signals.fetch_and (0);
|
||||||
if (sig & EmitMeterChanged) {
|
|
||||||
_meter->emit_configuration_changed();
|
if (sig != 0) {
|
||||||
meter_change (); /* EMIT SIGNAL */
|
bool meter_viz_changed = (sig & (EmitMeterVisibilityChange | EmitMeterChanged)) == (EmitMeterVisibilityChange | EmitMeterChanged);
|
||||||
if (sig & EmitMeterVisibilityChange) {
|
RouteProcessorChange::Type t = RouteProcessorChange::NoProcessorChange;
|
||||||
processors_changed (RouteProcessorChange (RouteProcessorChange::MeterPointChange, true)); /* EMIT SIGNAL */
|
if (sig & EmitRtProcessorChange) {
|
||||||
} else {
|
t |= RouteProcessorChange::RealTimeChange;
|
||||||
processors_changed (RouteProcessorChange (RouteProcessorChange::MeterPointChange, false)); /* EMIT SIGNAL */
|
|
||||||
}
|
}
|
||||||
}
|
if (sig & EmitSendReturnChange) {
|
||||||
if (sig & EmitRtProcessorChange) {
|
t |= RouteProcessorChange::SendReturnChange;
|
||||||
processors_changed (RouteProcessorChange (RouteProcessorChange::RealTimeChange)); /* EMIT SIGNAL */
|
}
|
||||||
}
|
if (sig & EmitMeterVisibilityChange) {
|
||||||
if (sig & EmitSendReturnChange) {
|
t |= RouteProcessorChange::MeterPointChange;
|
||||||
processors_changed (RouteProcessorChange (RouteProcessorChange::SendReturnChange, false)); /* EMIT SIGNAL */
|
}
|
||||||
|
processors_changed (RouteProcessorChange (t, meter_viz_changed));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* this would be a job for the butler.
|
/* this would be a job for the butler.
|
||||||
|
|
|
||||||
|
|
@ -8166,15 +8166,8 @@ Session::ProcessorChangeBlocker::~ProcessorChangeBlocker ()
|
||||||
if (PBD::atomic_dec_and_test (_session->_ignore_route_processor_changes)) {
|
if (PBD::atomic_dec_and_test (_session->_ignore_route_processor_changes)) {
|
||||||
RouteProcessorChange::Type type = (RouteProcessorChange::Type) _session->_ignored_a_processor_change.fetch_and (0);
|
RouteProcessorChange::Type type = (RouteProcessorChange::Type) _session->_ignored_a_processor_change.fetch_and (0);
|
||||||
if (_reconfigure_on_delete) {
|
if (_reconfigure_on_delete) {
|
||||||
if (type & RouteProcessorChange::GeneralChange) {
|
if (type != RouteProcessorChange::NoProcessorChange) {
|
||||||
_session->route_processors_changed (RouteProcessorChange ());
|
_session->route_processors_changed (type);
|
||||||
} else {
|
|
||||||
if (type & RouteProcessorChange::MeterPointChange) {
|
|
||||||
_session->route_processors_changed (RouteProcessorChange (RouteProcessorChange::MeterPointChange));
|
|
||||||
}
|
|
||||||
if (type & RouteProcessorChange::RealTimeChange) {
|
|
||||||
_session->route_processors_changed (RouteProcessorChange (RouteProcessorChange::RealTimeChange));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1963,21 +1963,25 @@ Session::route_processors_changed (RouteProcessorChange c)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c.type == RouteProcessorChange::MeterPointChange) {
|
if (c.type == RouteProcessorChange::NoProcessorChange) {
|
||||||
/* sort rec-armed routes first */
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (c.type & RouteProcessorChange::MeterPointChange) {
|
||||||
|
/* sort rec-armed routes to be processed first */
|
||||||
resort_routes ();
|
resort_routes ();
|
||||||
set_dirty ();
|
set_dirty ();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c.type == RouteProcessorChange::RealTimeChange) {
|
if (c.type & RouteProcessorChange::RealTimeChange) {
|
||||||
set_dirty ();
|
set_dirty ();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
resort_routes ();
|
resort_routes ();
|
||||||
|
|
||||||
if (c.type == RouteProcessorChange::SendReturnChange) {
|
if (c.type & RouteProcessorChange::SendReturnChange) {
|
||||||
update_latency_compensation (true, false);
|
update_latency_compensation (true, false);
|
||||||
} else {
|
} else {
|
||||||
update_latency_compensation (false, false);
|
update_latency_compensation (false, false);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue