13
0

Indicate remaining record time for FLAC with >=

This commit is contained in:
Robin Gareus 2024-05-13 21:54:18 +02:00
parent 68d3be8918
commit 6b8018d927
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 11 additions and 4 deletions

View File

@ -1432,6 +1432,10 @@ ARDOUR_UI::format_disk_space_label (float remain_sec)
std::string label = string_compose (X_("<span weight=\"ultralight\">%1</span>: "), _("Rec")); std::string label = string_compose (X_("<span weight=\"ultralight\">%1</span>: "), _("Rec"));
if (_session && FLAC == _session->config.get_native_file_header_format () && remain_sec <= 86400) {
label += u8"\u2265"; // Greater-Than or Equal To
}
if (remain_sec > 86400) { if (remain_sec > 86400) {
disk_space_label.set_markup (label + _(">24h")); disk_space_label.set_markup (label + _(">24h"));
} else if (remain_sec > 32400 /* 9 hours */) { } else if (remain_sec > 32400 /* 9 hours */) {

View File

@ -340,20 +340,23 @@ RemainInfoBox::render (Cairo::RefPtr<Cairo::Context> const& cr, cairo_rectangle_
float remain_sec = samples / (float)sample_rate; float remain_sec = samples / (float)sample_rate;
char buf[32]; char buf[32];
bool at_least = FLAC == _session->config.get_native_file_header_format ();
const char* prefix = at_least ? u8"\u2265" : ""; // Greater-Than or Equal To
if (remain_sec > 86400) { if (remain_sec > 86400) {
_layout_value->set_text (_(">24h")); _layout_value->set_text (_(">24h"));
} else if (remain_sec > 32400 /* 9 hours */) { } else if (remain_sec > 32400 /* 9 hours */) {
snprintf (buf, sizeof (buf), "%.0f", remain_sec / 3600.f); snprintf (buf, sizeof (buf), "%s%.0f", prefix, remain_sec / 3600.f);
_layout_value->set_text (std::string (buf) + S_("hours|h")); _layout_value->set_text (std::string (buf) + S_("hours|h"));
} else if (remain_sec > 5940 /* 99 mins */) { } else if (remain_sec > 5940 /* 99 mins */) {
snprintf (buf, sizeof (buf), "%.1f", remain_sec / 3600.f); snprintf (buf, sizeof (buf), "%s%.1f", prefix, remain_sec / 3600.f);
_layout_value->set_text (std::string (buf) + S_("hours|h")); _layout_value->set_text (std::string (buf) + S_("hours|h"));
} else if (remain_sec > 60*3 /* 3 mins */) { } else if (remain_sec > 60*3 /* 3 mins */) {
snprintf (buf, sizeof (buf), "%.0f", remain_sec / 60.f); snprintf (buf, sizeof (buf), "%s%.0f", prefix, remain_sec / 60.f);
_layout_value->set_text (std::string (buf) + S_("minutes|m")); _layout_value->set_text (std::string (buf) + S_("minutes|m"));
} else { } else {
Gtkmm2ext::set_source_rgb_a (cr, UIConfiguration::instance ().color ("alert:red"), .7); Gtkmm2ext::set_source_rgb_a (cr, UIConfiguration::instance ().color ("alert:red"), .7);
snprintf (buf, sizeof (buf), "%.0f", remain_sec / 60.f); snprintf (buf, sizeof (buf), "%s%.0f", prefix, remain_sec / 60.f);
_layout_value->set_text (std::string (buf) + S_("minutes|m")); _layout_value->set_text (std::string (buf) + S_("minutes|m"));
} }
} }