📄 aphearsaysndrecord.c
字号:
/****************************************************************************/
/* */
/* Copyright (C) 2005 SHENZHEN MEIJIN CO.LTD */
/* */
/* FILE NAME: ApHearSaySndRecord.c */
/* MODULE NAME: AP应用程序 */
/* DESCRIPTION: Hearsay Sound File */
/* */
/* FUNCTIONS: */
/* */
/****************************************************************************/
/* NAME DATE REMARKS */
/* ========== ============ ==============================================*/
/* DennyHan 2006-03-14 V1.00B */
/****************************************************************************/
// 包含必要的头文件
#include "Ap.h"
#include "ApHearSay.h"
extern RrParam g_RrParam;
//============================================================================
// Record Part.c
//-----------
/****************************************************************************/
/* FUNCTION: INT ApHsStartRecord(INT nMode) */
/* DESCRIPTION:Record sund as file */
/* INPUTS: NONE */
/* OUTPUTS: NONE */
/* RETURN: 事件处理结束后的的返回值 */
/****************************************************************************/
/* NAME DATE REMARKS */
/* ========== ============ ==============================================*/
/* DennyHan 2006.3.14 V1.00B */
/****************************************************************************/
INT ApHsStartRecord(INT nMode)
{
UINT8 *pFile;
INT nRet;
tfsPLAY *pPlay;
pPlay=g_RrParam.aPlay;
(pPlay+1)->hPlay=-1;
pFile=(UINT8*)(APHS_DEF_REC_FILE);
FileSetAttributes(pFile,0);
nMode=RECORD_MODE_REPLACE;
if (nMode==0)
{
nMode=RECORD_MODE_APPEND;
}
nRet=TRUE;
g_RrParam.mRecord = RecordOpen(pFile,(UINT16)nMode);
if(g_RrParam.mRecord == NULL)
{
nRet=FALSE;
}
else
{
if(RecordStart(g_RrParam.mRecord) == NULL)
{
nRet=FALSE;
}
}
return nRet;
}
//===================================
// Pause
INT ApHsPauseRecord(VOID)
{
INT nRet;
nRet=FALSE;
if (g_RrParam.mRecord)
{
nRet=RecordPause(g_RrParam.mRecord);
}
return nRet;
}
//===================================
// Continue
//------------
INT ApHsContinueRecord(VOID)
{
INT nRet;
if (g_RrParam.mRecord)
{
nRet=RecordResume(g_RrParam.mRecord);
}
else
{
nRet=ApHsStartRecord(1);
}
return nRet;
}
//===================================
//Stop
INT ApHsStopRecord(VOID)
{
INT nRet;
UINT8 *pFile;
nRet=TRUE;
if (g_RrParam.mRecord)
{
nRet=RecordStop(g_RrParam.mRecord);
nRet|=RecordClose(g_RrParam.mRecord);
pFile=(UINT8*)(APHS_DEF_REC_FILE);
FileSetAttributes(pFile,APHS_DEF_REC_FATRRIB);
nRet=TRUE;
}
g_RrParam.mRecord=NULL;
return nRet;
}
//=============================================================================
/****************************************************************************/
/* FUNCTION: INT HearSayEvent_Voice( APGUI_STRUCT *pGui, */
/* UINT uEvent, UINT uParam ) */
/* DESCRIPTION:HearSay应用初Record始化事件处理 */
/* INPUTS: NONE */
/* OUTPUTS: NONE */
/* RETURN: 运行初始化事件的返回值 */
// Voice Record
/****************************************************************************/
/* NAME DATE REMARKS */
/* ========== ============ ==============================================*/
/* DennyHan 2006-03-14 First Issue */
/****************************************************************************/
// Deal with the thing during the record;
//---------------------
INT HearSayEvent_Voice( APGUI_STRUCT *pGui, UINT uEvent, UINT uParam )
{
INT nRet;
nRet=TRUE;
switch(uParam)
{
case RECORD_DISK_FULL: //磁盘已满
ApHsStopRecord();
HearSayEvent_C3(pGui, EVENT_COMMAND,CMD_HS_FOLLOW_RECEND);
MsgBoxRun(MSGBOX_NONE,(UINT8*)(APHS_DEF_DISK_FULL));
// MsgPost(NULL,(UINT)EVENT_COMMAND,RECORD_DISK_FULL);
break;
default:
case RECORD_REFRESH: //刷新消息,每写一秒数据发送一次
case RECORD_BUFFER1_FULL: //第一块缓冲已满
case RECORD_BUFFER2_FULL: //第二块缓冲已满
break;
}
return nRet;
}
//===================================
// Del record file
INT ApHsDelRecordFile(VOID)
{
INT nRet;
UINT8 *pFile;
pFile=(UINT8*)(APHS_DEF_REC_FILE);
FileSetAttributes(pFile,0);
nRet=FileDelete(pFile);
return nRet;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -