Stop status bar jumping about quite so much when values change.

git-svn-id: svn://localhost/ardour2/branches/3.0@10294 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2011-10-23 21:31:09 +00:00
parent 040aef6cc3
commit 3f2926794d
2 changed files with 10 additions and 0 deletions

View File

@ -1044,6 +1044,10 @@ ARDOUR_UI::update_cpu_load ()
{
char buf[64];
/* If this text is changed, the set_size_request_to_display_given_text call in ARDOUR_UI::build_menu_bar
should also be changed.
*/
float const c = engine->get_cpu_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);
@ -1057,6 +1061,10 @@ ARDOUR_UI::update_buffer_load ()
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::build_menu_bar
should also be changed.
*/
if (_session) {
snprintf (
buf, sizeof (buf),

View File

@ -535,11 +535,13 @@ ARDOUR_UI::build_menu_bar ()
cpu_load_box.set_name ("CPULoad");
cpu_load_label.set_name ("CPULoad");
cpu_load_label.set_use_markup ();
set_size_request_to_display_given_text (cpu_load_label, "DSP: 100.0%", 2, 2);
buffer_load_box.add (buffer_load_label);
buffer_load_box.set_name ("BufferLoad");
buffer_load_label.set_name ("BufferLoad");
buffer_load_label.set_use_markup ();
set_size_request_to_display_given_text (buffer_load_label, "Buffers: p:100% c:100%", 2, 2);
sample_rate_box.add (sample_rate_label);
sample_rate_box.set_name ("SampleRate");