+
+ tempo_curves.sort (CurveComparator());
+
+ const double min_tempo_range = 5.0;
+ const double tempo_delta = fabs (max_tempo - min_tempo);
+
+ if (tempo_delta < min_tempo_range) {
+ max_tempo += min_tempo_range - tempo_delta;
+ min_tempo += tempo_delta - min_tempo_range;
+ }
+
+ for (Curves::iterator x = tempo_curves.begin(); x != tempo_curves.end(); ) {
+ Curves::iterator tmp = x;
+ (*x)->set_max_tempo (max_tempo);
+ (*x)->set_min_tempo (min_tempo);
+ ++tmp;
+ if (tmp != tempo_curves.end()) {
+ (*x)->set_position ((*x)->tempo().frame(), (*tmp)->tempo().frame());
+ } else {
+ (*x)->set_position ((*x)->tempo().frame(), UINT32_MAX);
+ }
+ ++x;
+ }
+
+ for (Marks::iterator x = metric_marks.begin(); x != metric_marks.end(); ++x) {
+ TempoMarker* tempo_marker;
+ if ((tempo_marker = dynamic_cast<TempoMarker*> (*x)) != 0) {
+ tempo_marker->update_height_mark ((tempo_marker->tempo().beats_per_minute() - min_tempo) / max (max_tempo - min_tempo, 10.0));
+ }
+ }
+