⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 aphearsay.h

📁 本电子词典是名人928的学习机代码,主要是电子学习机AP,其他还没有传
💻 H
📖 第 1 页 / 共 2 页
字号:
/****************************************************************************/
/*                                                                          */
/*              Copyright (C) 2005 SHENZHEN MEIJIN CO.LTD                   */
/*                                                                          */
/* FILE NAME:   ApHearSay.h                                                 */
/* MODULE NAME: AP应用程序Header                                            */
/* DESCRIPTION: 复读机学习AP的函数 Header                                   */
/*                                                                          */
/* FUNCTIONS:                                                               */
/*                                                                          */
/****************************************************************************/
/*    NAME         DATE               REMARKS                               */
/* ==========  ============   ==============================================*/
/*   DennyHan    2006-03-07         First Issue                             */
/****************************************************************************/
#ifndef _APHEARSAY_H_
#define _APHEARSAY_H_          1


#define APHS_KEY_A              ('A')
#define APHS_KEY_A_EXP          (APHS_KEY_A+0x4000)

#define APHS_IFINITE_CYCLE_SET      1
#define APHS_MAX_CYCLE          10
#define APHS_MIN_CYCLE          2

#ifdef  APHS_IFINITE_CYCLE_SET
    #define APHS_IFINITE_CYCLE      (APHS_MAX_CYCLE+1)
#else
    #define APHS_IFINITE_CYCLE      (APHS_MAX_CYCLE)
#endif



    #define APHS_AUTO_INVERT_EN            1
    #define APHS_AUTO_KEY_VIEW_DIS         1       // Disable key browser




//==========================================================================
//
// Export function
//
//-----------------------------------
#define     APC_HEARSAY_RTNUP     0       // Return last interface
#define     APC_HEARSAY_RTNDN     1       // going to next interface
INT ApComHearSay(INT *pRet,const char *pTitle, UINT8 *pFile);

//==========================================================================
// Internal Used
//-----------------------------------

#define APHEARSAY_MAX_PATH      (FILE_LENGTH_NAME + 1)
//======================================================
// Hearsayfile.h

//---------------------------------------------------------
#define	RR_MODE_MANUAL		1                   //手动模式
#define	RR_MODE_AUTOMATIC	2                   //自动模式
#define	RR_MODE_NOMST		4                   //不是MST文件
#define RR_MODE_TEXT        8                   //是TXT文件
#define RR_MODE_NOTEXT      16                  //不是TXT文件


//MST头文件结构
typedef struct tagMSTFILE_HEADER
{
    UINT32 dwSignature;     //文件类型标识,必须为"MST\0",即值0x54534D;
    UINT16 wHeaderSize;     //头结构大小,必须等于"sizeof(MSTFILE_HEADER)"
    UINT16 wReserved1;      //MST文件保留字,必须为0
    UINT32 dwMp3NameOffs;   //对应MP3文件名所在的偏移位置
    UINT16 wNodes;          //时间点索引个数
    UINT16 wReserved2;      //MST文件保留字,必须为0
} MSTFILE_HEADER;

// MST文件数据结构
typedef struct tagSYNCDATAITEM
{
    UINT32 wTime;           //本项同步文本对应的起始时间点
    UINT32 wTimeLen;        //本项同步文本对应的时间长度
    UINT32 dwDataOffset;    //本项同步文本所在MST文件的偏移位置
} SYNCDATAITEM;

#define     APHS_TBUF_SIZE          (12+2*(FILE_MAX_NAMELEN + 1))
#define     APHS_TEMPBUF_SIZE       ((APHS_TBUF_SIZE+sizeof(unsigned)-1 )       \
                                        /(sizeof(unsigned))*(sizeof(unsigned)) )
#define     MVOIC_BUFFER            ((sizeof(MVoicePlayParam)+3)/4*4)


typedef struct tagPalyS
{
    VoiceHandle     hPlay;  			// For Play
    BOOL            bOpen;              // 0= Close, 1 Open
    UINT32          dwPlayTm;   		// For Play Time
    UINT32          dwTotalTm; 			// For Play Time
    UINT16          wStep; 			    // For Time Bar step every 0.5S
    UINT16          wTotalStep;    	    // For Time Bar total step every 0.5S
    UINT32          dwPrevTm;   		// For Play Time        // back for play time for repeat
    UINT32          dwCurTm;            // For Follow Mode BackUp
}tfsPLAY;

