diff options
author | nick_m <mainsbridge@gmail.com> | 2016-04-03 03:57:33 +1000 |
---|---|---|
committer | nick_m <mainsbridge@gmail.com> | 2016-05-27 23:38:14 +1000 |
commit | 96cf262c2302d5115ebf7c375fe701a27d1f50e0 (patch) | |
tree | c4bc18ca79212818b15abf24cd0e933e4e88002f /gtk2_ardour | |
parent | 304875836916ebef7b691f975b4892a18526c6af (diff) |
Tempo ramps - meters can be dragged across each other.
- also removes some fairly silly code,
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/editor_drag.cc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index cd663444ec..537b8ad088 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -3175,8 +3175,11 @@ MeterMarkerDrag::motion (GdkEvent* event, bool first_move) _editor->begin_reversible_command (_("copy meter mark")); Timecode::BBT_Time bbt; - map.bbt_time (_marker->position(), bbt); + map.bbt_time (adjusted_current_frame (event, false), bbt); + /* round bbt to bars */ map.round_bbt (bbt, -1); + + /* we can't add a meter where one currently exists */ if (_real_section->frame() < adjusted_current_frame (event, false)) { ++bbt.bars; } else { @@ -3196,8 +3199,13 @@ MeterMarkerDrag::motion (GdkEvent* event, bool first_move) framepos_t const pf = adjusted_current_frame (event, false); _marker->set_position (pf); if (_marker->meter().position_lock_style() == MusicTime) { - double const baf = _editor->session()->tempo_map().beat_at_frame (_editor->session()->tempo_map().round_to_bar (pf, (RoundMode) 0)); - _editor->session()->tempo_map().gui_move_meter (_real_section, baf); + TempoMap& map (_editor->session()->tempo_map()); + Timecode::BBT_Time bbt; + map.bbt_time (adjusted_current_frame (event, false), bbt); + /* round bbt to bars */ + map.round_bbt (bbt, -1); + const double beat = map.bbt_to_beats (bbt); + _editor->session()->tempo_map().gui_move_meter (_real_section, beat); } else { _editor->session()->tempo_map().gui_move_meter (_real_section, pf); } |