From 5e2755baa1d996cc8e44045200eb89aa238d8529 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 11 May 2020 21:34:01 +0200 Subject: [PATCH] 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) --- libs/ardour/ltc_slave.cc | 8 ++++---- libs/ardour/mtc_slave.cc | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libs/ardour/ltc_slave.cc b/libs/ardour/ltc_slave.cc index dc0d1b2669..bbd82c0556 100644 --- a/libs/ardour/ltc_slave.cc +++ b/libs/ardour/ltc_slave.cc @@ -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%s%s%d s", + snprintf(delta, sizeof(delta), "\u0394%s%s%d s", LEADINGZERO(abs(secs)), PLUSMINUS(-secs), abs(secs)); } else { - snprintf (delta, sizeof(delta), "%s%s%lldsm", - _sclock_synced && sync_lock_broken ? "red" : "white", - LEADINGZERO(::llabs(_current_delta)), PLUSMINUS(-_current_delta), ::llabs(_current_delta)); + snprintf (delta, sizeof(delta), "\u0394%s%s%lldsm", + _sclock_synced && sync_lock_broken ? "foreground=\"red\"" : "", + PLUSMINUS(-_current_delta), LEADINGZERO(::llabs(_current_delta)), ::llabs(_current_delta)); } } diff --git a/libs/ardour/mtc_slave.cc b/libs/ardour/mtc_slave.cc index e228c8cd60..632a5f7e5f 100644 --- a/libs/ardour/mtc_slave.cc +++ b/libs/ardour/mtc_slave.cc @@ -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%s%s%d s", + snprintf(delta, sizeof(delta), "\u0394%s%s%d s", LEADINGZERO(abs(secs)), PLUSMINUS(-secs), abs(secs)); } else { - snprintf(delta, sizeof(delta), "\u0394%s%s%" PRIi64 "sm", - LEADINGZERO(abs(_current_delta)), PLUSMINUS(-_current_delta), abs(_current_delta)); + snprintf(delta, sizeof(delta), "\u0394%s%s%" PRIi64 "sm", + PLUSMINUS(-_current_delta), LEADINGZERO(abs(_current_delta)), abs(_current_delta)); } } return std::string(delta);