Example #1
0
I18N_PLAY_FUNCTION(en, playDuration, int seconds PLAY_DURATION_ATT)
{
  if (seconds == 0) {
    PLAY_NUMBER(seconds, 0, 0);
    return;
  }

  if (seconds < 0) {
    PUSH_NUMBER_PROMPT(EN_PROMPT_MINUS);
    seconds = -seconds;
  }

  uint8_t 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);
    if (seconds > 0)
      PUSH_NUMBER_PROMPT(EN_PROMPT_AND);
  }

  if (seconds > 0) {
    PLAY_NUMBER(seconds, UNIT_SECONDS, 0);
  }
}
Example #2
0
I18N_PLAY_FUNCTION(fr, playDuration, int seconds PLAY_DURATION_ATT)
{
  if (seconds == 0) {
    PLAY_NUMBER(0, 0, FEMININ);
    return;
  }

  if (seconds < 0) {
    PUSH_NUMBER_PROMPT(FR_PROMPT_MOINS);
    seconds = -seconds;
  }

  uint8_t 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, 0, FEMININ);
    PUSH_NUMBER_PROMPT(FR_PROMPT_HEURE);
  }

  tmp = seconds / 60;
  seconds %= 60;
  if (tmp > 0) {
    if (IS_PLAY_TIME()) {
      PLAY_NUMBER(tmp, 0, tmp==1 ? FEMININ : 0);
    }
    else {
      PLAY_NUMBER(tmp, 0, FEMININ);
      PUSH_NUMBER_PROMPT(FR_PROMPT_MINUTE);
#if !defined(NOANDSECONDE)
      if (seconds > 0) PUSH_NUMBER_PROMPT(FR_PROMPT_ET);
#endif        
    }
  }

  if (!IS_PLAY_TIME() && seconds > 0) {
    PLAY_NUMBER(seconds, 0, FEMININ);
    PUSH_NUMBER_PROMPT(FR_PROMPT_SECONDE);
  }
}
Example #3
0
I18N_PLAY_FUNCTION(it, playDuration, int seconds PLAY_DURATION_ATT)
{
  if (seconds < 0) {
    PUSH_NUMBER_PROMPT(IT_PROMPT_MENO);
    seconds = -seconds;
  }

  uint8_t ore = 0;
  uint8_t tmp = seconds / 3600;
  seconds %= 3600;
  if (tmp > 0) {
    ore=tmp;
    if (tmp > 1 || IS_PLAY_TIME()) {
      PLAY_NUMBER(tmp, 0, 0);
      PUSH_NUMBER_PROMPT(IT_PROMPT_ORE);
    } else {
      PUSH_NUMBER_PROMPT(IT_PROMPT_UN);
      PUSH_NUMBER_PROMPT(IT_PROMPT_ORA);
    }
  }
  if (seconds>0) {
    tmp = seconds / 60;
    seconds %= 60;
    if (tmp>0 && seconds==0 && ore>0) {
      PUSH_NUMBER_PROMPT(IT_PROMPT_E);
    }
    if (tmp > 0) {
      if (tmp != 1) {
        PLAY_NUMBER(tmp, 0, 0);
        PUSH_NUMBER_PROMPT(IT_PROMPT_MINUTI);
      } else {
        PUSH_NUMBER_PROMPT(IT_PROMPT_UN);
        PUSH_NUMBER_PROMPT(IT_PROMPT_MINUTO);
      }
    }
    if ((tmp>0 || ore>0) && seconds>0) {
      PUSH_NUMBER_PROMPT(IT_PROMPT_E);
    }
  }
  if (seconds != 0 || (ore==0 && tmp==0)) {
    if (seconds != 1) {
      PLAY_NUMBER(seconds, 0, 0);
      PUSH_NUMBER_PROMPT(IT_PROMPT_SECONDI);
    } else {
      PUSH_NUMBER_PROMPT(IT_PROMPT_UN);
      PUSH_NUMBER_PROMPT(IT_PROMPT_SECONDO);
    }
  }
}
Example #4
0
I18N_PLAY_FUNCTION(pt, playDuration, int seconds PLAY_DURATION_ATT)
{
  if (seconds < 0) {
    PUSH_NUMBER_PROMPT(PT_PROMPT_MENOS);
    seconds = -seconds;
  }

  uint8_t ore = 0;
  uint8_t tmp = seconds / 3600;
  seconds %= 3600;
  if (tmp > 0 || IS_PLAY_TIME()) {
    ore=tmp;
    if (tmp > 2) {
      PLAY_NUMBER(tmp, 0, 0);
      PUSH_NUMBER_PROMPT(PT_PROMPT_HORAS);
    } else if (tmp==2) {
      PUSH_NUMBER_PROMPT(PT_PROMPT_DUAS);
      PUSH_NUMBER_PROMPT(PT_PROMPT_HORAS);
    } else if (tmp==1) {
      PUSH_NUMBER_PROMPT(PT_PROMPT_UMA);
      PUSH_NUMBER_PROMPT(PT_PROMPT_HORA);
    }
  }

  tmp = seconds / 60;
  seconds %= 60;
  if (tmp > 0 || ore >0) {
    if (tmp != 1) {
      PLAY_NUMBER(tmp, 0, 0);
      PUSH_NUMBER_PROMPT(PT_PROMPT_MINUTOS);
    } else {
      PUSH_NUMBER_PROMPT(PT_PROMPT_NUMBERS_BASE+1);
      PUSH_NUMBER_PROMPT(PT_PROMPT_MINUTO);
    }
    PUSH_NUMBER_PROMPT(PT_PROMPT_E);
  }

  if (seconds != 1) {
    PLAY_NUMBER(seconds, 0, 0);
    PUSH_NUMBER_PROMPT(PT_PROMPT_SEGUNDOS);
  } else {
    PUSH_NUMBER_PROMPT(PT_PROMPT_NUMBERS_BASE+1);
    PUSH_NUMBER_PROMPT(PT_PROMPT_SEGUNDO);
  }
}
Example #5
0
I18N_PLAY_FUNCTION(cz, playDuration, int seconds PLAY_DURATION_ATT)
{
  if (seconds < 0) {
    PUSH_NUMBER_PROMPT(CZ_PROMPT_MINUS);
    seconds = -seconds;
  }

  uint8_t tmp = seconds / 3600;
  seconds %= 3600;
  if (tmp > 0 || IS_PLAY_TIME()) {
    PLAY_NUMBER(tmp, UNIT_HOURS+1, ZENSKY);
  }

  tmp = seconds / 60;
  seconds %= 60;
  if (tmp > 0) {
    PLAY_NUMBER(tmp, UNIT_MINUTES+1, ZENSKY);
  }

  if (seconds > 0) {
    PLAY_NUMBER(seconds, UNIT_SECONDS+1, ZENSKY);
  }
}