From cfed95fd0beb857f864c3abbab3ce30013dfd2d3 Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Fri, 16 Feb 2018 09:19:45 -0600 Subject: [PATCH] Remove unused status labels. (using gauges instead) --- gtk2_ardour/ardour_ui.cc | 46 ------------------------------- gtk2_ardour/ardour_ui.h | 4 --- gtk2_ardour/ardour_ui_ed.cc | 23 ++-------------- gtk2_ardour/dsp_load_indicator.cc | 1 + 4 files changed, 4 insertions(+), 70 deletions(-) diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 5a37dc1d85..74a2f24854 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -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: >10K"), X_("red")); - } else { - snprintf (buf, sizeof (buf), _("X: %u"), x > 0 ? X_("red") : X_("green"), x); - } } else { - snprintf (buf, sizeof (buf), _("X: ?"), 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: %5.1f%%"), 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 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: Unknown")); disk_space_indicator.set_available_disk_sec (-1); } else if (opt_samples.get_value_or (0) == max_samplecnt) { - snprintf (buf, sizeof (buf), "%s", _("Disk: 24hrs+")); 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: >24 hrs")); - } 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: %02dh:%02dm:%02ds"), - low ? X_("red") : X_("green"), - hrs, mins, secs - ); - } } - disk_space_label.set_markup (buf); } void diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index 12fa270e17..99aa0e2503 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -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; diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc index 8f3fed3e93..2fae71b4ea 100644 --- a/gtk2_ardour/ardour_ui_ed.cc +++ b/gtk2_ardour/ardour_ui_ed.cc @@ -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 diff --git a/gtk2_ardour/dsp_load_indicator.cc b/gtk2_ardour/dsp_load_indicator.cc index 1def589eee..8e50d21771 100644 --- a/gtk2_ardour/dsp_load_indicator.cc +++ b/gtk2_ardour/dsp_load_indicator.cc @@ -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; } -- 2.30.2