final tweaks for #4489
[ardour.git] / gtk2_ardour / editor_tempodisplay.cc
index ac6c572af45434022233132bef9b48f74d3a0b11..1069e457e635efa1dab9f7576e5b9116c838ff21 100644 (file)
 
 */
 
+#ifdef WAF_BUILD
+#include "gtk2ardour-config.h"
+#endif
+
 #include <cstdio> // for sprintf, grrr
 #include <cstdlib>
 #include <cmath>
@@ -109,6 +113,7 @@ Editor::tempo_map_changed (const PropertyChange& /*ignored*/)
        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 ();
 }
 
 void
@@ -120,7 +125,6 @@ Editor::redisplay_tempo (bool immediate_redraw)
 
        compute_current_bbt_points (leftmost_frame, leftmost_frame + current_page_frames()); // redraw rulers and measures
 
-       compute_current_bbt_points (leftmost_frame, leftmost_frame + current_page_frames());
        if (immediate_redraw) {
                redraw_measures ();
        } else {
@@ -134,13 +138,13 @@ Editor::redisplay_tempo (bool immediate_redraw)
 }
 
 void
-Editor::compute_current_bbt_points (nframes_t leftmost, nframes_t rightmost)
+Editor::compute_current_bbt_points (framepos_t leftmost, framepos_t rightmost)
 {
        if (!_session) {
                return;
        }
 
-       BBT_Time previous_beat, next_beat; // the beats previous to the leftmost frame and after the rightmost frame
+       Timecode::BBT_Time previous_beat, next_beat; // the beats previous to the leftmost frame and after the rightmost frame
 
        _session->bbt_time(leftmost, previous_beat);
        _session->bbt_time(rightmost, next_beat);
@@ -220,7 +224,7 @@ Editor::mouse_add_new_tempo_event (framepos_t frame)
        }
 
        double bpm = 0;
-       BBT_Time requested;
+       Timecode::BBT_Time requested;
 
        bpm = tempo_dialog.get_bpm ();
        double nt = tempo_dialog.get_note_type();
@@ -267,7 +271,7 @@ Editor::mouse_add_new_meter_event (framepos_t frame)
        bpb = max (1.0, bpb); // XXX is this a reasonable limit?
 
        double note_type = meter_dialog.get_note_type ();
-       BBT_Time requested;
+       Timecode::BBT_Time requested;
 
        meter_dialog.get_bbt_time (requested);
 
@@ -348,7 +352,7 @@ Editor::edit_tempo_section (TempoSection* section)
 
        double bpm = tempo_dialog.get_bpm ();
        double nt = tempo_dialog.get_note_type ();
-       BBT_Time when;
+       Timecode::BBT_Time when;
        tempo_dialog.get_bbt_time(when);
        bpm = max (0.01, bpm);