13
0

extend TempoMapChange API to allow for replacing, not editing, the map

This commit is contained in:
Paul Davis 2022-10-27 13:40:29 -06:00
parent 5d5c1ee9fc
commit 09c9ab5c75
2 changed files with 10 additions and 0 deletions

View File

@ -63,3 +63,12 @@ TempoMapChange::abort ()
begun = false;
}
}
void
TempoMapChange::use_new_map (Temporal::TempoMap::WritableSharedPtr new_map)
{
/* existing write copy goes out of scope, and is deleted, We continue
* on with the new map, and will RCU-update it in our destructor.
*/
writable_map = new_map;
}

View File

@ -41,6 +41,7 @@ class TempoMapChange {
void begin ();
void abort ();
void use_new_map (Temporal::TempoMap::WritableSharedPtr);
Temporal::TempoMap& map() const { return *writable_map.get(); }