use new TempoCommand when putting tempo map ops into undo/redo history

This commit is contained in:
Paul Davis 2022-04-08 11:57:56 -06:00
parent 9c4024ff0c
commit 7293904e53
4 changed files with 17 additions and 17 deletions

View File

@ -3525,7 +3525,7 @@ MeterMarkerDrag::finished (GdkEvent* event, bool movement_occurred)
_editor->set_snap_mode (_old_snap_mode);
XMLNode &after = map->get_state();
_editor->session()->add_command (new MementoCommand<Temporal::TempoMap> (new Temporal::TempoMap::MementoBinder(), before_state, &after));
_editor->session()->add_command (new Temporal::TempoCommand (_("move time signature"), before_state, &after));
_editor->commit_reversible_command ();
TempoMap::update (map);
@ -3655,7 +3655,7 @@ TempoMarkerDrag::finished (GdkEvent* event, bool movement_occurred)
TempoMap::update (map);
XMLNode &after = map->get_state();
_editor->session()->add_command (new MementoCommand<Temporal::TempoMap> (new Temporal::TempoMap::MementoBinder(), _before_state, &after));
_editor->session()->add_command (new Temporal::TempoCommand (_("move tempo"), _before_state, &after));
_editor->commit_reversible_command ();
}
@ -3825,7 +3825,7 @@ BBTRulerDrag::finished (GdkEvent* event, bool movement_occurred)
XMLNode &after = map->get_state();
_editor->session()->add_command(new MementoCommand<TempoMap>(new Temporal::TempoMap::MementoBinder(), _before_state, &after));
_editor->session()->add_command (new Temporal::TempoCommand (_("move BBT point"), _before_state, &after));
_editor->commit_reversible_command ();
}
@ -3957,7 +3957,7 @@ TempoTwistDrag::finished (GdkEvent* event, bool movement_occurred)
TempoMap& map (_editor->session()->tempo_map());
XMLNode &after = map.get_state();
_editor->session()->add_command(new MementoCommand<TempoMap>(map, _before_state, &after));
_editor->session()->add_command (new Temporal::TempoCommand (_("twist tempo"), _before_state, &after));
_editor->commit_reversible_command ();
}
@ -4058,7 +4058,7 @@ TempoEndDrag::finished (GdkEvent* event, bool movement_occurred)
TempoMap::update (map);
XMLNode &after = map->get_state();
_editor->session()->add_command(new MementoCommand<TempoMap>(new Temporal::TempoMap::MementoBinder(), _before_state, &after));
_editor->session()->add_command (new Temporal::TempoCommand (_("move tempo end"), _before_state, &after));
_editor->commit_reversible_command ();
TempoPoint const * prev = 0;

View File

@ -1620,7 +1620,7 @@ Editor::toggle_tempo_type ()
tmap->set_ramped (const_cast<Temporal::TempoPoint&>(tempo), !tempo.ramped());
XMLNode &after = tmap->get_state();
_session->add_command (new MementoCommand<Temporal::TempoMap> (new Temporal::TempoMap::MementoBinder(), &before, &after));
_session->add_command (new Temporal::TempoCommand (_("change tempo type"), &before, &after));
commit_reversible_command ();
TempoMap::update (tmap);
@ -1646,7 +1646,7 @@ Editor::toggle_tempo_clamped ()
const_cast<Temporal::Tempo&>(tempo).set_clamped (!tempo.clamped());
XMLNode &after = tmap->get_state();
_session->add_command (new MementoCommand<Temporal::TempoMap> (new Temporal::TempoMap::MementoBinder(), &before, &after));
_session->add_command (new Temporal::TempoCommand (_("change tempo clamp"), &before, &after));
commit_reversible_command ();
TempoMap::update (tmap);
@ -1673,7 +1673,7 @@ Editor::ramp_to_next_tempo ()
tmap->set_ramped (const_cast<Temporal::TempoPoint&>(tempo), !tempo.ramped());
XMLNode &after = tmap->get_state();
_session->add_command (new MementoCommand<Temporal::TempoMap> (new Temporal::TempoMap::MementoBinder(), &before, &after));
_session->add_command (new Temporal::TempoCommand (_("changed tempo ramp"), &before, &after));
commit_reversible_command ();
TempoMap::update (tmap);

View File

