feat(timer): Long timer announces minutes only when gt 10 minutes (#1891)

* Long timer announce minutes only
* fix: Typo and minor formatting
* fix: Handle negative long timer also + minor formatting
This commit is contained in:
eshifri
2022-07-15 12:58:16 +10:00
committed by GitHub
parent 7cff5ef97a
commit 755365abfd
16 changed files with 360 additions and 271 deletions
+22 -15
View File
@@ -104,23 +104,30 @@ I18N_PLAY_FUNCTION(hu, playDuration, int seconds PLAY_DURATION_ATT)
seconds = -seconds;
}
uint8_t tmp = seconds / 3600;
seconds %= 3600;
if (tmp > 0 || IS_PLAY_TIME()) {
PLAY_NUMBER(tmp, UNIT_HOURS, 0);
}
uint8_t tmp;
if (IS_PLAY_LONG_TIMER()) {
tmp = seconds / 60;
if (seconds % 60 >= 30) tmp += 1;
if (tmp > 0) PLAY_NUMBER(tmp, UNIT_MINUTES, 0);
} else {
tmp = seconds / 3600;
seconds %= 3600;
if (tmp > 0 || IS_PLAY_TIME()) {
PLAY_NUMBER(tmp, UNIT_HOURS, 0);
}
tmp = seconds / 60;
seconds %= 60;
if (tmp > 0) {
PLAY_NUMBER(tmp, UNIT_MINUTES, 0);
// This is not necessary in the Hungarian
//if (seconds > 0)
//PUSH_NUMBER_PROMPT(HU_PROMPT_AND);
}
tmp = seconds / 60;
seconds %= 60;
if (tmp > 0) {
PLAY_NUMBER(tmp, UNIT_MINUTES, 0);
// This is not necessary in the Hungarian
// if (seconds > 0)
// PUSH_NUMBER_PROMPT(HU_PROMPT_AND);
}
if (seconds > 0) {
PLAY_NUMBER(seconds, UNIT_SECONDS, 0);
if (seconds > 0) {
PLAY_NUMBER(seconds, UNIT_SECONDS, 0);
}
}
}