summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_markers.cc
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2017-07-21 00:17:58 +1000
committernick_m <mainsbridge@gmail.com>2017-07-22 02:15:20 +1000
commit2925fd52e56bfbc11f8034d25bc1d3b1fd88306e (patch)
tree2f3fd5bd15b64330b9b9ed59000803ee242fed24 /gtk2_ardour/editor_markers.cc
parent1c51435fa35e6a5a60076b3226beac1dc8172cb1 (diff)
Rework tempo marker editing menu functions
Setting a tempo to 'Continue' via right click puts it in a permanent state of continuing the previous section's end tempo (basically what 'Lock Continue' should have been). This can be disabled (unlocked) by selecting 'Don't Continue'. Remove the previous temporary 'Continue' function. Reorganise menu to separate position lock style from more commonly used functions.
Diffstat (limited to 'gtk2_ardour/editor_markers.cc')
-rw-r--r--gtk2_ardour/editor_markers.cc48
1 files changed, 9 insertions, 39 deletions
diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc
index 6fda0ad3f1..996b5878bd 100644
--- a/gtk2_ardour/editor_markers.cc
+++ b/gtk2_ardour/editor_markers.cc
@@ -1000,15 +1000,14 @@ Editor::build_tempo_marker_menu (TempoMarker* loc, bool can_remove)
if (!loc->tempo().initial()) {
if (loc->tempo().clamped()) {
- items.push_back (MenuElem (_("Unlock Continue"), sigc::mem_fun(*this, &Editor::toggle_tempo_clamped)));
+ items.push_back (MenuElem (_("Don't Continue"), sigc::mem_fun(*this, &Editor::toggle_tempo_clamped)));
} else {
- items.push_back (MenuElem (_("Lock Continue"), sigc::mem_fun(*this, &Editor::toggle_tempo_clamped)));
+ items.push_back (MenuElem (_("Continue"), sigc::mem_fun(*this, &Editor::toggle_tempo_clamped)));
}
+ }
- TempoSection* prev_ts = _session->tempo_map().previous_tempo_section (&loc->tempo());
- if (prev_ts && prev_ts->end_note_types_per_minute() != loc->tempo().note_types_per_minute()) {
- items.push_back (MenuElem (_("Continue"), sigc::mem_fun(*this, &Editor::continue_previous_tempo)));
- }
+ if (loc->tempo().type() == TempoSection::Ramp) {
+ items.push_back (MenuElem (_("Set Constant"), sigc::mem_fun(*this, &Editor::toggle_tempo_type)));
}
TempoSection* next_ts = _session->tempo_map().next_tempo_section (&loc->tempo());
@@ -1016,16 +1015,16 @@ Editor::build_tempo_marker_menu (TempoMarker* loc, bool can_remove)
items.push_back (MenuElem (_("Ramp to Next"), sigc::mem_fun(*this, &Editor::ramp_to_next_tempo)));
}
- if (loc->tempo().type() == TempoSection::Ramp) {
- items.push_back (MenuElem (_("Set Constant"), sigc::mem_fun(*this, &Editor::toggle_tempo_type)));
- }
-
if (loc->tempo().position_lock_style() == AudioTime && can_remove) {
+ items.push_back (SeparatorElem());
items.push_back (MenuElem (_("Lock to Music"), sigc::mem_fun(*this, &Editor::toggle_marker_lock_style)));
} else if (can_remove) {
+ items.push_back (SeparatorElem());
items.push_back (MenuElem (_("Lock to Audio"), sigc::mem_fun(*this, &Editor::toggle_marker_lock_style)));
}
+ items.push_back (SeparatorElem());
+
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)));
items.back().set_sensitive (can_remove);
@@ -1506,35 +1505,6 @@ Editor::toggle_tempo_clamped ()
}
void
-Editor::continue_previous_tempo ()
-{
- TempoMarker* tm;
- MeterMarker* mm;
- dynamic_cast_marker_object (marker_menu_item->get_data ("marker"), &mm, &tm);
-
- if (tm) {
- TempoMap& tmap (_session->tempo_map());
- TempoSection* tsp = &tm->tempo();
- TempoSection* prev_ts = tmap.previous_tempo_section (&tm->tempo());
- if (prev_ts) {
- const Tempo tempo (prev_ts->end_note_types_per_minute(), tsp->note_type(), tsp->end_note_types_per_minute());
- const double pulse = tsp->pulse();
- const framepos_t frame = tsp->frame();
- const PositionLockStyle pls = tsp->position_lock_style();
-
- begin_reversible_command (_("continue previous tempo"));
- XMLNode &before = _session->tempo_map().get_state();
-
- tmap.replace_tempo (*tsp, tempo, pulse, frame, pls);
-
- XMLNode &after = _session->tempo_map().get_state();
- _session->add_command(new MementoCommand<TempoMap>(_session->tempo_map(), &before, &after));
- commit_reversible_command ();
- }
- }
-}
-
-void
Editor::ramp_to_next_tempo ()
{
TempoMarker* tm;