Remove unused status labels. (using gauges instead)
authorBen Loftis <ben@harrisonconsoles.com>
Fri, 16 Feb 2018 15:19:45 +0000 (09:19 -0600)
committerBen Loftis <ben@harrisonconsoles.com>
Sat, 17 Feb 2018 15:24:14 +0000 (09:24 -0600)
gtk2_ardour/ardour_ui.cc
gtk2_ardour/ardour_ui.h
gtk2_ardour/ardour_ui_ed.cc
gtk2_ardour/dsp_load_indicator.cc

index 5a37dc1d85e554c87bedae23b7eddfbbc5bda18f..74a2f24854dfd300116a622fceeb46f3dd42733e 100644 (file)
@@ -1678,8 +1678,6 @@ ARDOUR_UI::update_format ()
 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.
        */
@@ -1687,32 +1685,20 @@ ARDOUR_UI::update_xrun_count ()
        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: <span foreground=\"%s\">&gt;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"));
                dsp_load_indicator.set_xrun_count (UINT_MAX);
        }
-       xrun_label.set_markup (buf);
-       set_tip (xrun_label, _("Audio dropouts. Shift+click to reset"));
 }
 
 void
 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::resize_text_widgets
           should also be changed.
        */
 
        double const c = AudioEngine::instance()->get_dsp_load ();
        dsp_load_indicator.set_dsp_load (c);
-       snprintf (buf, sizeof (buf), _("DSP: <span foreground=\"%s\">%5.1f%%</span>"), c >= 90 ? X_("red") : X_("green"), c);
-       cpu_load_label.set_markup (buf);
 }
 
 void
@@ -1731,17 +1717,9 @@ ARDOUR_UI::update_peak_thread_work ()
 void
 ARDOUR_UI::update_buffer_load ()
 {
-       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.
-       */
-       
        uint32_t max_load = std::min ( playback, capture );
-       
        disk_io_indicator.set_disk_io(max_load);
 }
 
@@ -1763,7 +1741,6 @@ ARDOUR_UI::update_disk_space()
        }
 
        boost::optional<samplecnt_t> opt_samples = _session->available_capture_duration();
-       char buf[64];
        samplecnt_t fr = _session->sample_rate();
 
        if (fr == 0) {
@@ -1774,10 +1751,8 @@ ARDOUR_UI::update_disk_space()
 
        if (!opt_samples) {
                /* Available space is unknown */
-               snprintf (buf, sizeof (buf), "%s", _("Disk: <span foreground=\"green\">Unknown</span>"));
                disk_space_indicator.set_available_disk_sec (-1);
        } else if (opt_samples.get_value_or (0) == max_samplecnt) {
-               snprintf (buf, sizeof (buf), "%s", _("Disk: <span foreground=\"green\">24hrs+</span>"));
                disk_space_indicator.set_available_disk_sec (max_samplecnt);
        } else {
                rec_enabled_streams = 0;
@@ -1794,29 +1769,8 @@ ARDOUR_UI::update_disk_space()
                int secs;
 
                disk_space_indicator.set_available_disk_sec (samples / (float)fr);
-
-               hrs  = samples / (fr * 3600);
-
-               if (hrs > 24) {
-                       snprintf (buf, sizeof (buf), "%s", _("Disk: <span foreground=\"green\">&gt;24 hrs</span>"));
-               } else {
-                       samples -= hrs * fr * 3600;
-                       mins = samples / (fr * 60);
-                       samples -= mins * fr * 60;
-                       secs = samples / fr;
-
-                       bool const low = (hrs == 0 && mins <= 30);
-
-                       snprintf (
-                               buf, sizeof(buf),
-                               _("Disk: <span foreground=\"%s\">%02dh:%02dm:%02ds</span>"),
-                               low ? X_("red") : X_("green"),
-                               hrs, mins, secs
-                               );
-               }
        }
 
-       disk_space_label.set_markup (buf);
 }
 
 void
