X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fardour_ui.cc;h=0a7542a33fc6c4ea64d6102984b4c756f39a9c57;hb=7a524285385d4581ad3f1e085629379e32f82fda;hp=979ab3504aeb0e6277d57948e2956e10267167e3;hpb=c7ed461bcfb22a83e2b2877936e81c7582c2c9e3;p=ardour.git
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index 979ab3504a..0a7542a33f 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -79,6 +79,7 @@
#include "widgets/fastmeter.h"
#include "widgets/prompter.h"
+#include "widgets/tooltips.h"
#include "ardour/ardour.h"
#include "ardour/audio_backend.h"
@@ -583,7 +584,6 @@ ARDOUR_UI::engine_running ()
}
update_disk_space ();
update_cpu_load ();
- update_xrun_count ();
update_sample_rate (AudioEngine::instance()->sample_rate());
update_timecode_format ();
update_peak_thread_work ();
@@ -1508,8 +1508,6 @@ void
ARDOUR_UI::every_second ()
{
update_cpu_load ();
- update_xrun_count ();
- update_buffer_load ();
update_disk_space ();
update_timecode_format ();
update_peak_thread_work ();
@@ -1531,8 +1529,7 @@ ARDOUR_UI::every_second ()
void
ARDOUR_UI::every_point_one_seconds ()
{
- // TODO get rid of this..
- // ShuttleControl is updated directly via TransportStateChange signal
+ if (editor) editor->build_region_boundary_cache();
}
void
@@ -1677,43 +1674,33 @@ ARDOUR_UI::update_format ()
}
void
-ARDOUR_UI::update_xrun_count ()
+ARDOUR_UI::update_cpu_load ()
{
- char buf[64];
+ const unsigned int x = _session ? _session->get_xrun_count () : 0;
+ double const c = AudioEngine::instance()->get_dsp_load ();
- /* If this text is changed, the set_size_request_to_display_given_text call in ARDOUR_UI::resize_text_widgets
- should also be changed.
- */
+ const char* const bg = c > 90 ? " background=\"red\"" : "";
- if (_session) {
- const unsigned int x = _session->get_xrun_count ();
- dsp_load_indicator.set_xrun_count (x);
- if (x > 9999) {
- snprintf (buf, sizeof (buf), _("X: >10K"), X_("red"));
- } else {
- snprintf (buf, sizeof (buf), _("X: %u"), x > 0 ? X_("red") : X_("green"), x);
- }
+ char buf[64];
+ if (x > 9999) {
+ snprintf (buf, sizeof (buf), "DSP: %.0f%% (>10k)", bg, c);
+ } else if (x > 0) {
+ snprintf (buf, sizeof (buf), "DSP: %.0f%% (%d)", bg, c, x);
} else {
- snprintf (buf, sizeof (buf), _("X: ?"), X_("yellow"));
- dsp_load_indicator.set_xrun_count (UINT_MAX);
+ snprintf (buf, sizeof (buf), "DSP: %.0f%%", bg, c);
}
- xrun_label.set_markup (buf);
- set_tip (xrun_label, _("Audio dropouts. Shift+click to reset"));
-}
-void
-ARDOUR_UI::update_cpu_load ()
-{
- char buf[64];
+ dsp_load_label.set_markup (buf);
- /* If this text is changed, the set_size_request_to_display_given_text call in ARDOUR_UI::resize_text_widgets
- should also be changed.
- */
+ if (x > 9999) {
+ snprintf (buf, sizeof (buf), _("DSP: %.1f%% X: >10k\n%s"), c, _("Shift+Click to clear xruns."));
+ } else if (x > 0) {
+ snprintf (buf, sizeof (buf), _("DSP: %.1f%% X: %u\n%s"), c, x, _("Shift+Click to clear xruns."));
+ } else {
+ snprintf (buf, sizeof (buf), _("DSP: %.1f%%"), c);
+ }
- double const c = AudioEngine::instance()->get_dsp_load ();
- dsp_load_indicator.set_dsp_load (c);
- snprintf (buf, sizeof (buf), _("DSP: %5.1f%%"), c >= 90 ? X_("red") : X_("green"), c);
- cpu_load_label.set_markup (buf);
+ ArdourWidgets::set_tooltip (dsp_load_label, buf);
}
void
@@ -1730,64 +1717,68 @@ ARDOUR_UI::update_peak_thread_work ()
}
void
-ARDOUR_UI::update_buffer_load ()
+ARDOUR_UI::count_recenabled_streams (Route& route)
{
- char buf[256];
-
- uint32_t const playback = _session ? _session->playback_load () : 100;
- uint32_t const capture = _session ? _session->capture_load () : 100;
-
- /* If this text is changed, the set_size_request_to_display_given_text call in ARDOUR_UI::resize_text_widgets
- should also be changed.
- */
-
- if (_session) {
- snprintf (
- buf, sizeof (buf),
- _("Buffers: p:%" PRIu32 "%% "
- "c:%" PRIu32 "%%"),
- playback <= 5 ? X_("red") : X_("green"),
- playback,
- capture <= 5 ? X_("red") : X_("green"),
- capture
- );
-
- buffer_load_label.set_markup (buf);
- } else {
- buffer_load_label.set_text ("");
+ Track* track = dynamic_cast