display active peak-builds
authorRobin Gareus <robin@gareus.org>
Tue, 15 Sep 2015 15:46:48 +0000 (17:46 +0200)
committerRobin Gareus <robin@gareus.org>
Tue, 15 Sep 2015 15:50:27 +0000 (17:50 +0200)
gtk2_ardour/ardour_ui.cc
gtk2_ardour/ardour_ui.h
gtk2_ardour/ardour_ui_ed.cc

index c041e7d89f57a993022c85343e08ee043e7a6505..042706322284db23784cb7fe3dd1c8ad3108a046 100644 (file)
@@ -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 ();
@@ -1461,6 +1464,19 @@ ARDOUR_UI::update_cpu_load ()
        cpu_load_label.set_markup (buf);
 }
 
+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 ()
 {
index 244972d838b8fa6d456933ae60a09cc0d3ef670e..e26a8f6f3f1a3426753320312ff86ddbc45df91f 100644 (file)
@@ -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 ();
 
index d08f47f76abf15ad6200c7fa24bd174a61d33f78..e33252850367b26336839edb10841360f72aba06 100644 (file)
@@ -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);