diff options
author | Robin Gareus <robin@gareus.org> | 2018-02-20 12:53:21 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2018-02-20 12:53:21 +0100 |
commit | 54db84ffeee757ae46b61c2e519a26deb5f6f4df (patch) | |
tree | 1db86f295e8555a13d7fc9a12ea91ba71409f930 /gtk2_ardour | |
parent | 7b4ab907d42ec8b12239adfcdf5b86223b0f935b (diff) |
Re-add fixed-color DSP-load indicator background
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/ardour_ui.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 9ce9ca355c..330d0c6402 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -1679,16 +1679,18 @@ ARDOUR_UI::update_cpu_load () const unsigned int x = _session ? _session->get_xrun_count () : 0; double const c = AudioEngine::instance()->get_dsp_load (); + const char* const bg = c > 90 ? " background=\"red\"" : ""; + char buf[64]; if (x > 9999) { - snprintf (buf, sizeof (buf), "DSP: %.0f%% (>10k)", c); + snprintf (buf, sizeof (buf), "DSP: <span%s>%.0f%%</span> (>10k)", bg, c); } else if (x > 0) { - snprintf (buf, sizeof (buf), "DSP: %.0f%% (%d)", c, x); + snprintf (buf, sizeof (buf), "DSP: <span%s>%.0f%%</span> (%d)", bg, c, x); } else { - snprintf (buf, sizeof (buf), "DSP: %.0f%%", c); + snprintf (buf, sizeof (buf), "DSP: <span%s>%.0f%%</span>", bg, c); } - dsp_load_label.set_text (buf); + dsp_load_label.set_markup (buf); if (x > 9999) { snprintf (buf, sizeof (buf), _("DSP: %.1f%% X: >10k\n%s"), c, _("Shift+Click to clear xruns.")); |