summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2016-03-27 10:26:15 +1100
committernick_m <mainsbridge@gmail.com>2016-05-27 23:38:12 +1000
commitcb43d485fa8c6856229e7a6ceb163b4607be2cc2 (patch)
tree2846f42f867ec7ee1d5e9761b42b96709d189bff /gtk2_ardour
parent4de28f07456fb2c92c814dc0efc04a8675452033 (diff)
Tempo ramps - another approach to first meter/tempo.
- first tempo is glued to first meter position as they are now both locked to AudioTime. - all existing audio-locked tempos to the left of the first meter are made inactive. all to the right are made active.
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/editor_drag.cc19
-rw-r--r--gtk2_ardour/editor_markers.cc3
2 files changed, 18 insertions, 4 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc
index 61348ede9a..15246fb8fe 100644
--- a/gtk2_ardour/editor_drag.cc
+++ b/gtk2_ardour/editor_drag.cc
@@ -3262,7 +3262,11 @@ void
TempoMarkerDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor)
{
Drag::start_grab (event, cursor);
- show_verbose_cursor_time (adjusted_current_frame (event));
+ if (!_real_section->active()) {
+ show_verbose_cursor_text (_("inactive"));
+ } else {
+ show_verbose_cursor_time (adjusted_current_frame (event));
+ }
}
void
@@ -3274,6 +3278,9 @@ TempoMarkerDrag::setup_pointer_frame_offset ()
void
TempoMarkerDrag::motion (GdkEvent* event, bool first_move)
{
+ if (!_real_section->active()) {
+ return;
+ }
if (first_move) {
// create a dummy marker for visual representation of moving the
@@ -3313,9 +3320,11 @@ TempoMarkerDrag::motion (GdkEvent* event, bool first_move)
Tempo const tp = _marker->tempo();
if (Keyboard::modifier_state_equals (event->button.state, ArdourKeyboard::constraint_modifier ())) {
- //_marker->set_position (pf);
double new_bpm = _real_section->beats_per_minute() + ((last_pointer_y() - current_pointer_y()) / 5.0);
_editor->session()->tempo_map().gui_change_tempo (_real_section, Tempo (new_bpm, _real_section->note_type()));
+ stringstream strs;
+ strs << new_bpm;
+ show_verbose_cursor_text (strs.str());
} else if (_movable) {
_marker->set_position (pf);
@@ -3327,14 +3336,16 @@ TempoMarkerDrag::motion (GdkEvent* event, bool first_move)
*/
_editor->session()->tempo_map().gui_move_tempo_frame (_real_section, tp, pf);
//}
+ show_verbose_cursor_time (pf);
}
-
- show_verbose_cursor_time (pf);
}
void
TempoMarkerDrag::finished (GdkEvent* event, bool movement_occurred)
{
+ if (!_real_section->active()) {
+ return;
+ }
if (!movement_occurred) {
if (was_double_click()) {
_editor->edit_tempo_marker (*_marker);
diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc
index ad2457fd31..b1caf72a6b 100644
--- a/gtk2_ardour/editor_markers.cc
+++ b/gtk2_ardour/editor_markers.cc
@@ -809,6 +809,9 @@ Editor::tempo_or_meter_marker_context_menu (GdkEventButton* ev, ArdourCanvas::It
if (mm) {
can_remove = mm->meter().movable ();
} else if (tm) {
+ if (!tm->tempo().active()) {
+ return;
+ }
can_remove = tm->tempo().movable ();
} else {
return;