- track_canvas.get_scroll_region (x1, y1, x2, y2);
- y2 = TimeAxisView::hLargest*5000; // five thousand largest tracks should be enough.. :)
-
- /* get the first bar spacing */
-
- i = current_bbt_points->end();
- i--;
- bars = (*i).bar - (*current_bbt_points->begin()).bar;
- beats = current_bbt_points->size() - bars;
-
- beat_density = (beats * 10.0f) / track_canvas.get_width ();
-
- if (beat_density > 4.0f) {
- /* if the lines are too close together, they become useless
- */
- return;
- }
-
- for (i = current_bbt_points->begin(); i != current_bbt_points->end(); ++i) {
-
- switch ((*i).type) {
- case TempoMap::Bar:
- break;
-
- case TempoMap::Beat:
-
- if ((*i).beat == 1) {
- color = Config->canvasvar_MeasureLineBar.get();
- } else {
- color = Config->canvasvar_MeasureLineBeat.get();
-
- if (beat_density > 2.0) {
- /* only draw beat lines if the gaps between beats are large.
- */
- break;
- }
- }
-
- xpos = frame_to_unit ((*i).frame);
- line = get_time_line ();
- line->property_x1() = xpos;
- line->property_x2() = xpos;
- line->property_y2() = y2;
- line->property_color_rgba() = color;
- //line->raise_to_top();
- line->show();
- break;
- }
+ if (tempo_lines == 0) {
+ tempo_lines = new TempoLines(*track_canvas, time_line_group, physical_screen_height(get_window()));