diff options
author | Robin Gareus <robin@gareus.org> | 2015-04-29 03:10:27 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2015-04-29 03:10:27 +0200 |
commit | 6e335ca5d90ddc62b0af9a60a6b156ed74ac8eb1 (patch) | |
tree | 4eb0341e64fce0db2aa6caab194a712eea5fa09f /gtk2_ardour/ardour_ui.cc | |
parent | cd63d97f65133d9c34f5ee36bc1a5a7bec530e21 (diff) |
add xrun counter to status-bar (currently no reset)
Diffstat (limited to 'gtk2_ardour/ardour_ui.cc')
-rw-r--r-- | gtk2_ardour/ardour_ui.cc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 5a91bc6dfc..2f38aec72f 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -434,8 +434,12 @@ ARDOUR_UI::engine_running () first_time_engine_run = false; } + if (_session) { + _session->reset_xrun_count (); + } update_disk_space (); update_cpu_load (); + update_xrun_count (); update_sample_rate (AudioEngine::instance()->sample_rate()); update_timecode_format (); } @@ -1179,6 +1183,7 @@ void ARDOUR_UI::every_second () { update_cpu_load (); + update_xrun_count (); update_buffer_load (); update_disk_space (); update_timecode_format (); @@ -1348,6 +1353,28 @@ ARDOUR_UI::update_cpu_load () should also be changed. */ + if (_session) { + const unsigned int x = _session->get_xrun_count (); + if (x > 9999) { + snprintf (buf, sizeof (buf), _("X: <span foreground=\"%s\">>10K</span>"), X_("red")); + } else { + snprintf (buf, sizeof (buf), _("X: <span foreground=\"%s\">%u</span>"), x > 0 ? X_("red") : X_("green"), x); + } + } else { + snprintf (buf, sizeof (buf), _("X: <span foreground=\"%s\">?</span>"), X_("yellow")); + } + xrun_label.set_markup (buf); +} + +void +ARDOUR_UI::update_xrun_count () +{ + char buf[64]; + + /* If this text is changed, the set_size_request_to_display_given_text call in ARDOUR_UI::resize_text_widgets + should also be changed. + */ + double const c = AudioEngine::instance()->get_dsp_load (); snprintf (buf, sizeof (buf), _("DSP: <span foreground=\"%s\">%5.1f%%</span>"), c >= 90 ? X_("red") : X_("green"), c); cpu_load_label.set_markup (buf); |