13
0

remove tempo end drag (the control drag on the curve). a;ter tempo marker drag.

- holding down shift before initiating a tempo mark drag
	  alters the end tempo of the previous one as before, but
	  this is now a separate drag.
	- restore vertical dragging of the tempo mark to alter start/
	  end tempo. shift during the makrker drag alters start tempo.
	  xontrol + shift during the drag alters end tempo.
This commit is contained in:
nick_m 2017-02-26 05:07:51 +11:00 committed by Robin Gareus
parent c9387055e4
commit 211226983d
2 changed files with 37 additions and 26 deletions

View File

@ -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());
}

View File

@ -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;