13
0

Further consolidate locations signal emissions

This commit is contained in:
Robin Gareus 2023-12-10 04:10:45 +01:00
parent fa0d1d98f9
commit f191d8ba94
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -1277,6 +1277,8 @@ Locations::set_state (const XMLNode& node, int version)
/* build up a new locations list in here */
LocationList new_locations;
bool emit_changed = false;
{
std::vector<Location::ChangeSuspender> lcs;
Glib::Threads::RWLock::WriterLock lm (_lock);
@ -1313,6 +1315,7 @@ Locations::set_state (const XMLNode& node, int version)
loc = new Location (_session);
lcs.emplace_back (std::move (loc));
loc->set_state (**niter, version);
emit_changed = true;
}
bool add = true;
@ -1373,6 +1376,7 @@ Locations::set_state (const XMLNode& node, int version)
if (!found) {
delete *i;
locations.erase (i);
emit_changed = true;
}
i = tmp;
@ -1387,7 +1391,9 @@ Locations::set_state (const XMLNode& node, int version)
}
}
changed (); /* EMIT SIGNAL */
if (emit_changed) {
changed (); /* EMIT SIGNAL */
}
return 0;
}
@ -1816,12 +1822,14 @@ Locations::ripple (timepos_t const & at, timecnt_t const & distance, bool includ
copy = locations;
}
std::vector<Location::ChangeSuspender> lcs;
for (LocationList::iterator i = copy.begin(); i != copy.end(); ++i) {
if ( (*i)->is_session_range() || (*i)->is_auto_punch() || (*i)->is_auto_loop() ) {
continue;
}
lcs.emplace_back (std::move (*i));
bool locked = (*i)->locked();
if (locked) {