Set thread-local tempo-map to write-copy

Use the new map that is being edited for lookups while changing
the map in the in the GUI. This can changes directly visible
as the map is being edited.

This used to be done directly with the fetch_writable() API
This commit is contained in:
Robin Gareus 2023-04-10 10:03:21 +02:00
parent 518fc7754f
commit a0dc539d70
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -757,6 +757,7 @@ Temporal::TempoMap::WritableSharedPtr
Editor::begin_tempo_mapping ()
{
TempoMap::WritableSharedPtr wmap = TempoMap::write_copy ();
TempoMap::set (wmap);
reassociate_metric_markers (wmap);
(void) Temporal::DomainSwapInformation::start (Temporal::BeatTime);
_session->globally_change_time_domain (Temporal::BeatTime, Temporal::AudioTime);
@ -788,6 +789,7 @@ Temporal::TempoMap::WritableSharedPtr
Editor::begin_tempo_map_edit ()
{
TempoMap::WritableSharedPtr wmap = TempoMap::write_copy ();
TempoMap::set (wmap);
reassociate_metric_markers (wmap);
return wmap;
}