Intel 05-2342-002 Computer Accessories User Manual


 
Voice API for Linux Demo Guide — June 2005 27
Demo Details
that can be used, DL_PREV and DL_CURR. DL_PREV returns the caller to the previous
menu, and DL_CURR returns the caller to the current menu.
me_validfnc
Validation Function - Pointer to the function that validates the caller's response. This function
returns a DL_MNUOPTS structure containing the response that was chosen.
me_prompt
Prompt Message - Pointer to the voice prompt message for this menu.
me_retry
Retry Message - Pointer to the retry prompt message for this menu. This message is played if
the caller response is not found in the option table.
me_error
Error Function - Pointer to the function that will handle a fatal error occurring during this
menu. Fatal errors occur when a valid response is not given within the maximum number of
retries. The maximum number of retries is set by the DL_DATA structure associated with this
menu.
me_data
Data Table - Pointer to a DL_DATA structure that defines the termination conditions for
getting data during this menu.
The DL_MENU structure implements the functions a menu must perform. A menu needs to:
provide options to the caller
prompt the caller to input an option
validate the caller input
perform an action based on input
provide a prompt if the caller makes a mistake
provide a way out if a fatal error occurs
transfer control to some other menu or itself when everything is done
The fields of a DL_MENU structure provide the means to specify all these functions. The root
menu for d40demo is defined in a DL_MENU structure with the variable name menu_1. The
comments explain what each value indicates.
DL_MENU menu_1 = {
menu1_opts, /* The option table for menu 1 is in menu1_opts */
DM_CURR, /* Return to current menu after completing action */
val_menu, /* val_menu( ) is the input validation function */
"mm_menu", /* mm_menu is the main menu voice prompt */
"mm_retry", /* mm_retry is the main menu retry prompt */
goodbye, /* goodbye( ) is the error function */
&data_1 /* The termination condition are in data_1 */
};
DL_MNUOPTS Data Structure
The DL_MNUOPTS structure defines the caller's response options for a menu. It specifies the
digits a caller can enter and whether the digits indicate an action or another menu. The options for a