diff options
author | nick_m <mainsbridge@gmail.com> | 2016-04-26 03:21:48 +1000 |
---|---|---|
committer | nick_m <mainsbridge@gmail.com> | 2016-05-27 23:38:15 +1000 |
commit | e0607ca913bde8f3551cb8e7dc0d3bec5203159c (patch) | |
tree | 5e5619a966f086b3ea7590cfe4ac515c44a57e5a /gtk2_ardour | |
parent | 54758ddd4a339b5d2e2e8bedfb4187f2f98ce51c (diff) |
Tempo ramps - add gui dilation of tempos.
- a meter can be dragged using the constraint modifier, which
sets the previous tempo accordingly.
This could be added to the bbt ruler to allow direct dragging
of beats and bars, but the exact behavior of that is still
undecided. comments?
- also preliminary work on the necessary tempos locked to
audio-locked meters.
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/editor_drag.cc | 10 | ||||
-rw-r--r-- | gtk2_ardour/editor_markers.cc | 9 | ||||
-rw-r--r-- | gtk2_ardour/editor_mouse.cc | 2 |
3 files changed, 15 insertions, 6 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 63fff4e463..53f1e74232 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -3201,7 +3201,9 @@ MeterMarkerDrag::motion (GdkEvent* event, bool first_move) /* round bbt to bars */ map.round_bbt (bbt, -1); - if (bbt.bars > _real_section->bbt().bars) { + if (Keyboard::modifier_state_equals (event->button.state, ArdourKeyboard::constraint_modifier ())) { + _editor->session()->tempo_map().gui_dilate_tempo (_real_section, pf); + } else if (bbt.bars > _real_section->bbt().bars) { const double pulse = _real_section->pulse() + (_real_section->note_divisor() / _real_section->divisions_per_bar()); _editor->session()->tempo_map().gui_move_meter (_real_section, pulse); } else if (bbt.bars < _real_section->bbt().bars) { @@ -3210,7 +3212,11 @@ MeterMarkerDrag::motion (GdkEvent* event, bool first_move) _editor->session()->tempo_map().gui_move_meter (_real_section, pulse); } } else { - _editor->session()->tempo_map().gui_move_meter (_real_section, pf); + if (Keyboard::modifier_state_equals (event->button.state, ArdourKeyboard::constraint_modifier ())) { + _editor->session()->tempo_map().gui_dilate_tempo (_real_section, pf); + } else { + _editor->session()->tempo_map().gui_move_meter (_real_section, pf); + } } _marker->set_position (pf); show_verbose_cursor_time (_real_section->frame()); diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc index 74e35a246b..9664d6f65f 100644 --- a/gtk2_ardour/editor_markers.cc +++ b/gtk2_ardour/editor_markers.cc @@ -1426,9 +1426,12 @@ Editor::toggle_tempo_type () begin_reversible_command (_("change tempo type")); XMLNode &before = _session->tempo_map().get_state(); TempoSection* tsp = &tm->tempo(); - _session->tempo_map().replace_tempo (*tsp, Tempo (tsp->beats_per_minute(), tsp->note_type()) - , (tsp->position_lock_style() == MusicTime) ? tsp->pulse() : tsp->frame() - , (tsp->type() == TempoSection::Ramp) ? TempoSection::Constant : TempoSection::Ramp); + if (tsp->position_lock_style() == AudioTime) { + _session->tempo_map().replace_tempo (*tsp, Tempo (tsp->beats_per_minute(), tsp->note_type()), tsp->frame(), (tsp->type() == TempoSection::Ramp) ? TempoSection::Constant : TempoSection::Ramp); + } else { + _session->tempo_map().replace_tempo (*tsp, Tempo (tsp->beats_per_minute(), tsp->note_type()), tsp->pulse(), (tsp->type() == TempoSection::Ramp) ? TempoSection::Constant : TempoSection::Ramp); + } + XMLNode &after = _session->tempo_map().get_state(); _session->add_command(new MementoCommand<TempoMap>(_session->tempo_map(), &before, &after)); commit_reversible_command (); diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index 49aaac68bf..4a4bfe1e1e 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -697,7 +697,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT new MeterMarkerDrag ( this, item, - Keyboard::modifier_state_contains (event->button.state, Keyboard::CopyModifier) + Keyboard::modifier_state_equals (event->button.state, Keyboard::CopyModifier) ), event ); |