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.
*/
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\">>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
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);
}
}
boost::optional<samplecnt_t> opt_samples = _session->available_capture_duration();
- char buf[64];
samplecnt_t fr = _session->sample_rate();
if (fr == 0) {
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;
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\">>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
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");
#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);
#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);
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