tweak up display of "time since last msg" for transport masters
This commit is contained in:
parent
f0a395e7cd
commit
e28f96ae73
@ -473,11 +473,17 @@ TransportMastersWidget::Row::update (Session* s, samplepos_t now)
|
|||||||
last.set_text ("");
|
last.set_text ("");
|
||||||
}
|
}
|
||||||
current.set_text (Timecode::timecode_format_time (t));
|
current.set_text (Timecode::timecode_format_time (t));
|
||||||
timestamp.set_markup (tm->position_string());
|
|
||||||
delta.set_markup (tm->delta_string ());
|
delta.set_markup (tm->delta_string ());
|
||||||
|
|
||||||
char gap[32];
|
char gap[32];
|
||||||
snprintf (gap, sizeof (gap), "%.3fs", (when - now) / (float) AudioEngine::instance()->sample_rate());
|
const float seconds = (when - now) / (float) AudioEngine::instance()->sample_rate();
|
||||||
|
if (abs (seconds) < 1.0) {
|
||||||
|
snprintf (gap, sizeof (gap), "%.3fs", seconds);
|
||||||
|
} else if (abs (seconds) < 4.0) {
|
||||||
|
snprintf (gap, sizeof (gap), "%ds", (int) floor (seconds));
|
||||||
|
} else {
|
||||||
|
snprintf (gap, sizeof (gap), "%s", _(">4s ago"));
|
||||||
|
}
|
||||||
timestamp.set_text (gap);
|
timestamp.set_text (gap);
|
||||||
save_when = when;
|
save_when = when;
|
||||||
|
|
||||||
@ -486,10 +492,19 @@ TransportMastersWidget::Row::update (Session* s, samplepos_t now)
|
|||||||
if (save_when) {
|
if (save_when) {
|
||||||
char gap[32];
|
char gap[32];
|
||||||
|
|
||||||
snprintf (gap, sizeof (gap), "%.3fs", (save_when - now) / (float) AudioEngine::instance()->sample_rate());
|
const float seconds = (when - now) / (float) AudioEngine::instance()->sample_rate();
|
||||||
|
if (abs (seconds) < 1.0) {
|
||||||
|
snprintf (gap, sizeof (gap), "%.3fs", seconds);
|
||||||
|
} else if (abs (seconds) < 4.0) {
|
||||||
|
snprintf (gap, sizeof (gap), "%ds", (int) floor (seconds));
|
||||||
|
} else {
|
||||||
|
snprintf (gap, sizeof (gap), "%s", _(">4s ago"));
|
||||||
|
}
|
||||||
timestamp.set_text (gap);
|
timestamp.set_text (gap);
|
||||||
save_when = when;
|
save_when = when;
|
||||||
}
|
}
|
||||||
|
delta.set_text ("");
|
||||||
|
current.set_text ("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user