summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_markers.cc
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2016-04-16 07:07:42 +1000
committernick_m <mainsbridge@gmail.com>2016-05-27 23:38:15 +1000
commit4f8fa6787a160f1951081c3782697c5bdd1c1ed9 (patch)
tree30f0fcda7012f46ec3045a77998019857dd6e741 /gtk2_ardour/editor_markers.cc
parenteb70cdce1f7feeac76d2b87bf140d62e666489f5 (diff)
Tempo ramps - add undo to right-click lock style & ramp type changes.
Diffstat (limited to 'gtk2_ardour/editor_markers.cc')
-rw-r--r--gtk2_ardour/editor_markers.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc
index c597ec292d..74e35a246b 100644
--- a/gtk2_ardour/editor_markers.cc
+++ b/gtk2_ardour/editor_markers.cc
@@ -1389,19 +1389,29 @@ Editor::toggle_marker_lock_style ()
dynamic_cast_marker_object (marker_menu_item->get_data ("marker"), &mm, &tm);
if (mm) {
+ begin_reversible_command (_("change meter lock style"));
+ XMLNode &before = _session->tempo_map().get_state();
MeterSection* msp = &mm->meter();
if (mm->meter().position_lock_style() == AudioTime) {
_session->tempo_map().replace_meter (*msp, Meter (msp->divisions_per_bar(), msp->note_divisor()), msp->bbt());
} else {
_session->tempo_map().replace_meter (*msp, Meter (msp->divisions_per_bar(), msp->note_divisor()), msp->frame());
}
+ XMLNode &after = _session->tempo_map().get_state();
+ _session->add_command(new MementoCommand<TempoMap>(_session->tempo_map(), &before, &after));
+ commit_reversible_command ();
} else if (tm) {
+ begin_reversible_command (_("change tempo lock style"));
+ XMLNode &before = _session->tempo_map().get_state();
TempoSection* tsp = &tm->tempo();
if (tsp->position_lock_style() == AudioTime) {
_session->tempo_map().replace_tempo (*tsp, Tempo (tsp->beats_per_minute(), tsp->note_type()), tsp->pulse(), tsp->type());
} else {
_session->tempo_map().replace_tempo (*tsp, Tempo (tsp->beats_per_minute(), tsp->note_type()), tsp->frame(), tsp->type());
}
+ XMLNode &after = _session->tempo_map().get_state();
+ _session->add_command(new MementoCommand<TempoMap>(_session->tempo_map(), &before, &after));
+ commit_reversible_command ();
}
}
@@ -1413,10 +1423,15 @@ Editor::toggle_tempo_type ()
dynamic_cast_marker_object (marker_menu_item->get_data ("marker"), &mm, &tm);
if (tm) {
+ begin_reversible_command (_("change tempo type"));
+ XMLNode &before = _session->tempo_map().get_state();
TempoSection* tsp = &tm->tempo();
_session->tempo_map().replace_tempo (*tsp, Tempo (tsp->beats_per_minute(), tsp->note_type())
, (tsp->position_lock_style() == MusicTime) ? tsp->pulse() : tsp->frame()
, (tsp->type() == TempoSection::Ramp) ? TempoSection::Constant : TempoSection::Ramp);
+ XMLNode &after = _session->tempo_map().get_state();
+ _session->add_command(new MementoCommand<TempoMap>(_session->tempo_map(), &before, &after));
+ commit_reversible_command ();
}
}