poor man's display of end tempo for ramps.

This commit is contained in:
nick_m 2017-02-27 11:59:16 +11:00 committed by Robin Gareus
parent f3ada6f893
commit f69f546717
1 changed files with 22 additions and 7 deletions

View File

@ -105,12 +105,19 @@ Editor::draw_metric_marks (const Metrics& metrics)
}
} else if ((ts = dynamic_cast<TempoSection*>(*i)) != 0) {
if (ts->note_type() != 4.0) {
snprintf (buf, sizeof (buf), "%.3f/%.0f", ts->note_types_per_minute(), ts->note_type());
if (ts->type() == TempoSection::Constant) {
if (ts->note_type() != 4.0) {
snprintf (buf, sizeof (buf), "%.3f/%.0f", ts->note_types_per_minute(), ts->note_type());
} else {
snprintf (buf, sizeof (buf), "%.3f", ts->note_types_per_minute());
}
} else {
snprintf (buf, sizeof (buf), "%.3f", ts->note_types_per_minute());
if (ts->note_type() != 4.0) {
snprintf (buf, sizeof (buf), "%.3f/%.0f>%.3f", ts->note_types_per_minute(), ts->note_type(), ts->end_note_types_per_minute());
} else {
snprintf (buf, sizeof (buf), "%.3f>%.3f", ts->note_types_per_minute(), ts->end_note_types_per_minute());
}
}
max_tempo = max (max_tempo, ts->note_types_per_minute());
max_tempo = max (max_tempo, ts->end_note_types_per_minute());
min_tempo = min (min_tempo, ts->note_types_per_minute());
@ -234,10 +241,18 @@ Editor::tempometric_position_changed (const PropertyChange& /*ignored*/)
tempo_marker->set_points_color (UIConfiguration::instance().color ("tempo marker"));
}
if (ts->note_type() != 4.0) {
snprintf (buf, sizeof (buf), "%.3f/%.0f", ts->note_types_per_minute(), ts->note_type());
if (ts->type() == TempoSection::Constant) {
if (ts->note_type() != 4.0) {
snprintf (buf, sizeof (buf), "%.3f/%.0f", ts->note_types_per_minute(), ts->note_type());
} else {
snprintf (buf, sizeof (buf), "%.3f", ts->note_types_per_minute());
}
} else {
snprintf (buf, sizeof (buf), "%.3f", ts->note_types_per_minute());
if (ts->note_type() != 4.0) {
snprintf (buf, sizeof (buf), "%.3f/%.0f>%.3f", ts->note_types_per_minute(), ts->note_type(), ts->end_note_types_per_minute());
} else {
snprintf (buf, sizeof (buf), "%.3f>%.3f", ts->note_types_per_minute(), ts->end_note_types_per_minute());
}
}
tempo_marker->set_name (buf);