mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-20 21:56:30 +01:00
Better version of previous commit
This commit is contained in:
parent
9d063943bb
commit
d2916a1df8
2 changed files with 16 additions and 7 deletions
|
|
@ -450,6 +450,7 @@ private:
|
|||
mutable Glib::Threads::RWLock region_lock;
|
||||
|
||||
private:
|
||||
void freeze_locked ();
|
||||
void setup_layering_indices (RegionList const&);
|
||||
void coalesce_and_check_crossfades (std::list<Evoral::Range<samplepos_t> >);
|
||||
|
||||
|
|
|
|||
|
|
@ -453,6 +453,12 @@ Playlist::freeze ()
|
|||
* before beginning to modify the playlist.
|
||||
*/
|
||||
RegionWriteLock rlock (this);
|
||||
freeze_locked ();
|
||||
}
|
||||
|
||||
void
|
||||
Playlist::freeze_locked ()
|
||||
{
|
||||
delay_notifications ();
|
||||
g_atomic_int_inc (&ignore_state_changes);
|
||||
}
|
||||
|
|
@ -2224,9 +2230,9 @@ Playlist::update (const RegionListProperty::ChangeRecord& change)
|
|||
DEBUG_TRACE (DEBUG::Properties, string_compose ("Playlist %1 updates from a change record with %2 adds %3 removes\n",
|
||||
name (), change.added.size (), change.removed.size ()));
|
||||
|
||||
freeze ();
|
||||
{
|
||||
RegionWriteLock rlock (this);
|
||||
freeze_locked ();
|
||||
/* add the added regions */
|
||||
for (RegionListProperty::ChangeContainer::const_iterator i = change.added.begin (); i != change.added.end (); ++i) {
|
||||
add_region_internal ((*i), (*i)->position (), rlock.thawlist);
|
||||
|
|
@ -2993,14 +2999,16 @@ Playlist::ripple (samplepos_t at, samplecnt_t distance, RegionList* exclude)
|
|||
void
|
||||
Playlist::update_after_tempo_map_change ()
|
||||
{
|
||||
freeze ();
|
||||
{
|
||||
RegionWriteLock rlock (const_cast<Playlist*> (this));
|
||||
RegionList copy (regions.rlist ());
|
||||
|
||||
RegionWriteLock rlock (const_cast<Playlist*> (this));
|
||||
RegionList copy (regions.rlist ());
|
||||
freeze_locked ();
|
||||
|
||||
for (RegionList::iterator i = copy.begin (); i != copy.end (); ++i) {
|
||||
rlock.thawlist.add (*i);
|
||||
(*i)->update_after_tempo_map_change ();
|
||||
for (RegionList::iterator i = copy.begin (); i != copy.end (); ++i) {
|
||||
rlock.thawlist.add (*i);
|
||||
(*i)->update_after_tempo_map_change ();
|
||||
}
|
||||
}
|
||||
/* possibly causes a contents changed notification (flush_notifications()) */
|
||||
thaw ();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue