summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2016-03-26 04:48:29 +1100
committernick_m <mainsbridge@gmail.com>2016-05-27 23:38:12 +1000
commit69b6379b232f7017892b897f4838f273392f4dc2 (patch)
treec08074af385857c564af73dd39eb73d742c812de /gtk2_ardour
parent1be5a427378e511427b2bff2ee0cd6a0709791b9 (diff)
Tempo ramps - pressing constraint modifier keys during tempo drag changes tempo with vertical movement, incorporating beat constraint (if present).
- makes it easy to find suitable accelerandos for hit points in conjunction with playhead position, beat-locked tempos and initial meter frame.
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/editor_drag.cc29
-rw-r--r--gtk2_ardour/editor_drag.h2
-rw-r--r--gtk2_ardour/editor_mouse.cc2
-rw-r--r--gtk2_ardour/editor_tempodisplay.cc3
4 files changed, 23 insertions, 13 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc
index 77c3e3928e..71367d7a62 100644
--- a/gtk2_ardour/editor_drag.cc
+++ b/gtk2_ardour/editor_drag.cc
@@ -3312,17 +3312,24 @@ TempoMarkerDrag::motion (GdkEvent* event, bool first_move)
_marker->hide();
}
- framepos_t const pf = adjusted_current_frame (event, false);
+ framepos_t const pf = adjusted_current_frame (event);
Tempo const tp = _marker->tempo();
_marker->set_position (pf);
- /* just here for a check/laugh
- if (_real_section->position_lock_style() == MusicTime) {
- const double baf = _editor->session()->tempo_map().beat_at_frame (pf);
- _editor->session()->tempo_map().gui_move_tempo_beat (_real_section, tp, baf);
+
+ if (Keyboard::modifier_state_equals (event->button.state, ArdourKeyboard::constraint_modifier ())) {
+ double new_bpm = tp.beats_per_minute() + ((grab_y() - current_pointer_y()) / 4.0);
+ _real_section->set_beats_per_minute (new_bpm);
+ _editor->session()->tempo_map().gui_change_tempo (_real_section, Tempo (new_bpm, _real_section->note_type()));
} else {
- */
- _editor->session()->tempo_map().gui_move_tempo_frame (_real_section, tp, pf);
- //}
+ /* just here for a check/laugh
+ if (_real_section->position_lock_style() == MusicTime) {
+ const double baf = _editor->session()->tempo_map().beat_at_frame (pf);
+ _editor->session()->tempo_map().gui_move_tempo_beat (_real_section, tp, baf);
+ } else {
+ */
+ _editor->session()->tempo_map().gui_move_tempo_frame (_real_section, tp, pf);
+ //}
+ }
show_verbose_cursor_time (pf);
}
@@ -3362,11 +3369,11 @@ TempoMarkerDrag::finished (GdkEvent* event, bool movement_occurred)
} else {
if (_marker->tempo().position_lock_style() == MusicTime) {
- double const pulse = map.predict_tempo_pulse (_real_section, _marker->tempo(), _real_section->frame());
- map.replace_tempo (*_real_section, Tempo (_marker->tempo().beats_per_minute(), _marker->tempo().note_type())
+ double const pulse = map.predict_tempo_pulse (_real_section, Tempo (_real_section->beats_per_minute(), _real_section->note_type()), _real_section->frame());
+ map.replace_tempo (*_real_section, Tempo (_real_section->beats_per_minute(), _real_section->note_type())
, pulse, _marker->tempo().type());
} else {
- map.replace_tempo (*_real_section, Tempo (_marker->tempo().beats_per_minute(), _marker->tempo().note_type())
+ map.replace_tempo (*_real_section, Tempo (_real_section->beats_per_minute(), _real_section->note_type())
, _real_section->frame(), _marker->tempo().type());
}
diff --git a/gtk2_ardour/editor_drag.h b/gtk2_ardour/editor_drag.h
index 26029299ce..1864514753 100644
--- a/gtk2_ardour/editor_drag.h
+++ b/gtk2_ardour/editor_drag.h
@@ -727,7 +727,7 @@ public:
}
bool y_movement_matters () const {
- return false;
+ return true;
}
void setup_pointer_frame_offset ();
diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc
index a1a7b793b6..49aaac68bf 100644
--- a/gtk2_ardour/editor_mouse.cc
+++ b/gtk2_ardour/editor_mouse.cc
@@ -684,7 +684,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
new TempoMarkerDrag (
this,
item,
- Keyboard::modifier_state_contains (event->button.state, Keyboard::CopyModifier)
+ Keyboard::modifier_state_equals (event->button.state, Keyboard::CopyModifier)
),
event
);
diff --git a/gtk2_ardour/editor_tempodisplay.cc b/gtk2_ardour/editor_tempodisplay.cc
index 02b7027442..b6db6280e4 100644
--- a/gtk2_ardour/editor_tempodisplay.cc
+++ b/gtk2_ardour/editor_tempodisplay.cc
@@ -143,6 +143,9 @@ Editor::marker_position_changed ()
if ((tempo_marker = dynamic_cast<TempoMarker*> (*x)) != 0) {
if ((ts = &tempo_marker->tempo()) != 0) {
tempo_marker->set_position (ts->frame ());
+ char buf[64];
+ snprintf (buf, sizeof (buf), "%.2f", ts->beats_per_minute());
+ tempo_marker->set_name (buf);
}
}
if ((meter_marker = dynamic_cast<MeterMarker*> (*x)) != 0) {