2 * Authors (alphabetical order)
3 * - Andre Bernet <bernet.andre@gmail.com>
4 * - Bertrand Songis <bsongis@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 FR_PROMPT_NUMBERS_BASE
= 0,
27 FR_PROMPT_ZERO
= FR_PROMPT_NUMBERS_BASE
+0,
28 FR_PROMPT_CENT
= FR_PROMPT_NUMBERS_BASE
+100,
29 FR_PROMPT_DEUX_CENT
= FR_PROMPT_CENT
+1,
30 FR_PROMPT_MILLE
= FR_PROMPT_CENT
+9,
34 FR_PROMPT_VINGT_ET_UNE
,
35 FR_PROMPT_TRENTE_ET_UNE
,
36 FR_PROMPT_QUARANTE_ET_UNE
,
37 FR_PROMPT_CINQUANTE_ET_UNE
,
38 FR_PROMPT_SOIXANTE_ET_UNE
,
39 FR_PROMPT_SOIXANTE_ET_ONZE
,
40 FR_PROMPT_QUATRE_VINGT_UNE
,
42 FR_PROMPT_VIRGULE
= 119,
44 FR_PROMPT_MOINS
= 121,
45 FR_PROMPT_MINUIT
= 122,
48 FR_PROMPT_UNITS_BASE
= 124,
49 FR_PROMPT_HEURE
= FR_PROMPT_UNITS_BASE
+UNIT_HOURS
,
50 FR_PROMPT_MINUTE
= FR_PROMPT_UNITS_BASE
+UNIT_MINUTES
,
51 FR_PROMPT_SECONDE
= FR_PROMPT_UNITS_BASE
+UNIT_SECONDS
,
52 FR_PROMPT_VIRGULE_BASE
= 180, //,0 - ,9
58 #define FR_PUSH_UNIT_PROMPT(u) fr_pushUnitPrompt((u), id)
60 #define FR_PUSH_UNIT_PROMPT(u) pushUnitPrompt((u))
63 I18N_PLAY_FUNCTION(fr
, pushUnitPrompt
, uint8_t unitprompt
)
66 PUSH_UNIT_PROMPT(unitprompt
, 0);
68 unitprompt
= FR_PROMPT_UNITS_BASE
+ unitprompt
*2;
69 PUSH_NUMBER_PROMPT(unitprompt
);
75 I18N_PLAY_FUNCTION(fr
, playNumber
, getvalue_t number
, uint8_t unit
, uint8_t att
)
77 /* if digit >= 1000000000:
78 temp_digit, digit = divmod(digit, 1000000000)
79 prompts.extend(self.getNumberPrompt(temp_digit))
80 prompts.append(Prompt(GUIDE_00_BILLION, dir=2))
82 temp_digit, digit = divmod(digit, 1000000)
83 prompts.extend(self.getNumberPrompt(temp_digit))
84 prompts.append(Prompt(GUIDE_00_MILLION, dir=2))
88 PUSH_NUMBER_PROMPT(FR_PROMPT_MOINS
);
95 convertUnit(number
, unit
);
96 if (IS_IMPERIAL_ENABLE()) {
97 if (unit
== UNIT_DIST
) {
100 if (unit
== UNIT_SPEED
) {
108 int8_t mode
= MODE(att
);
115 // we assume that we are PREC1
117 div_t qr
= div((int)number
, 10);
119 PLAY_NUMBER(qr
.quot
, 0, 0);
120 PUSH_NUMBER_PROMPT(FR_PROMPT_VIRGULE_BASE
+ qr
.rem
);
128 if (number
>= 1000) {
130 PLAY_NUMBER(number
/ 1000, 0, 0);
131 PUSH_NUMBER_PROMPT(FR_PROMPT_MILLE
);
138 PUSH_NUMBER_PROMPT(FR_PROMPT_ZERO
+ number
/100);
139 PUSH_NUMBER_PROMPT(FR_PROMPT_CENT
);
144 if (((number
% 10) == 1) && number
< 90 && (att
& FEMININ
)) {
145 PUSH_NUMBER_PROMPT(FR_PROMPT_UNE
+(number
/10));
147 else if (number
>= 0) {
148 PUSH_NUMBER_PROMPT(FR_PROMPT_ZERO
+number
);
152 FR_PUSH_UNIT_PROMPT(unit
);
156 I18N_PLAY_FUNCTION(fr
, playDuration
, int seconds PLAY_DURATION_ATT
)
159 PLAY_NUMBER(0, 0, FEMININ
);
164 PUSH_NUMBER_PROMPT(FR_PROMPT_MOINS
);
168 uint8_t tmp
= seconds
/ 3600;
170 if (IS_PLAY_TIME() && tmp
==0) {
171 PUSH_NUMBER_PROMPT(FR_PROMPT_MINUIT
);
173 else if (IS_PLAY_TIME() && tmp
==12) {
174 PUSH_NUMBER_PROMPT(FR_PROMPT_MIDI
);
177 PLAY_NUMBER(tmp
, UNIT_HOURS
, FEMININ
);
183 if (IS_PLAY_TIME()) {
184 PLAY_NUMBER(tmp
, 0, tmp
==1 ? FEMININ
: 0);
187 PLAY_NUMBER(tmp
, UNIT_MINUTES
, FEMININ
);
189 PUSH_NUMBER_PROMPT(FR_PROMPT_ET
);
193 if (!IS_PLAY_TIME() && seconds
> 0) {
194 PLAY_NUMBER(seconds
, UNIT_SECONDS
, FEMININ
);
198 LANGUAGE_PACK_DECLARE(fr
, "Francais");