diff options
author | Robin Gareus <robin@gareus.org> | 2015-09-15 17:46:48 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2015-09-15 17:50:27 +0200 |
commit | 93cd0d17e4350958308dd1258d7e3aa0e5417292 (patch) | |
tree | 12d26a3f7ec40d4b0c8d272cf9c960b3707be78c | |
parent | 4b20e719a893e985ee2b21e6440daa0433c61305 (diff) |
display active peak-builds
-rw-r--r-- | gtk2_ardour/ardour_ui.cc | 16 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui.h | 3 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui_ed.cc | 6 |
3 files changed, 24 insertions, 1 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index c041e7d89f..0427063222 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -86,6 +86,7 @@ #include "ardour/session_route.h" #include "ardour/session_state_utils.h" #include "ardour/session_utils.h" +#include "ardour/source_factory.h" #include "ardour/slave.h" #include "ardour/system_exec.h" @@ -489,6 +490,7 @@ ARDOUR_UI::engine_running () update_xrun_count (); update_sample_rate (AudioEngine::instance()->sample_rate()); update_timecode_format (); + update_peak_thread_work (); } void @@ -1261,6 +1263,7 @@ ARDOUR_UI::every_second () update_buffer_load (); update_disk_space (); update_timecode_format (); + update_peak_thread_work (); if (nsm && nsm->is_active ()) { nsm->check (); @@ -1462,6 +1465,19 @@ ARDOUR_UI::update_cpu_load () } void +ARDOUR_UI::update_peak_thread_work () +{ + char buf[64]; + const int c = SourceFactory::peak_work_queue_length (); + if (c > 0) { + snprintf (buf, sizeof (buf), _("PkBld: <span foreground=\"%s\">%d</span>"), c >= 2 ? X_("red") : X_("green"), c); + peak_thread_work_label.set_markup (buf); + } else { + peak_thread_work_label.set_markup (X_("")); + } +} + +void ARDOUR_UI::update_buffer_load () { char buf[256]; diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index 244972d838..e26a8f6f3f 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -553,6 +553,9 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr Gtk::Label xrun_label; void update_xrun_count (); + Gtk::Label peak_thread_work_label; + void update_peak_thread_work (); + Gtk::Label buffer_load_label; void update_buffer_load (); diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc index d08f47f76a..e332528503 100644 --- a/gtk2_ardour/ardour_ui_ed.cc +++ b/gtk2_ardour/ardour_ui_ed.cc @@ -182,7 +182,7 @@ ARDOUR_UI::install_actions () ActionManager::session_sensitive_actions.push_back (act); ActionManager::write_sensitive_actions.push_back (act); - act = ActionManager::register_action (main_actions, X_("CleanupPeakFiles"), _("Clean-up Peak Files..."), sigc::mem_fun (*(ARDOUR_UI::instance()), &ARDOUR_UI::cleanup_peakfiles)); + act = ActionManager::register_action (main_actions, X_("CleanupPeakFiles"), _("Reset Peak Files"), sigc::mem_fun (*(ARDOUR_UI::instance()), &ARDOUR_UI::cleanup_peakfiles)); ActionManager::session_sensitive_actions.push_back (act); ActionManager::write_sensitive_actions.push_back (act); @@ -502,6 +502,8 @@ ARDOUR_UI::build_menu_bar () cpu_load_label.set_use_markup (); xrun_label.set_name ("XrunLabel"); xrun_label.set_use_markup (); + peak_thread_work_label.set_name ("PeakThreadWork"); + peak_thread_work_label.set_use_markup (); buffer_load_label.set_name ("BufferLoad"); buffer_load_label.set_use_markup (); sample_rate_label.set_name ("SampleRate"); @@ -531,6 +533,7 @@ ARDOUR_UI::build_menu_bar () hbox->pack_end (wall_clock_label, false, false, 2); hbox->pack_end (disk_space_label, false, false, 4); hbox->pack_end (xrun_label, false, false, 4); + hbox->pack_end (peak_thread_work_label, false, false, 4); hbox->pack_end (cpu_load_label, false, false, 4); hbox->pack_end (buffer_load_label, false, false, 4); hbox->pack_end (sample_rate_label, false, false, 4); @@ -548,6 +551,7 @@ ARDOUR_UI::build_menu_bar () _status_bar_visibility.add (&disk_space_label, X_("Disk"), _("Disk Space"), disk_space); _status_bar_visibility.add (&cpu_load_label, X_("DSP"), _("DSP"), true); _status_bar_visibility.add (&xrun_label, X_("XRun"), _("X-run"), false); + _status_bar_visibility.add (&peak_thread_work_label,X_("Peakfile"), _("Active Peak-file Work"), false); _status_bar_visibility.add (&buffer_load_label, X_("Buffers"), _("Buffers"), true); _status_bar_visibility.add (&sample_rate_label, X_("Audio"), _("Audio"), true); _status_bar_visibility.add (&timecode_format_label, X_("TCFormat"), _("Timecode Format"), true); |