diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-01-02 04:04:14 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-01-02 04:04:14 +0000 |
commit | 69c7dac1a1ee70c5a4053acdc9dd139c986698a2 (patch) | |
tree | a5a13945a48d27e7ff4adf0ca916ffcab2bb0ef7 /gtk2_ardour/editor_tempodisplay.cc | |
parent | 084fc8b3273d6daeb299773811c7d2bd0e1d5598 (diff) |
new approach to tempo/meter: compute and store the entire map (every bar|beat point), thus enabling us to use the same computation to set the BBT points AND the metric markers (tempo + meter) on the audio timeline. It is known that snapping to the BBT grid doesn't work correctly right now, but this probably caused by the separate code in TempoMap::round_to_type() and i'll dig into that tomorrow. Note that the Bar|beat point list is evaluated "lazily" - we'll never store more than anyone actually needs to display or know, other than 1 minute's worth starting from frame zero
git-svn-id: svn://localhost/ardour2/branches/3.0@11129 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_tempodisplay.cc')
-rw-r--r-- | gtk2_ardour/editor_tempodisplay.cc | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/gtk2_ardour/editor_tempodisplay.cc b/gtk2_ardour/editor_tempodisplay.cc index 89832c5d13..79f5caf82b 100644 --- a/gtk2_ardour/editor_tempodisplay.cc +++ b/gtk2_ardour/editor_tempodisplay.cc @@ -114,7 +114,7 @@ Editor::tempo_map_changed (const PropertyChange& /*ignored*/) tempo_lines->tempo_map_changed(); } - compute_current_bbt_points(leftmost_frame, leftmost_frame + current_page_frames()); + compute_current_bbt_points (leftmost_frame, leftmost_frame + current_page_frames()); _session->tempo_map().apply_with_metrics (*this, &Editor::draw_metric_marks); // redraw metric markers redraw_measures (); update_tempo_based_rulers (); @@ -169,10 +169,8 @@ Editor::compute_current_bbt_points (framepos_t leftmost, framepos_t rightmost) } next_beat.ticks = 0; - delete current_bbt_points; - current_bbt_points = 0; - - current_bbt_points = _session->tempo_map().get_points (_session->tempo_map().frame_time (previous_beat), _session->tempo_map().frame_time (next_beat) + 1); + current_bbt_points.clear(); + _session->tempo_map().map (current_bbt_points, _session->tempo_map().frame_time (previous_beat), _session->tempo_map().frame_time (next_beat) + 1); } void @@ -192,8 +190,7 @@ Editor::redraw_measures () void Editor::draw_measures () { - if (_session == 0 || _show_measures == false || - !current_bbt_points || current_bbt_points->empty()) { + if (_session == 0 || _show_measures == false || current_bbt_points.empty()) { return; } @@ -201,7 +198,7 @@ Editor::draw_measures () tempo_lines = new TempoLines(*track_canvas, time_line_group, physical_screen_height(get_window())); } - tempo_lines->draw(*current_bbt_points, frames_per_unit); + tempo_lines->draw (current_bbt_points, frames_per_unit); } void |