fix: Announce timer value as hours and minutes when played from SF (#3293)

This commit is contained in:
philmoz
2023-04-19 21:59:08 +10:00
committed by GitHub
parent 8b40fb771a
commit 62a40f1c47
15 changed files with 338 additions and 353 deletions
+20 -20
View File
@@ -104,28 +104,28 @@ I18N_PLAY_FUNCTION(cn, playDuration, int seconds PLAY_DURATION_ATT)
seconds = -seconds;
}
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);
}
int hours, minutes;
hours = seconds / 3600;
seconds = seconds % 3600;
minutes = seconds / 60;
seconds = seconds % 60;
tmp = seconds / 60;
seconds %= 60;
if (tmp > 0) {
PLAY_NUMBER(tmp, UNIT_MINUTES, 0);
if (seconds > 0) PUSH_NUMBER_PROMPT(CN_PROMPT_AND);
}
if (IS_PLAY_LONG_TIMER() && seconds >= 30) {
minutes += 1;
}
if (seconds > 0) {
PLAY_NUMBER(seconds, UNIT_SECONDS, 0);
}
if (hours > 0 || IS_PLAY_TIME()) {
PLAY_NUMBER(hours, UNIT_HOURS, 0);
}
if (minutes > 0) {
PLAY_NUMBER(minutes, UNIT_MINUTES, 0);
}
if (!IS_PLAY_LONG_TIMER() && seconds > 0) {
if (minutes)
PUSH_NUMBER_PROMPT(CN_PROMPT_AND);
PLAY_NUMBER(seconds, UNIT_SECONDS, 0);
}
}
+18 -19
View File
@@ -163,27 +163,26 @@ I18N_PLAY_FUNCTION(cz, playDuration, int seconds PLAY_DURATION_ATT)
seconds = -seconds;
}
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, FEMALE);
}
int hours, minutes;
hours = seconds / 3600;
seconds = seconds % 3600;
minutes = seconds / 60;
seconds = seconds % 60;
tmp = seconds / 60;
seconds %= 60;
if (tmp > 0) {
PLAY_NUMBER(tmp, UNIT_MINUTES, FEMALE);
}
if (IS_PLAY_LONG_TIMER() && seconds >= 30) {
minutes += 1;
}
if (seconds > 0) {
PLAY_NUMBER(seconds, UNIT_SECONDS, FEMALE);
}
if (hours > 0 || IS_PLAY_TIME()) {
PLAY_NUMBER(hours, UNIT_HOURS, FEMALE);
}
if (minutes > 0) {
PLAY_NUMBER(minutes, UNIT_MINUTES, FEMALE);
}
if (!IS_PLAY_LONG_TIMER() && seconds > 0) {
PLAY_NUMBER(seconds, UNIT_SECONDS, FEMALE);
}
}
+17 -17
View File
@@ -99,27 +99,27 @@ I18N_PLAY_FUNCTION(da, playDuration, int seconds PLAY_DURATION_ATT)
seconds = -seconds;
}
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);
}
int hours, minutes;
hours = seconds / 3600;
seconds = seconds % 3600;
minutes = seconds / 60;
seconds = seconds % 60;
if (IS_PLAY_LONG_TIMER() && seconds >= 30) {
minutes += 1;
}
tmp = seconds / 60;
seconds %= 60;
if (tmp > 0) {
PLAY_NUMBER(tmp, UNIT_MINUTES, 0);
if (seconds > 0) PUSH_NUMBER_PROMPT(DA_PROMPT_AND);
if (hours > 0 || IS_PLAY_TIME()) {
PLAY_NUMBER(hours, UNIT_HOURS, 0);
}
if (seconds > 0) {
if (minutes > 0) {
PLAY_NUMBER(minutes, UNIT_MINUTES, 0);
}
if (!IS_PLAY_LONG_TIMER() && seconds > 0) {
if (minutes)
PUSH_NUMBER_PROMPT(DA_PROMPT_AND);
PLAY_NUMBER(seconds, UNIT_SECONDS, 0);
}
}
+31 -39
View File
@@ -161,55 +161,47 @@ I18N_PLAY_FUNCTION(de, playDuration, int seconds PLAY_DURATION_ATT)
seconds = -seconds;
}
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);
int hours, minutes;
hours = seconds / 3600;
seconds = seconds % 3600;
minutes = seconds / 60;
seconds = seconds % 60;
if (IS_PLAY_LONG_TIMER() && seconds >= 30) {
minutes += 1;
}
else
{
tmp = seconds / 3600;
seconds %= 3600;
if (tmp > 0 || IS_PLAY_TIME()) {
if (tmp > 1) {
PLAY_NUMBER(tmp, 0, 0);
PUSH_NUMBER_PROMPT(DE_PROMPT_STUNDEN);
} else {
PUSH_NUMBER_PROMPT(DE_PROMPT_EINE);
PUSH_NUMBER_PROMPT(DE_PROMPT_STUNDE);
}
if (seconds > 0) {
PUSH_NUMBER_PROMPT(DE_PROMPT_UND);
}
if (hours > 0 || IS_PLAY_TIME()) {
if (hours > 1) {
PLAY_NUMBER(hours, 0, 0);
PUSH_NUMBER_PROMPT(DE_PROMPT_STUNDEN);
} else {
PUSH_NUMBER_PROMPT(DE_PROMPT_EINE);
PUSH_NUMBER_PROMPT(DE_PROMPT_STUNDE);
}
}
tmp = seconds / 60;
seconds %= 60;
if (tmp > 0) {
if (tmp > 1) {
PLAY_NUMBER(tmp, 0, 0);
PUSH_NUMBER_PROMPT(DE_PROMPT_MINUTEN);
} else {
PUSH_NUMBER_PROMPT(DE_PROMPT_EINE);
PUSH_NUMBER_PROMPT(DE_PROMPT_MINUTE);
}
if (seconds > 0) {
PUSH_NUMBER_PROMPT(DE_PROMPT_UND);
}
if (minutes > 0) {
if (hours)
PUSH_NUMBER_PROMPT(DE_PROMPT_UND);
if (minutes > 1) {
PLAY_NUMBER(minutes, 0, 0);
PUSH_NUMBER_PROMPT(DE_PROMPT_MINUTEN);
} else {
PUSH_NUMBER_PROMPT(DE_PROMPT_EINE);
PUSH_NUMBER_PROMPT(DE_PROMPT_MINUTE);
}
}
if (!IS_PLAY_LONG_TIMER() && seconds > 0) {
if (minutes)
PUSH_NUMBER_PROMPT(DE_PROMPT_UND);
if (seconds > 1) {
PLAY_NUMBER(seconds, 0, 0);
PUSH_NUMBER_PROMPT(DE_PROMPT_SEKUNDEN);
} else {
if (seconds == 1) {
PUSH_NUMBER_PROMPT(DE_PROMPT_EINE);
PUSH_NUMBER_PROMPT(DE_PROMPT_SEKUNDE);
}
PUSH_NUMBER_PROMPT(DE_PROMPT_EINE);
PUSH_NUMBER_PROMPT(DE_PROMPT_SEKUNDE);
}
}
}
+20 -20
View File
@@ -104,28 +104,28 @@ I18N_PLAY_FUNCTION(en, playDuration, int seconds PLAY_DURATION_ATT)
seconds = -seconds;
}
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);
}
int hours, minutes;
hours = seconds / 3600;
seconds = seconds % 3600;
minutes = seconds / 60;
seconds = seconds % 60;
tmp = seconds / 60;
seconds %= 60;
if (tmp > 0) {
PLAY_NUMBER(tmp, UNIT_MINUTES, 0);
if (seconds > 0) PUSH_NUMBER_PROMPT(EN_PROMPT_AND);
}
if (IS_PLAY_LONG_TIMER() && seconds >= 30) {
minutes += 1;
}
if (seconds > 0) {
PLAY_NUMBER(seconds, UNIT_SECONDS, 0);
}
if (hours > 0 || IS_PLAY_TIME()) {
PLAY_NUMBER(hours, UNIT_HOURS, 0);
}
if (minutes > 0) {
PLAY_NUMBER(minutes, UNIT_MINUTES, 0);
}
if (!IS_PLAY_LONG_TIMER() && seconds > 0) {
if (minutes)
PUSH_NUMBER_PROMPT(EN_PROMPT_AND);
PLAY_NUMBER(seconds, UNIT_SECONDS, 0);
}
}
+35 -36
View File
@@ -153,44 +153,43 @@ I18N_PLAY_FUNCTION(es, playDuration, int seconds PLAY_DURATION_ATT)
seconds = -seconds;
}
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()) {
if (tmp > 1) {
PLAY_NUMBER(tmp, 0, 0);
PUSH_UNIT_PROMPT(UNIT_HOURS, 1);
} else {
PUSH_NUMBER_PROMPT(ES_PROMPT_UNA);
PUSH_UNIT_PROMPT(UNIT_HOURS, 0);
}
}
int hours, minutes;
hours = seconds / 3600;
seconds = seconds % 3600;
minutes = seconds / 60;
seconds = seconds % 60;
tmp = seconds / 60;
seconds %= 60;
if (tmp > 0) {
if (tmp != 1) {
PLAY_NUMBER(tmp, 0, 0);
PUSH_UNIT_PROMPT(UNIT_MINUTES, 1);
} else {
PUSH_NUMBER_PROMPT(ES_PROMPT_UN);
PUSH_UNIT_PROMPT(UNIT_MINUTES, 0);
}
}
if (IS_PLAY_LONG_TIMER() && seconds >= 30) {
minutes += 1;
}
if (seconds > 0) {
if (seconds != 1) {
PLAY_NUMBER(seconds, 0, 0);
PUSH_UNIT_PROMPT(UNIT_SECONDS, 1);
} else {
PUSH_NUMBER_PROMPT(ES_PROMPT_UN);
PUSH_UNIT_PROMPT(UNIT_SECONDS, 0);
}
if (hours > 0 || IS_PLAY_TIME()) {
if (hours > 1) {
PLAY_NUMBER(hours, 0, 0);
PUSH_UNIT_PROMPT(UNIT_HOURS, 1);
} else {
PUSH_NUMBER_PROMPT(ES_PROMPT_UNA);
PUSH_UNIT_PROMPT(UNIT_HOURS, 0);
}
}
if (minutes > 0) {
if (minutes > 1) {
PLAY_NUMBER(minutes, 0, 0);
PUSH_UNIT_PROMPT(UNIT_MINUTES, 1);
} else {
PUSH_NUMBER_PROMPT(ES_PROMPT_UN);
PUSH_UNIT_PROMPT(UNIT_MINUTES, 0);
}
}
if (!IS_PLAY_LONG_TIMER() && seconds > 0) {
if (seconds > 1) {
PLAY_NUMBER(seconds, 0, 0);
PUSH_UNIT_PROMPT(UNIT_SECONDS, 1);
} else {
PUSH_NUMBER_PROMPT(ES_PROMPT_UN);
PUSH_UNIT_PROMPT(UNIT_SECONDS, 0);
}
}
}
+27 -27
View File
@@ -135,37 +135,37 @@ I18N_PLAY_FUNCTION(fr, playDuration, int seconds PLAY_DURATION_ATT)
seconds = -seconds;
}
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 (IS_PLAY_TIME() && tmp == 0) {
PUSH_NUMBER_PROMPT(FR_PROMPT_MINUIT);
} else if (IS_PLAY_TIME() && tmp == 12) {
PUSH_NUMBER_PROMPT(FR_PROMPT_MIDI);
} else if (tmp > 0) {
PLAY_NUMBER(tmp, UNIT_HOURS, FEMININ);
}
int hours, minutes;
hours = seconds / 3600;
seconds = seconds % 3600;
minutes = seconds / 60;
seconds = seconds % 60;
tmp = seconds / 60;
seconds %= 60;
if (tmp > 0) {
if (IS_PLAY_TIME()) {
PLAY_NUMBER(tmp, 0, tmp == 1 ? FEMININ : 0);
} else {
PLAY_NUMBER(tmp, UNIT_MINUTES, FEMININ);
if (seconds > 0) PUSH_NUMBER_PROMPT(FR_PROMPT_ET);
}
}
if (IS_PLAY_LONG_TIMER() && seconds >= 30) {
minutes += 1;
}
if (!IS_PLAY_TIME() && seconds > 0) {
PLAY_NUMBER(seconds, UNIT_SECONDS, FEMININ);
if (IS_PLAY_TIME() && hours == 0) {
PUSH_NUMBER_PROMPT(FR_PROMPT_MINUIT);
} else if (IS_PLAY_TIME() && hours == 12) {
PUSH_NUMBER_PROMPT(FR_PROMPT_MIDI);
} else if (hours > 0) {
PLAY_NUMBER(hours, UNIT_HOURS, FEMININ);
}
if (minutes > 0) {
if (IS_PLAY_TIME()) {
PLAY_NUMBER(minutes, 0, minutes == 1 ? FEMININ : 0);
} else {
PLAY_NUMBER(minutes, UNIT_MINUTES, FEMININ);
}
}
if (!IS_PLAY_LONG_TIMER() && seconds > 0) {
if (minutes)
PUSH_NUMBER_PROMPT(FR_PROMPT_ET);
PLAY_NUMBER(seconds, UNIT_SECONDS, FEMININ);
}
}
LANGUAGE_PACK_DECLARE(fr, TR_VOICE_FRANCAIS);
+18 -22
View File
@@ -104,30 +104,26 @@ I18N_PLAY_FUNCTION(hu, playDuration, int seconds PLAY_DURATION_ATT)
seconds = -seconds;
}
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);
}
int hours, minutes;
hours = seconds / 3600;
seconds = seconds % 3600;
minutes = seconds / 60;
seconds = seconds % 60;
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 (IS_PLAY_LONG_TIMER() && seconds >= 30) {
minutes += 1;
}
if (seconds > 0) {
PLAY_NUMBER(seconds, UNIT_SECONDS, 0);
}
if (hours > 0 || IS_PLAY_TIME()) {
PLAY_NUMBER(hours, UNIT_HOURS, 0);
}
if (minutes > 0) {
PLAY_NUMBER(minutes, UNIT_MINUTES, 0);
}
if (!IS_PLAY_LONG_TIMER() && seconds > 0) {
PLAY_NUMBER(seconds, UNIT_SECONDS, 0);
}
}
+20 -20
View File
@@ -154,28 +154,28 @@ I18N_PLAY_FUNCTION(it, playDuration, int seconds PLAY_DURATION_ATT)
seconds = -seconds;
}
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);
}
int hours, minutes;
hours = seconds / 3600;
seconds = seconds % 3600;
minutes = seconds / 60;
seconds = seconds % 60;
tmp = seconds / 60;
seconds %= 60;
if (tmp > 0) {
PLAY_NUMBER(tmp, UNIT_MINUTES, 0);
if (seconds > 0) PUSH_NUMBER_PROMPT(IT_PROMPT_E);
}
if (IS_PLAY_LONG_TIMER() && seconds >= 30) {
minutes += 1;
}
if (seconds > 0) {
PLAY_NUMBER(seconds, UNIT_SECONDS, 0);
}
if (hours > 0 || IS_PLAY_TIME()) {
PLAY_NUMBER(hours, UNIT_HOURS, 0);
}
if (minutes > 0) {
PLAY_NUMBER(minutes, UNIT_MINUTES, 0);
}
if (!IS_PLAY_LONG_TIMER() && seconds > 0) {
if (minutes)
PUSH_NUMBER_PROMPT(IT_PROMPT_E);
PLAY_NUMBER(seconds, UNIT_SECONDS, 0);
}
}
+20 -20
View File
@@ -106,28 +106,28 @@ I18N_PLAY_FUNCTION(nl, playDuration, int seconds PLAY_DURATION_ATT)
seconds = -seconds;
}
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);
}
int hours, minutes;
hours = seconds / 3600;
seconds = seconds % 3600;
minutes = seconds / 60;
seconds = seconds % 60;
tmp = seconds / 60;
seconds %= 60;
if (tmp > 0) {
PLAY_NUMBER(tmp, UNIT_MINUTES, 0);
if (seconds > 0) PUSH_NUMBER_PROMPT(NL_PROMPT_AND);
}
if (IS_PLAY_LONG_TIMER() && seconds >= 30) {
minutes += 1;
}
if (seconds > 0) {
PLAY_NUMBER(seconds, UNIT_SECONDS, 0);
}
if (hours > 0 || IS_PLAY_TIME()) {
PLAY_NUMBER(hours, UNIT_HOURS, 0);
}
if (minutes > 0) {
PLAY_NUMBER(minutes, UNIT_MINUTES, 0);
}
if (!IS_PLAY_LONG_TIMER() && seconds > 0) {
if (minutes)
PUSH_NUMBER_PROMPT(NL_PROMPT_AND);
PLAY_NUMBER(seconds, UNIT_SECONDS, 0);
}
}
+18 -19
View File
@@ -211,27 +211,26 @@ I18N_PLAY_FUNCTION(pl, playDuration, int seconds PLAY_DURATION_ATT)
seconds = -seconds;
}
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, ZENSKI);
}
int hours, minutes;
hours = seconds / 3600;
seconds = seconds % 3600;
minutes = seconds / 60;
seconds = seconds % 60;
tmp = seconds / 60;
seconds %= 60;
if (tmp > 0) {
PLAY_NUMBER(tmp, UNIT_MINUTES, ZENSKI);
}
if (IS_PLAY_LONG_TIMER() && seconds >= 30) {
minutes += 1;
}
if (seconds > 0) {
PLAY_NUMBER(seconds, UNIT_SECONDS, ZENSKI);
}
if (hours > 0 || IS_PLAY_TIME()) {
PLAY_NUMBER(hours, UNIT_HOURS, ZENSKI);
}
if (minutes > 0) {
PLAY_NUMBER(minutes, UNIT_MINUTES, ZENSKI);
}
if (!IS_PLAY_LONG_TIMER() && seconds > 0) {
PLAY_NUMBER(seconds, UNIT_SECONDS, ZENSKI);
}
}
+35 -35
View File
@@ -138,43 +138,43 @@ I18N_PLAY_FUNCTION(pt, playDuration, int seconds PLAY_DURATION_ATT)
seconds = -seconds;
}
uint8_t ore = 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()) {
ore = tmp;
if (tmp > 2) {
PLAY_NUMBER(tmp, 0, 0);
PUSH_UNIT_PROMPT(UNIT_HOURS, 1);
} else if (tmp == 2) {
PUSH_NUMBER_PROMPT(PT_PROMPT_DUAS);
PUSH_UNIT_PROMPT(UNIT_HOURS, 1);
} else if (tmp == 1) {
PUSH_NUMBER_PROMPT(PT_PROMPT_UMA);
PUSH_UNIT_PROMPT(UNIT_HOURS, 0);
}
}
int hours, minutes;
hours = seconds / 3600;
seconds = seconds % 3600;
minutes = seconds / 60;
seconds = seconds % 60;
tmp = seconds / 60;
seconds %= 60;
if (tmp > 0 || ore > 0) {
if (tmp != 1) {
PLAY_NUMBER(tmp, 0, 0);
PUSH_UNIT_PROMPT(UNIT_MINUTES, 1);
} else {
PUSH_NUMBER_PROMPT(PT_PROMPT_NUMBERS_BASE + 1);
PUSH_UNIT_PROMPT(UNIT_MINUTES, 0);
}
if (IS_PLAY_LONG_TIMER() && seconds >= 30) {
minutes += 1;
}
if (hours > 0 || IS_PLAY_TIME()) {
if (hours > 2) {
PLAY_NUMBER(hours, 0, 0);
PUSH_UNIT_PROMPT(UNIT_HOURS, 1);
} else if (hours == 2) {
PUSH_NUMBER_PROMPT(PT_PROMPT_DUAS);
PUSH_UNIT_PROMPT(UNIT_HOURS, 1);
} else if (hours == 1) {
PUSH_NUMBER_PROMPT(PT_PROMPT_UMA);
PUSH_UNIT_PROMPT(UNIT_HOURS, 0);
}
}
if (hours > 0 || minutes > 0) {
if (minutes > 1) {
PLAY_NUMBER(minutes, 0, 0);
PUSH_UNIT_PROMPT(UNIT_MINUTES, 1);
} else {
PUSH_NUMBER_PROMPT(PT_PROMPT_NUMBERS_BASE + 1);
PUSH_UNIT_PROMPT(UNIT_MINUTES, 0);
}
}
if (!IS_PLAY_LONG_TIMER() && seconds > 0) {
if (hours || minutes)
PUSH_NUMBER_PROMPT(PT_PROMPT_E);
}
if (seconds != 1) {
if (seconds > 1) {
PLAY_NUMBER(seconds, 0, 0);
PUSH_UNIT_PROMPT(UNIT_SECONDS, 1);
} else {
+21 -20
View File
@@ -163,27 +163,28 @@ I18N_PLAY_FUNCTION(ru, playDuration, int seconds PLAY_DURATION_ATT)
seconds = -seconds;
}
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);
}
int hours, minutes;
hours = seconds / 3600;
seconds = seconds % 3600;
minutes = seconds / 60;
seconds = seconds % 60;
tmp = seconds / 60;
seconds %= 60;
if (tmp > 0) {
PLAY_NUMBER(tmp, UNIT_MINUTES, 0);
if (seconds > 0) PUSH_NUMBER_PROMPT(RU_PROMPT_AND);
}
if (seconds > 0) {
PLAY_NUMBER(seconds, UNIT_SECONDS, 0);
}
if (IS_PLAY_LONG_TIMER() && seconds >= 30) {
minutes += 1;
}
if (hours > 0 || IS_PLAY_TIME()) {
PLAY_NUMBER(hours, UNIT_HOURS, 0);
}
if (minutes > 0) {
PLAY_NUMBER(minutes, UNIT_MINUTES, 0);
}
if (!IS_PLAY_LONG_TIMER() && seconds > 0) {
if (minutes)
PUSH_NUMBER_PROMPT(RU_PROMPT_AND);
PLAY_NUMBER(seconds, UNIT_SECONDS, 0);
}
}
+20 -20
View File
@@ -99,28 +99,28 @@ I18N_PLAY_FUNCTION(se, playDuration, int seconds PLAY_DURATION_ATT)
seconds = -seconds;
}
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);
}
int hours, minutes;
hours = seconds / 3600;
seconds = seconds % 3600;
minutes = seconds / 60;
seconds = seconds % 60;
tmp = seconds / 60;
seconds %= 60;
if (tmp > 0) {
PLAY_NUMBER(tmp, UNIT_MINUTES, 0);
if (seconds > 0) PUSH_NUMBER_PROMPT(SE_PROMPT_AND);
}
if (IS_PLAY_LONG_TIMER() && seconds >= 30) {
minutes += 1;
}
if (seconds > 0) {
PLAY_NUMBER(seconds, UNIT_SECONDS, 0);
}
if (hours > 0 || IS_PLAY_TIME()) {
PLAY_NUMBER(hours, UNIT_HOURS, 0);
}
if (minutes > 0) {
PLAY_NUMBER(minutes, UNIT_MINUTES, 0);
}
if (!IS_PLAY_LONG_TIMER() && seconds > 0) {
if (minutes)
PUSH_NUMBER_PROMPT(SE_PROMPT_AND);
PLAY_NUMBER(seconds, UNIT_SECONDS, 0);
}
}
+18 -19
View File
@@ -161,27 +161,26 @@ I18N_PLAY_FUNCTION(sk, playDuration, int seconds PLAY_DURATION_ATT)
seconds = -seconds;
}
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, ZENSKY);
}
int hours, minutes;
hours = seconds / 3600;
seconds = seconds % 3600;
minutes = seconds / 60;
seconds = seconds % 60;
tmp = seconds / 60;
seconds %= 60;
if (tmp > 0) {
PLAY_NUMBER(tmp, UNIT_MINUTES, ZENSKY);
}
if (IS_PLAY_LONG_TIMER() && seconds >= 30) {
minutes += 1;
}
if (seconds > 0) {
PLAY_NUMBER(seconds, UNIT_SECONDS, ZENSKY);
}
if (hours > 0 || IS_PLAY_TIME()) {
PLAY_NUMBER(hours, UNIT_HOURS, ZENSKY);
}
if (minutes > 0) {
PLAY_NUMBER(minutes, UNIT_MINUTES, ZENSKY);
}
if (!IS_PLAY_LONG_TIMER() && seconds > 0) {
PLAY_NUMBER(seconds, UNIT_SECONDS, ZENSKY);
}
}