index 12fa270e17cd1f0869ac58c7771ee24fad4cc933..99aa0e2503669264312efef9a866a6f68aa23804 100644 (file)
@@ -566,22 +566,18 @@ private:
        Gtk::Label   wall_clock_label;
        gint update_wall_clock ();
 
-       Gtk::Label   disk_space_label;
        void update_disk_space ();
 
        Gtk::Label   timecode_format_label;
        void update_timecode_format ();
 
-       Gtk::Label   cpu_load_label;
        void update_cpu_load ();
 
-       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 ();
 
        Gtk::Label   sample_rate_label;
index 8f3fed3e9303335c8ef816aa52c7da8f62b410ec..2fae71b4ea0a4262da5b450c3e73b20b25892988 100644 (file)
@@ -679,18 +679,10 @@ ARDOUR_UI::build_menu_bar ()
 
        wall_clock_label.set_name ("WallClock");
        wall_clock_label.set_use_markup ();
-       disk_space_label.set_name ("WallClock");
-       disk_space_label.set_use_markup ();
        timecode_format_label.set_name ("WallClock");
        timecode_format_label.set_use_markup ();
-       cpu_load_label.set_name ("CPULoad");
-       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");
        sample_rate_label.set_use_markup ();
        format_label.set_name ("Format");
@@ -703,22 +695,16 @@ ARDOUR_UI::build_menu_bar ()
 #endif
 
        hbox->pack_end (error_alert_button, false, false, 2);
+
        hbox->pack_end (dsp_load_indicator, false, false, 4);
 
-       hbox->pack_end (wall_clock_label, false, false, 2);
        hbox->pack_end (disk_space_indicator, false, false, 4);
-#if 0
-       hbox->pack_end (disk_space_label, false, false, 4);
-#endif
-       hbox->pack_end (xrun_label, false, false, 4);
-#if 0
-       hbox->pack_end (cpu_load_label, false, false, 4);
-#endif
        hbox->pack_end (disk_io_indicator, false, false, 4);
        hbox->pack_end (sample_rate_label, false, false, 4);
        hbox->pack_end (timecode_format_label, false, false, 4);
        hbox->pack_end (format_label, false, false, 4);
        hbox->pack_end (peak_thread_work_label, false, false, 4);
+       hbox->pack_end (wall_clock_label, false, false, 2);
 
        menu_hbox.pack_end (*ev, false, false, 2);
 
@@ -731,7 +717,6 @@ ARDOUR_UI::build_menu_bar ()
 #endif
        _status_bar_visibility.add (&disk_space_indicator,  X_("Disk"),      _("Disk Space"), !Profile->get_small_screen());
        _status_bar_visibility.add (&dsp_load_indicator,    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 (&disk_io_indicator,     X_("Buffers"),   _("Buffers"), true);
        _status_bar_visibility.add (&sample_rate_label,     X_("Audio"),     _("Audio"), true);
@@ -872,9 +857,7 @@ ARDOUR_UI::save_ardour_state ()
 void
 ARDOUR_UI::resize_text_widgets ()
 {
-       set_size_request_to_display_given_text (cpu_load_label, "DSP: 100.0%", 2, 2);
-       set_size_request_to_display_given_text (buffer_load_label, "Buffers: p:100% c:100%", 2, 2);
-       set_size_request_to_display_given_text (xrun_label, "X: 9999", 2, 2);
+       //ToDo:  maybe resize the gauges to fit translated text
 }
 
 void
index 1def589eee8d7e5e7cbca20548af9bcc99725c94..8e50d21771ba5949f3658804fc97cf0cbb0a5fe0 100644 (file)
@@ -115,6 +115,7 @@ DspLoadIndicator::on_button_release_event (GdkEventButton *ev)
        if (s) {
                s->reset_xrun_count ();
                _xrun_while_recording = false;
+               queue_draw();
        }
        return true;
 }