diff options
author | David Robillard <d@drobilla.net> | 2020-11-29 16:55:25 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-11-29 18:03:31 +0100 |
commit | d3561e8cf1d5a289ff2ce4a26e4a970437a812d5 (patch) | |
tree | 2383de628f8f1afe820fdd81dd5780f585f93717 /src/Patchage.cpp | |
parent | 86ce5ca10998fbeb3e9841cb2307caf00373b946 (diff) | |
download | patchage-d3561e8cf1d5a289ff2ce4a26e4a970437a812d5.tar.gz patchage-d3561e8cf1d5a289ff2ce4a26e4a970437a812d5.tar.bz2 patchage-d3561e8cf1d5a289ff2ce4a26e4a970437a812d5.zip |
Remove flaky DSP load meter
This never worked particularly well, and the underlying API is more or less
useless with Jack 2. So, just replace it with a dropout counter.
Diffstat (limited to 'src/Patchage.cpp')
-rw-r--r-- | src/Patchage.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/Patchage.cpp b/src/Patchage.cpp index 01eda37..7ce1f07 100644 --- a/src/Patchage.cpp +++ b/src/Patchage.cpp @@ -154,7 +154,7 @@ Patchage::Patchage(Options options) , INIT_WIDGET(_menu_normal_font_size) , INIT_WIDGET(_toolbar) , INIT_WIDGET(_clear_load_but) - , INIT_WIDGET(_xrun_progress) + , INIT_WIDGET(_dropouts_label) , INIT_WIDGET(_buf_size_combo) , INIT_WIDGET(_latency_label) , INIT_WIDGET(_legend_alignment) @@ -430,10 +430,16 @@ Patchage::update_load() { #if defined(PATCHAGE_LIBJACK) || defined(HAVE_JACK_DBUS) if (_jack_driver->is_attached()) { - char buf[8]; - snprintf(buf, sizeof(buf), "%u", _jack_driver->get_xruns()); - _xrun_progress->set_text(std::string(buf) + " Dropouts"); - _xrun_progress->set_fraction(_jack_driver->get_max_dsp_load()); + const auto xruns = _jack_driver->get_xruns(); + if (xruns > 0u) { + _dropouts_label->set_text(fmt::format(" Dropouts: {}", xruns)); + _dropouts_label->show(); + _clear_load_but->show(); + } else { + _dropouts_label->set_text(" Dropouts: 0"); + _dropouts_label->hide(); + _clear_load_but->hide(); + } } #endif @@ -549,9 +555,10 @@ void Patchage::clear_load() { #if defined(PATCHAGE_LIBJACK) || defined(HAVE_JACK_DBUS) - _xrun_progress->set_fraction(0.0); + _dropouts_label->set_text(" Dropouts: 0"); + _dropouts_label->hide(); + _clear_load_but->hide(); _jack_driver->reset_xruns(); - _jack_driver->reset_max_dsp_load(); #endif } |