diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 9b9aa55d7d..3787db10a8 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -3448,20 +3448,21 @@ TempoMarkerDrag::motion (GdkEvent* event, bool first_move) } } + if (ArdourKeyboard::indicates_constraint (event->button.state) && ArdourKeyboard::indicates_copy (event->button.state)) { + double new_bpm = max (1.5, _grab_bpm.end_note_types_per_minute() + ((grab_y() - min (-1.0, current_pointer_y())) / 5.0)); + stringstream strs; + _editor->session()->tempo_map().gui_change_tempo (_real_section, Tempo (new_bpm, _real_section->note_type()), true); + strs << "end:" << fixed << setprecision(3) << new_bpm; + show_verbose_cursor_text (strs.str()); - if (ArdourKeyboard::indicates_constraint (event->button.state)) { + } else if (ArdourKeyboard::indicates_constraint (event->button.state)) { + /* use vertical movement to alter tempo .. should be log */ + double new_bpm = max (1.5, _grab_bpm.note_types_per_minute() + ((grab_y() - min (-1.0, current_pointer_y())) / 5.0)); + stringstream strs; + _editor->session()->tempo_map().gui_change_tempo (_real_section, Tempo (new_bpm, _real_section->note_type()), false); + strs << "start:" << fixed << setprecision(3) << new_bpm; + show_verbose_cursor_text (strs.str()); - /** - adjust the end tempo of the previous ramped marker, or start and end tempo if constant. - depending on position lock style, this may or may not move the mark. - */ - framepos_t const pf = adjusted_current_frame (event, false); - map.gui_stretch_tempo_end (&map.tempo_section_at_frame (_real_section->frame() - 1), map.frame_at_quarter_note (_grab_qn), pf); - - ostringstream sstr; - sstr << "end: " << fixed << setprecision(3) << map.tempo_section_at_frame (_real_section->frame() - 1).end_note_types_per_minute() << "\n"; - sstr << "start: " << fixed << setprecision(3) << map.tempo_section_at_frame (_real_section->frame() - 1).note_types_per_minute(); - show_verbose_cursor_text (sstr.str()); } else if (_movable && !_real_section->locked_to_meter()) { framepos_t pf; @@ -3739,7 +3740,7 @@ TempoEndDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor) ostringstream sstr; sstr << "end: " << fixed << setprecision(3) << _tempo->end_note_types_per_minute() << "\n"; - sstr << "mouse: " << fixed << setprecision(3) << map.tempo_at_frame (raw_grab_frame()).note_types_per_minute(); + sstr << "start: " << fixed << setprecision(3) << _tempo->end_note_types_per_minute(); show_verbose_cursor_text (sstr.str()); } @@ -3781,11 +3782,11 @@ TempoEndDrag::motion (GdkEvent* event, bool first_move) framepos_t const pf = adjusted_current_frame (event, false); - map.gui_stretch_tempo_end (_tempo, map.frame_at_quarter_note (_grab_qn), pf); + map.gui_stretch_tempo_end (&map.tempo_section_at_frame (_tempo->frame() - 1), map.frame_at_quarter_note (_grab_qn), pf); ostringstream sstr; sstr << "end: " << fixed << setprecision(3) << _tempo->end_note_types_per_minute() << "\n"; - sstr << "mouse: " << fixed << setprecision(3) << map.tempo_at_frame (pf).note_types_per_minute(); + sstr << "start: " << fixed << setprecision(3) << _tempo->note_types_per_minute(); show_verbose_cursor_text (sstr.str()); } diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index f22d49a7a9..20aa9d2a18 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -686,14 +686,25 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT case TempoMarkerItem: { - _drags->set ( - new TempoMarkerDrag ( - this, - item, - ArdourKeyboard::indicates_copy (event->button.state) - ), - event - ); + if (ArdourKeyboard::indicates_constraint (event->button.state)) { + _drags->set ( + new TempoEndDrag ( + this, + item + ), + event + ); + } else { + _drags->set ( + new TempoMarkerDrag ( + this, + item, + ArdourKeyboard::indicates_copy (event->button.state) + ), + event + ); + } + return true; } @@ -726,12 +737,11 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT if (!Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier) && !ArdourKeyboard::indicates_constraint (event->button.state)) { _drags->set (new CursorDrag (this, *playhead_cursor, false), event); - } else if (ArdourKeyboard::indicates_constraint (event->button.state) && ArdourKeyboard::indicates_copy (event->button.state)) { + } else if (ArdourKeyboard::indicates_constraint (event->button.state) + && Keyboard::modifier_state_contains (event->button.state, Keyboard::SecondaryModifier)) { _drags->set (new TempoTwistDrag (this, item), event); } else if (ArdourKeyboard::indicates_constraint (event->button.state)) { _drags->set (new BBTRulerDrag (this, item), event); - } else if (ArdourKeyboard::indicates_copy (event->button.state)) { - _drags->set (new TempoEndDrag ( this, item), event); } return true; break;