2 * Authors (alphabetical order)
3 * - Bertrand Songis <bsongis@gmail.com>
4 * - Martin Hotar <mhotar@gmail.com>
6 * opentx is based on code named
7 * gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/,
8 * er9x by Erez Raviv: http://code.google.com/p/er9x/,
9 * and the original (and ongoing) project by
10 * Thomas Husterer, th9x: http://code.google.com/p/th9x/
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
26 CZ_PROMPT_NUMBERS_BASE
= 0,
27 CZ_PROMPT_NULA
= CZ_PROMPT_NUMBERS_BASE
+0, // 0-99
28 CZ_PROMPT_STO
= CZ_PROMPT_NUMBERS_BASE
+100, // 100,200 .. 900
29 CZ_PROMPT_TISIC
= CZ_PROMPT_NUMBERS_BASE
+109, // 1000
30 CZ_PROMPT_TISICE
= CZ_PROMPT_NUMBERS_BASE
+110,
31 CZ_PROMPT_JEDEN
= CZ_PROMPT_NUMBERS_BASE
+111,
32 CZ_PROMPT_JEDNO
= CZ_PROMPT_NUMBERS_BASE
+112,
33 CZ_PROMPT_DVE
= CZ_PROMPT_NUMBERS_BASE
+113,
34 CZ_PROMPT_CELA
= CZ_PROMPT_NUMBERS_BASE
+114,
35 CZ_PROMPT_CELE
= CZ_PROMPT_NUMBERS_BASE
+115,
36 CZ_PROMPT_CELYCH
= CZ_PROMPT_NUMBERS_BASE
+116,
37 CZ_PROMPT_MINUS
= CZ_PROMPT_NUMBERS_BASE
+117,
39 CZ_PROMPT_UNITS_BASE
= 118, // (jeden)volt,(dva)volty,(pet)voltu,(desetina)voltu
43 #define CZ_PUSH_UNIT_PROMPT(u, p) cz_pushUnitPrompt((u), (p), id)
49 I18N_PLAY_FUNCTION(cz
, pushUnitPrompt
, uint8_t unit
, int16_t number
)
51 TRACE("CZSAY unit:%d number:%d", unit
, number
);
53 PUSH_UNIT_PROMPT(unit
, 0);
54 else if (number
> 1 && number
< 5)
55 PUSH_UNIT_PROMPT(unit
, 1);
57 PUSH_UNIT_PROMPT(unit
, 2);
60 I18N_PLAY_FUNCTION(cz
, playNumber
, getvalue_t number
, uint8_t unit
, uint8_t att
)
63 PUSH_NUMBER_PROMPT(CZ_PROMPT_MINUS
);
68 int8_t mode
= MODE(att
);
73 div_t qr
= div((int)number
, 10);
75 PLAY_NUMBER(qr
.quot
, 0, FEMALE
);
77 PUSH_NUMBER_PROMPT(CZ_PROMPT_CELA
);
79 else if (qr
.quot
> 1 && qr
.quot
< 5) {
80 PUSH_NUMBER_PROMPT(CZ_PROMPT_CELE
);
83 PUSH_NUMBER_PROMPT(CZ_PROMPT_CELYCH
);
85 PLAY_NUMBER(qr
.rem
, 0, FEMALE
);
86 PUSH_UNIT_PROMPT(unit
, 3);
98 case UNIT_FEET_PER_SECOND
:
118 if ((number
== 1) && (att
== MALE
)) {
119 PUSH_NUMBER_PROMPT(CZ_PROMPT_JEDEN
);
123 if ((number
== 1) && (att
== NEUTRAL
)) {
124 PUSH_NUMBER_PROMPT(CZ_PROMPT_JEDNO
);
128 if ((number
== 2) && ((att
== FEMALE
) || (att
== NEUTRAL
))) {
129 PUSH_NUMBER_PROMPT(CZ_PROMPT_DVE
);
133 if (number
>= 1000) {
135 PLAY_NUMBER(number
/ 1000, 0, 0);
136 if (number
>= 2000 && number
< 5000)
137 PUSH_NUMBER_PROMPT(CZ_PROMPT_TISICE
);
139 PUSH_NUMBER_PROMPT(CZ_PROMPT_TISIC
);
145 PUSH_NUMBER_PROMPT(CZ_PROMPT_STO
+ (number
/100)-1);
152 PUSH_NUMBER_PROMPT(CZ_PROMPT_NULA
+number
);
156 CZ_PUSH_UNIT_PROMPT(unit
, tmp
);
160 I18N_PLAY_FUNCTION(cz
, playDuration
, int seconds PLAY_DURATION_ATT
)
163 PUSH_NUMBER_PROMPT(CZ_PROMPT_MINUS
);
167 uint8_t tmp
= seconds
/ 3600;
169 if (tmp
> 0 || IS_PLAY_TIME()) {
170 PLAY_NUMBER(tmp
, UNIT_HOURS
, FEMALE
);
176 PLAY_NUMBER(tmp
, UNIT_MINUTES
, FEMALE
);
180 PLAY_NUMBER(seconds
, UNIT_SECONDS
, FEMALE
);
184 LANGUAGE_PACK_DECLARE(cz
, "Czech");