diff options
author | nick_m <mainsbridge@gmail.com> | 2015-12-20 04:41:45 +1100 |
---|---|---|
committer | nick_m <mainsbridge@gmail.com> | 2016-05-27 23:38:09 +1000 |
commit | 7fc3b0c34c552d7be862897bd0aaa542453e9973 (patch) | |
tree | 35898328a86aefec5ac18a00c56c8577f4779d1f /gtk2_ardour/editor.cc | |
parent | 94187e66a2ae2bc2ab082ef614c25b35ec0d5e24 (diff) |
Initial stab at tempo ramps.
Replaces the list of points in TempoMap with TempoSection functions, which
compute tempo-at or tick-at time relative to tempo section start.
TempoMap consults them additively to determine things like bbt_time(),
frame_time() get_grid() etc.
This has a marked effect on scrolling speed along with the code simplification
in the places it has been attempted.
Several things are broken here.
Currently every ramp except the last one is an exponential ramp. this may
be simple to fix :).
Mouse-over midi grid doesn't match mouse click grid. should also be simple.
Many things seem to work, but their accuracy should be in question until
each area has been addressed.
Diffstat (limited to 'gtk2_ardour/editor.cc')
-rw-r--r-- | gtk2_ardour/editor.cc | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 5129a1ffaa..7353b6ff38 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -2185,14 +2185,10 @@ Editor::set_snap_to (SnapType st) case SnapToBeatDiv4: case SnapToBeatDiv3: case SnapToBeatDiv2: { - ARDOUR::TempoMap::BBTPointList::const_iterator current_bbt_points_begin; - ARDOUR::TempoMap::BBTPointList::const_iterator current_bbt_points_end; - - compute_current_bbt_points (leftmost_frame, leftmost_frame + current_page_samples(), - current_bbt_points_begin, current_bbt_points_end); - compute_bbt_ruler_scale (leftmost_frame, leftmost_frame + current_page_samples(), - current_bbt_points_begin, current_bbt_points_end); - update_tempo_based_rulers (current_bbt_points_begin, current_bbt_points_end); + std::vector<TempoMap::BBTPoint> grid; + compute_current_bbt_points (grid, leftmost_frame, leftmost_frame + current_page_samples()); + compute_bbt_ruler_scale (grid, leftmost_frame, leftmost_frame + current_page_samples()); + update_tempo_based_rulers (grid); break; } @@ -3952,11 +3948,9 @@ Editor::set_show_measures (bool yn) tempo_lines->show(); } - ARDOUR::TempoMap::BBTPointList::const_iterator begin; - ARDOUR::TempoMap::BBTPointList::const_iterator end; - - compute_current_bbt_points (leftmost_frame, leftmost_frame + current_page_samples(), begin, end); - draw_measures (begin, end); + std::vector<TempoMap::BBTPoint> grid; + compute_current_bbt_points (grid, leftmost_frame, leftmost_frame + current_page_samples()); + draw_measures (grid); } instant_save (); @@ -4582,14 +4576,10 @@ Editor::visual_changer (const VisualChange& vc) compute_fixed_ruler_scale (); - ARDOUR::TempoMap::BBTPointList::const_iterator current_bbt_points_begin; - ARDOUR::TempoMap::BBTPointList::const_iterator current_bbt_points_end; - - compute_current_bbt_points (vc.time_origin, pending_visual_change.time_origin + current_page_samples(), - current_bbt_points_begin, current_bbt_points_end); - compute_bbt_ruler_scale (vc.time_origin, pending_visual_change.time_origin + current_page_samples(), - current_bbt_points_begin, current_bbt_points_end); - update_tempo_based_rulers (current_bbt_points_begin, current_bbt_points_end); + std::vector<TempoMap::BBTPoint> grid; + compute_current_bbt_points (grid, vc.time_origin, pending_visual_change.time_origin + current_page_samples()); + compute_bbt_ruler_scale (grid, vc.time_origin, pending_visual_change.time_origin + current_page_samples()); + update_tempo_based_rulers (grid); update_video_timeline(); } |