From c6a66f1014a41a4752860878c59ee323ecd66ee8 Mon Sep 17 00:00:00 2001 From: nick_m Date: Thu, 14 Apr 2016 04:38:16 +1000 Subject: Tempo ramps - redraw after setting tempo type (ramped, constant) from context menu. - not needed for lock style change. --- gtk2_ardour/editor_markers.cc | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'gtk2_ardour') diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc index 40bf2dc325..3d5977ed76 100644 --- a/gtk2_ardour/editor_markers.cc +++ b/gtk2_ardour/editor_markers.cc @@ -982,16 +982,19 @@ Editor::build_tempo_marker_menu (TempoMarker* loc, bool can_remove) tempo_marker_menu = new Menu; MenuList& items = tempo_marker_menu->items(); tempo_marker_menu->set_name ("ArdourContextMenu"); + if (loc->tempo().type() == TempoSection::Constant) { - items.push_back (MenuElem (_("Ramped"), sigc::mem_fun(*this, &Editor::toggle_tempo_type))); + items.push_back (MenuElem (_("Make Ramped"), sigc::mem_fun(*this, &Editor::toggle_tempo_type))); } else { - items.push_back (MenuElem (_("Constant"), sigc::mem_fun(*this, &Editor::toggle_tempo_type))); + items.push_back (MenuElem (_("Make Constant"), sigc::mem_fun(*this, &Editor::toggle_tempo_type))); } - if (loc->tempo().position_lock_style() == AudioTime) { + + if (loc->tempo().position_lock_style() == AudioTime && can_remove) { items.push_back (MenuElem (_("Lock to Music"), sigc::mem_fun(*this, &Editor::toggle_marker_lock_style))); - } else { + } else if (can_remove) { items.push_back (MenuElem (_("Lock to Audio"), sigc::mem_fun(*this, &Editor::toggle_marker_lock_style))); } + items.push_back (MenuElem (_("Edit..."), sigc::mem_fun(*this, &Editor::marker_menu_edit))); items.push_back (MenuElem (_("Remove"), sigc::mem_fun(*this, &Editor::marker_menu_remove))); @@ -1006,11 +1009,13 @@ Editor::build_meter_marker_menu (MeterMarker* loc, bool can_remove) meter_marker_menu = new Menu; MenuList& items = meter_marker_menu->items(); meter_marker_menu->set_name ("ArdourContextMenu"); - if (loc->meter().position_lock_style() == AudioTime) { + + if (loc->meter().position_lock_style() == AudioTime && can_remove) { items.push_back (MenuElem (_("Lock to Music"), sigc::mem_fun(*this, &Editor::toggle_marker_lock_style))); - } else { + } else if (can_remove) { items.push_back (MenuElem (_("Lock to Audio"), sigc::mem_fun(*this, &Editor::toggle_marker_lock_style))); } + items.push_back (MenuElem (_("Edit..."), sigc::mem_fun(*this, &Editor::marker_menu_edit))); items.push_back (MenuElem (_("Remove"), sigc::mem_fun(*this, &Editor::marker_menu_remove))); @@ -1406,10 +1411,11 @@ Editor::toggle_tempo_type () dynamic_cast_marker_object (marker_menu_item->get_data ("marker"), &mm, &tm); if (tm) { + TempoSection* tsp = &tm->tempo(); if (tm->tempo().type() == TempoSection::Constant) { - tm->tempo().set_type (TempoSection::Ramp); + _session->tempo_map().replace_tempo (*tsp, Tempo (tsp->beats_per_minute(), tsp->note_type()), tsp->pulse(), TempoSection::Ramp); } else { - tm->tempo().set_type (TempoSection::Constant); + _session->tempo_map().replace_tempo (*tsp, Tempo (tsp->beats_per_minute(), tsp->note_type()), tsp->pulse(), TempoSection::Constant); } } } -- cgit v1.2.3