// for Sound Mode
#define APHS_SOUND_NONE         0x00    // Play sound
#define APHS_SOUND_PLAY         0x01    // Play sound
#define APHS_SOUND_PLAYREC      0x02    // Play record
#define APHS_SOUND_REC          0x04    // Record

#define APHS_REPEAT           0x0200      // Repeat
#define APHS_FOLLOW           0x0400      // Follow
#define APHS_JUMP             0x0800      // Jump
#define APHS_REPEAT_OCCUR     0x1000      // Repeat

//------------------------------
// total 168 bytes for this structure
typedef struct tagRrParam					//Reread状态参数
{
    //-----------------------------------------------------------
    // Added by dennyhan
	INT			    nApRet;
	const UINT8     *pTitle;
	UINT8		    *pFile;
    UINT            uStopCntDelay;          /// For bug 2886
    //--------------------------------------------------
    UINT16			wSndMode;
    UINT16          wSavekPevNode;          // for browser text node
                                            // if invert is diabled
    //--------------------------------------------------
    UINT8           *pHint;
    UINT16          wHintCnt;
    UINT16          wPadding1;
    //----------------
    UINT16          wSkipMstCnt;
    UINT16          wNode;

    //--------------------------------------------------
    APGUI_STRUCT    *pBwrGui;
	UINT8		    *pTBuf;         //[sizeof(UINT8*)];              //[12+FILE_LENGTH_NAME + 1];     // Must be >=INI file Length

    //--------------------------------------------------
    BOOL            bSyncMtlEntry;
    //----------------------------------------------------------------
    INT				hRrMstFile;
    INT             hTmpFile;               // Temp Text File
    // Only Mst File and Txt File use the following
    UINT            uTmpFileBlkTotalNum;    // Temp Text File
    UINT            uTmpFileBlkNum;         // Temp Text File
    UINT            uTmpFileBlkLen;         // Temp Text File
    UINT            uTmpFileLen;            // Temp Text File
    UINT8           *pTempBlkBuf;
    UINT            uTempFilePos;
    UINT            uTmpCurLen;
    //-----------------------------------------------------------------
    UINT8			*pDispBuf;              // it is used file buffer
    UINT8			*pTextBuf;              // it is used as text display buffer
    MSTFILE_HEADER  *pMstFileHdr;

    UINT8           *pBwrBuf;              // for Browser  Display Buffer

    UINT32			dwDispHead;             // Mst display started pointer
    UINT32			dwDispLength;           // mst display ending pointer
    UINT32			dwStLine;               // Mst current Node Start Line
    UINT32			dwEndLine;              // Mst current Node End   Line

    BOOL            bMarkFlag;              // for Mark

    UINT16			wRptMode;				//复读状态
    UINT16			wRptTotalCycles;		//复读总循环数
    UINT16			wRptCycles;             //当前复读环数
    UINT16          wPadding2;

    UINT32          dwRptTmA;                // Repeat time of A
    UINT32          dwRptTmB;                // Repeat time of B
    BOOL            bRpt;
    //----------
    UINT16			wFollowCycles;          //对比数
    //-------------------------------
    UINT16			wTmABSetFlag;            //Time of A
#define     APHS_TMA_SET            1
#define     APHS_TMB_SET            2
#define     APHS_TMAB_BAK_SET       4
#define     APHS_TMA_KEY_SET        8

    UINT32			dwTmA;                  //Time of A
    UINT32			dwTmB;                  //Time of B
    UINT16			wStepA;                 //Step of A     // Temp V
    UINT16			wStepB;                 //Step of B     // Temp V
    UINT32			dwBakTmA;               //Time of A
    UINT32			dwBakTmB;               //Time of B
    //--------------------------------------------------------------
#define     APHS_TIMERID        0x4150
#define     APHS_TIMER_LEN      500
    HTIMER          hTimer;

    //---------------------------------------------------------------
    MRecord         *mRecord;
//    MVoicePlayParam	aPlayParam;				// 声音状态
    MVoicePlayParam	*pPlayParam;	        // For play param of voice control
    tfsPLAY         aPlay[2];
}RrParam, *PRRPARAM, HEARSAY,*PHEARSAY;


