/*************************************************************************** * __________ __ ___. * Open \______ \ ____ ____ | | _\_ |__ _______ ___ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ * \/ \/ \/ \/ \/ * $Id$ * * Copyright (C) 2004 Jörg Hohensohn * * This module collects the Talkbox and voice UI functions. * (Talkbox reads directory names from mp3 clips called thumbnails, * the voice UI lets menus and screens "talk" from a voicefont in memory. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ****************************************************************************/ #ifndef __TALK_H__ #define __TALK_H__ #include #include #include "time.h" #define VOICE_VERSION 400 /* 4.00 - if you change this, change it in voicefont too */ enum { /* See array "unit_voiced" in talk.c function "talk_value" */ UNIT_INT = 1, /* plain number */ UNIT_SIGNED, /* number with mandatory sign (even if positive) */ UNIT_MS, /* milliseconds */ UNIT_SEC, /* seconds */ UNIT_MIN, /* minutes */ UNIT_HOUR, /* hours */ UNIT_KHZ, /* kHz */ UNIT_DB, /* dB, mandatory sign */ UNIT_PERCENT, /* % */ UNIT_MAH, /* milliAmp hours */ UNIT_PIXEL, /* pixels */ UNIT_PER_SEC, /* per second */ UNIT_HERTZ, /* hertz */ UNIT_MB, /* Megabytes */ UNIT_KBIT, /* kilobits per sec */ UNIT_PM_TICK, /* peak meter units per tick */ UNIT_TIME, /* time duration/interval in seconds, says hours,mins,secs */ UNIT_DATEYEAR,/* for 1999 say nineteen ninety nine */ UNIT_LAST /* END MARKER */ }; /* Status of loading talk file, shown in debug_menu */ enum talk_status { TALK_STATUS_OK = 0, TALK_STATUS_ERR_OOM, TALK_STATUS_ERR_ALLOC, TALK_STATUS_ERR_NOFILE, TALK_STATUS_ERR_INCOMPATIBLE }; enum talk_speakmode { /* voice mode: 0=off, 1=number, 2=spell */ TALK_SPEAK_OFF = 0, TALK_SPEAK_NUMBER, TALK_SPEAK_SPELL }; #define UNIT_SHIFT (32-5) /* this many bits left from UNIT_xx enum */ #define DECIMAL_SHIFT (32 - 8) /* make a "talkable" ID from number + unit unit is upper 4 bits, number the remaining (in regular 2's complement) */ #define TALK_ID(n,u) (((long)(u))<