From 9c4024ff0c87c025c2275bc9b01588fc69f570e8 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 8 Apr 2022 11:57:16 -0600 Subject: [PATCH] fix creation of TempoCommands for undo/redo history --- libs/ardour/session_command.cc | 6 +----- libs/ardour/session_state.cc | 4 ++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libs/ardour/session_command.cc b/libs/ardour/session_command.cc index 6082b1c1eb..9991ed1bed 100644 --- a/libs/ardour/session_command.cc +++ b/libs/ardour/session_command.cc @@ -110,12 +110,8 @@ Session::memento_command_factory(XMLNode *n) } else if (type_name == "ARDOUR::Locations") { return new MementoCommand(*_locations, before, after); - } else if (type_name == "Temporal::TempoMap") { - -#warning NUTEMPO how to reconstruct memento commands for a tempo map - // return new MementoCommand(*TempoMap::fetch(), before, after); - } else if (type_name == "ARDOUR::Playlist" || type_name == "ARDOUR::AudioPlaylist" || type_name == "ARDOUR::MidiPlaylist") { + if (boost::shared_ptr pl = _playlists->by_name(child->property("name")->value())) { return new MementoCommand(*(pl.get()), before, after); } diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index fd03a4cbce..f7226987d2 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -4045,6 +4045,10 @@ Session::restore_history (string snapshot_name) ut->add_command(c); } + } else if (n->name() == "TempoCommand") { + + ut->add_command (new TempoCommand (*n)); + } else if (n->name() == "NoteDiffCommand") { PBD::ID id (n->property("midi-source")->value()); boost::shared_ptr midi_source =