if (!_copy) {
TempoMap& map (_editor->session()->tempo_map());
+ /* get current state */
+ before_state = &map.get_state();
/* remove the section while we drag it */
map.remove_meter (section, true);
}
} else {
_editor->begin_reversible_command (_("move meter mark"));
- XMLNode &before = map.get_state();
/* we removed it before, so add it back now */
map.add_meter (_marker->meter(), when);
XMLNode &after = map.get_state();
- _editor->session()->add_command(new MementoCommand<TempoMap>(map, &before, &after));
+ _editor->session()->add_command(new MementoCommand<TempoMap>(map, before_state, &after));
_editor->commit_reversible_command ();
}
if (!_copy) {
TempoMap& map (_editor->session()->tempo_map());
+ /* get current state */
+ before_state = &map.get_state();
/* remove the section while we drag it */
map.remove_tempo (section, true);
}
} else {
_editor->begin_reversible_command (_("move tempo mark"));
- XMLNode &before = map.get_state();
/* we removed it before, so add it back now */
map.add_tempo (_marker->tempo(), when);
XMLNode &after = map.get_state();
- _editor->session()->add_command (new MementoCommand<TempoMap>(map, &before, &after));
+ _editor->session()->add_command (new MementoCommand<TempoMap>(map, before_state, &after));
_editor->commit_reversible_command ();
}