Flesh out RDFF documentation.
[ardour.git] / gtk2_ardour / editor_tempodisplay.cc
index 9995c50a711e35d642958ac7283cd2d850b3fc16..2e4842016a6673ecb08942f21f5123bb26f8a73d 100644 (file)
 
 */
 
+#ifdef WAF_BUILD
+#include "gtk2ardour-config.h"
+#endif
+
 #include <cstdio> // for sprintf, grrr
 #include <cstdlib>
 #include <cmath>
@@ -45,6 +49,7 @@
 #include "time_axis_view.h"
 #include "ardour_ui.h"
 #include "tempo_lines.h"
+#include "utils.h"
 
 #include "i18n.h"
 
@@ -93,13 +98,13 @@ Editor::draw_metric_marks (const Metrics& metrics)
 }
 
 void
-Editor::tempo_map_changed (Change ignored)
+Editor::tempo_map_changed (const PropertyChange& /*ignored*/)
 {
        if (!_session) {
                return;
        }
 
-       ENSURE_GUI_THREAD (*this, &Editor::tempo_map_changed ignored);
+       ENSURE_GUI_THREAD (*this, &Editor::tempo_map_changed, ignored);
 
        if (tempo_lines) {
                tempo_lines->tempo_map_changed();
@@ -133,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);
@@ -189,14 +194,14 @@ Editor::draw_measures ()
        }
 
        if (tempo_lines == 0) {
-               tempo_lines = new TempoLines(*track_canvas, time_line_group, physical_screen_height);
+               tempo_lines = new TempoLines(*track_canvas, time_line_group, physical_screen_height(get_window()));
        }
 
        tempo_lines->draw(*current_bbt_points, frames_per_unit);
 }
 
 void
-Editor::mouse_add_new_tempo_event (nframes64_t frame)
+Editor::mouse_add_new_tempo_event (framepos_t frame)
 {
        if (_session == 0) {
                return;
@@ -219,7 +224,7 @@ Editor::mouse_add_new_tempo_event (nframes64_t frame)
        }
 
        double bpm = 0;
-       BBT_Time requested;
+       Timecode::BBT_Time requested;
 
        bpm = tempo_dialog.get_bpm ();
        double nt = tempo_dialog.get_note_type();
@@ -238,7 +243,7 @@ Editor::mouse_add_new_tempo_event (nframes64_t frame)
 }
 
 void
-Editor::mouse_add_new_meter_event (nframes64_t frame)
+Editor::mouse_add_new_meter_event (framepos_t frame)
 {
        if (_session == 0) {
                return;
@@ -266,7 +271,7 @@ Editor::mouse_add_new_meter_event (nframes64_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);
 
@@ -296,7 +301,7 @@ Editor::remove_tempo_marker (ArdourCanvas::Item* item)
        }
 
        if (tempo_marker->tempo().movable()) {
-         Glib::signal_idle().connect (sigc::bind (sigc::mem_fun(*this, &Editor::real_remove_tempo_marker), &tempo_marker->tempo()));
+               Glib::signal_idle().connect (sigc::bind (sigc::mem_fun(*this, &Editor::real_remove_tempo_marker), &tempo_marker->tempo()));
        }
 }
 
@@ -347,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);