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
56 #define FR_PUSH_UNIT_PROMPT(u) fr_pushUnitPrompt((u), id)
58 I18N_PLAY_FUNCTION(fr
, pushUnitPrompt
, uint8_t unitprompt
)
60 PUSH_UNIT_PROMPT(unitprompt
, 0);
65 I18N_PLAY_FUNCTION(fr
, playNumber
, getvalue_t number
, uint8_t unit
, uint8_t att
)
67 /* if digit >= 1000000000:
68 temp_digit, digit = divmod(digit, 1000000000)
69 prompts.extend(self.getNumberPrompt(temp_digit))
70 prompts.append(Prompt(GUIDE_00_BILLION, dir=2))
72 temp_digit, digit = divmod(digit, 1000000)
73 prompts.extend(self.getNumberPrompt(temp_digit))
74 prompts.append(Prompt(GUIDE_00_MILLION, dir=2))
78 PUSH_NUMBER_PROMPT(FR_PROMPT_MOINS
);
83 int8_t mode
= MODE(att
);
88 div_t qr
= div((int)number
, 10);
90 PLAY_NUMBER(qr
.quot
, 0, 0);
91 PUSH_NUMBER_PROMPT(FR_PROMPT_VIRGULE_BASE
+ qr
.rem
);
101 PLAY_NUMBER(number
/ 1000, 0, 0);
102 PUSH_NUMBER_PROMPT(FR_PROMPT_MILLE
);
109 PUSH_NUMBER_PROMPT(FR_PROMPT_ZERO
+ number
/100);
110 PUSH_NUMBER_PROMPT(FR_PROMPT_CENT
);
115 if (((number
% 10) == 1) && number
< 90 && (att
& FEMININ
)) {
116 PUSH_NUMBER_PROMPT(FR_PROMPT_UNE
+(number
/10));
118 else if (number
>= 0) {
119 PUSH_NUMBER_PROMPT(FR_PROMPT_ZERO
+number
);
123 FR_PUSH_UNIT_PROMPT(unit
);
127 I18N_PLAY_FUNCTION(fr
, playDuration
, int seconds PLAY_DURATION_ATT
)
130 PLAY_NUMBER(0, 0, FEMININ
);
135 PUSH_NUMBER_PROMPT(FR_PROMPT_MOINS
);
139 uint8_t tmp
= seconds
/ 3600;
141 if (IS_PLAY_TIME() && tmp
==0) {
142 PUSH_NUMBER_PROMPT(FR_PROMPT_MINUIT
);
144 else if (IS_PLAY_TIME() && tmp
==12) {
145 PUSH_NUMBER_PROMPT(FR_PROMPT_MIDI
);
148 PLAY_NUMBER(tmp
, UNIT_HOURS
, FEMININ
);
154 if (IS_PLAY_TIME()) {
155 PLAY_NUMBER(tmp
, 0, tmp
==1 ? FEMININ
: 0);
158 PLAY_NUMBER(tmp
, UNIT_MINUTES
, FEMININ
);
160 PUSH_NUMBER_PROMPT(FR_PROMPT_ET
);
164 if (!IS_PLAY_TIME() && seconds
> 0) {
165 PLAY_NUMBER(seconds
, UNIT_SECONDS
, FEMININ
);
169 LANGUAGE_PACK_DECLARE(fr
, "Francais");