summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_markers.cc
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2016-04-14 04:38:16 +1000
committernick_m <mainsbridge@gmail.com>2016-05-27 23:38:15 +1000
commitc6a66f1014a41a4752860878c59ee323ecd66ee8 (patch)
tree0fa9f5543da58b3beec6826413f93f38939338a1 /gtk2_ardour/editor_markers.cc
parent85c3284adcb3287dec99b82e5b9f4d1857c37d44 (diff)
Tempo ramps - redraw after setting tempo type (ramped, constant) from context menu.
- not needed for lock style change.
Diffstat (limited to 'gtk2_ardour/editor_markers.cc')
-rw-r--r--gtk2_ardour/editor_markers.cc22
1 files changed, 14 insertions, 8 deletions
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);
}
}
}