13
0

Slave delta display tweaks

* use left-aligned sign symbol with "sample" unit.
  When the delta value jitters in decimal places (e.g. MTC)
  it's otherwise no possible to discern + vs -.
* Use white text by default (not green)
This commit is contained in:
Robin Gareus 2020-05-11 21:34:01 +02:00
parent 44d87f2cd7
commit 5e2755baa1
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 7 additions and 7 deletions

View File

@ -705,12 +705,12 @@ LTC_TransportMaster::delta_string() const
} else {
if (abs (_current_delta) > ENGINE->sample_rate()) {
int secs = rint ((double) _current_delta / ENGINE->sample_rate());
snprintf(delta, sizeof(delta), "\u0394<span foreground=\"green\" face=\"monospace\" >%s%s%d</span><span face=\"monospace\"> s</span>",
snprintf(delta, sizeof(delta), "\u0394<span face=\"monospace\" >%s%s%d</span><span face=\"monospace\"> s</span>",
LEADINGZERO(abs(secs)), PLUSMINUS(-secs), abs(secs));
} else {
snprintf (delta, sizeof(delta), "<span foreground=\"%s\" face=\"monospace\" >%s%s%lld</span><span face=\"monospace\">sm</span>",
_sclock_synced && sync_lock_broken ? "red" : "white",
LEADINGZERO(::llabs(_current_delta)), PLUSMINUS(-_current_delta), ::llabs(_current_delta));
snprintf (delta, sizeof(delta), "\u0394<span %s face=\"monospace\" >%s%s%lld</span><span face=\"monospace\">sm</span>",
_sclock_synced && sync_lock_broken ? "foreground=\"red\"" : "",
PLUSMINUS(-_current_delta), LEADINGZERO(::llabs(_current_delta)), ::llabs(_current_delta));
}
}

View File

@ -609,11 +609,11 @@ MTC_TransportMaster::delta_string () const
} else {
if (abs (_current_delta) > _session->sample_rate()) {
int secs = rint ((double) _current_delta / _session->sample_rate());
snprintf(delta, sizeof(delta), "\u0394<span foreground=\"green\" face=\"monospace\" >%s%s%d</span><span face=\"monospace\"> s</span>",
snprintf(delta, sizeof(delta), "\u0394<span face=\"monospace\" >%s%s%d</span><span face=\"monospace\"> s</span>",
LEADINGZERO(abs(secs)), PLUSMINUS(-secs), abs(secs));
} else {
snprintf(delta, sizeof(delta), "\u0394<span foreground=\"green\" face=\"monospace\" >%s%s%" PRIi64 "</span><span face=\"monospace\">sm</span>",
LEADINGZERO(abs(_current_delta)), PLUSMINUS(-_current_delta), abs(_current_delta));
snprintf(delta, sizeof(delta), "\u0394<span face=\"monospace\" >%s%s%" PRIi64 "</span><span face=\"monospace\">sm</span>",
PLUSMINUS(-_current_delta), LEADINGZERO(abs(_current_delta)), abs(_current_delta));
}
}
return std::string(delta);