@ -7371,7 +7371,7 @@ Editor::define_one_bar (timepos_t const & start, timepos_t const & end)
XMLNode& after (tmap->get_state());
_session->add_command (new MementoCommand<Temporal::TempoMap> (new Temporal::TempoMap::MementoBinder(), &before, &after));
_session->add_command (new Temporal::TempoCommand (_("set tempo from range"), &before, &after));
commit_reversible_command ();
TempoMap::update (tmap);
@ -8316,7 +8316,7 @@ Editor::insert_time (
XMLNode& before (tmap->get_state());
tmap->insert_time (pos, samples);
XMLNode& after (tmap->get_state());
_session->add_command (new MementoCommand<Temporal::TempoMap> (new Temporal::TempoMap::MementoBinder(), &before, &after));
_session->add_command (new Temporal::TempoCommand (_("insert time"), &before, &after));
TempoMap::update (tmap);
}
@ -8498,7 +8498,7 @@ Editor::remove_time (timepos_t const & pos, timecnt_t const & duration, InsertTi
in_command = true;
}
XMLNode& after (tmap->get_state());
_session->add_command (new MementoCommand<Temporal::TempoMap> (new Temporal::TempoMap::MementoBinder(), &before, &after));
_session->add_command (new Temporal::TempoCommand (_("remove time"), &before, &after));
TempoMap::update (tmap);
}

View File

@ -602,7 +602,7 @@ Editor::mouse_add_new_tempo_event (timepos_t pos)
map->set_tempo (map->tempo_at (pos), pos);
XMLNode &after = map->get_state();
_session->add_command (new MementoCommand<Temporal::TempoMap> (new Temporal::TempoMap::MementoBinder(), &before, &after));
_session->add_command (new Temporal::TempoCommand (_("add tempo"), &before, &after));
commit_reversible_command ();
TempoMap::update (map);
@ -649,7 +649,7 @@ Editor::mouse_add_new_meter_event (timepos_t pos)
map->set_meter (Meter (bpb, note_type), pos);
_session->add_command (new MementoCommand<Temporal::TempoMap> (new Temporal::TempoMap::MementoBinder(), &before, &map->get_state()));
_session->add_command (new Temporal::TempoCommand (_("add time signature"), &before, &map->get_state()));
commit_reversible_command ();
TempoMap::update (map);
@ -709,7 +709,7 @@ Editor::edit_meter_section (Temporal::MeterPoint& section)
tmap->set_meter (meter, when);
XMLNode &after = tmap->get_state();
_session->add_command (new MementoCommand<Temporal::TempoMap> (new Temporal::TempoMap::MementoBinder(), &before, &after));
_session->add_command (new Temporal::TempoCommand (_("edit time signature"), &before, &after));
commit_reversible_command ();
TempoMap::update (tmap);
@ -746,7 +746,7 @@ Editor::edit_tempo_section (TempoPoint& section)
tmap->set_tempo (tempo, when);
XMLNode &after = tmap->get_state();
_session->add_command (new MementoCommand<Temporal::TempoMap> (new Temporal::TempoMap::MementoBinder(), &before, &after));
_session->add_command (new Temporal::TempoCommand (_("edit tempo"), &before, &after));
commit_reversible_command ();
TempoMap::update (tmap);
@ -772,7 +772,7 @@ Editor::real_remove_tempo_marker (TempoPoint const * section)
XMLNode &before = tmap->get_state();
tmap->remove_tempo (*section);
XMLNode &after = tmap->get_state();
_session->add_command (new MementoCommand<Temporal::TempoMap> (new Temporal::TempoMap::MementoBinder(), &before, &after));
_session->add_command (new Temporal::TempoCommand (_("remove tempo change"), &before, &after));
commit_reversible_command ();
TempoMap::update (tmap);
@ -809,7 +809,7 @@ Editor::real_remove_meter_marker (Temporal::MeterPoint const * section)
XMLNode &before = tmap->get_state();
tmap->remove_meter (*section);
XMLNode &after = tmap->get_state();
_session->add_command (new MementoCommand<Temporal::TempoMap> (new Temporal::TempoMap::MementoBinder(), &before, &after));
_session->add_command (new Temporal::TempoCommand (_("remove time signature change"), &before, &after));
commit_reversible_command ();
TempoMap::update (tmap);