typedef struct setting
{
//	BOOL   hFileDir;
	BOOL   hAuto;
	UINT32	hTimes;
} HEARSAYSET,*PHEARSAYSET;



//==================================================================================
//
// AP应用程序接口函数声明
//
//==================================================================================

//==================================================================================
// init.c
//--------------
BOOL ApHearsayIniParam(VOID);           //Allocation memory

//==================================================================================
// init.c
//--------------
BOOL EditSaveSetting(VOID);
BOOL EditLoadSetting(VOID);
BOOL PathSaveSetting(VOID);
BOOL LoadSaveParam  (VOID);
BOOL LoadSaveFile  (UINT8 *p);


//==================================================================================
// Set.c
//--------------
INT  HearSaySetMain(INT nParam);
BOOL EditLoadSetting(VOID);
//=====================================================================
// Ap Heasrsaybar.c
//---------------

    #define HEARSAY_BTN_T           (BT_TYPE_ICON)
    #define HEARSAY_BTN_W           ((LCD_SCREEN_WIDTH)/16)-12
    #define HEARSAY_BTN_H           16
    #define HEARSAY_BTN_W_SP        ((LCD_SCREEN_WIDTH)/4-8-HEARSAY_BTN_W)
    #define HEARSAY_BTN_TXSP        4

#define HEARSAY_BTN_X           0
#define HEARSAY_BTN_Y           (LCD_SCREEN_HEIGHT-HEARSAY_BTN_H)


#define HEARSAY_BTN1_X          2
#define HEARSAY_BTN1_W          HEARSAY_BTN_W
#define HEARSAY_BTN1_H          HEARSAY_BTN_H 
#define HEARSAY_BTN1_Y          HEARSAY_BTN_Y
#define HEARSAY_BTN1_T          HEARSAY_BTN_T
#define HEARSAY_BTN1_CMD        (CM_USER+0)
//#define HEARSAY_BTN1_KEY        '1'         // Play/Pause
#define HEARSAY_BTN1_KEY        'Q'         // Play/Pause
#define HEARSAY_BTN11_KEY        'q'         // Play/Pause

#define HEARSAY_BTN2_X          65
#define HEARSAY_BTN2_W          HEARSAY_BTN_W
#define HEARSAY_BTN2_H          HEARSAY_BTN_H
#define HEARSAY_BTN2_Y          HEARSAY_BTN_Y
#define HEARSAY_BTN2_T          HEARSAY_BTN_T
#define HEARSAY_BTN2_CMD        (CM_USER+1)
//#define HEARSAY_BTN2_KEY        '2'        // Fudu
#define HEARSAY_BTN2_KEY        'W'        // Fudu
#define HEARSAY_BTN22_KEY        'w'        // Fudu

#define HEARSAY_BTN3_X          HEARSAY_BTN2_X+65
#define HEARSAY_BTN3_W          HEARSAY_BTN_W
#define HEARSAY_BTN3_H          HEARSAY_BTN_H
#define HEARSAY_BTN3_Y          HEARSAY_BTN_Y
#define HEARSAY_BTN3_T          HEARSAY_BTN_T
#define HEARSAY_BTN3_CMD        (CM_USER+2)
//#define HEARSAY_BTN3_KEY        '3'        // Repeat
#define HEARSAY_BTN3_KEY        'E'        // Repeat
#define HEARSAY_BTN33_KEY        'e'        // Repeat

#define HEARSAY_BTN4_X          HEARSAY_BTN3_X+65
#define HEARSAY_BTN4_W          HEARSAY_BTN_W
#define HEARSAY_BTN4_H          HEARSAY_BTN_H 
#define HEARSAY_BTN4_Y          HEARSAY_BTN_Y
#define HEARSAY_BTN4_T          HEARSAY_BTN_T
#define HEARSAY_BTN4_CMD        (CM_USER+3)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -