📄 mmivoicememo.c
字号:
/*******************************************************************************
CONDAT (UK)
********************************************************************************
This software product is the property of Condat (UK) Ltd and may not be
disclosed to any third party without the express permission of the owner.
********************************************************************************
$Project name: Basic MMI
$Project code: BMI (6349)
$Module: VOICEMEMO
$File: MmiVoiceMemo.c
$Revision: 1.0
$Author: Condat(UK)
$Date: 09/04/01
********************************************************************************
Description:
This provides the start code for the MMI
********************************************************************************
$History: MmiVoiceMemo.c
09/04/01 Original Condat(UK) BMI version.
$End
*******************************************************************************/
/*******************************************************************************
Include files
*******************************************************************************/
#define ENTITY_MFW
/* includes */
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#if defined (NEW_FRAME)
#include "typedefs.h"
#include "vsi.h"
#include "pei.h"
#include "custom.h"
#include "gsm.h"
#else
#include "stddefs.h"
#include "custom.h"
#include "gsm.h"
#include "vsi.h"
#endif
#include "mfw_sys.h"
#include "p_sim.h"
#include "cus_aci.h"
#include "mfw_mfw.h"
#include "mfw_win.h"
#include "mfw_kbd.h"
#include "mfw_edt.h"
#include "mfw_lng.h"
#include "mfw_tim.h"
#include "mfw_icn.h"
#include "mfw_mnu.h"
#include "mfw_phb.h"
#include "mfw_cm.h"
#include "mfw_sim.h"
#include "mfw_nm.h"
#include "mfw_sat.h"
#include "mfw_phb.h"
#include "ksd.h"
#include "psa.h"
#include "mfw_sms.h"
#include "mfw_cphs.h"
#include "mfw_sat.h"
#include "dspl.h"
#include "MmiMmi.h"
#include "MmiDummy.h"
#include "MmiDialogs.h"
#include "MmiLists.h"
#include "MmiIdle.h"
#include "MmiSoftkeys.h"
#include "MmiIcons.h"
#include "MmiMenu.h"
#include "MmiMain.h"
#include "MmiStart.h"
#include "MmiPins.h"
#include "MmiSettings.h"
#include "gdi.h"
#include "Audio.h"
#include "MmiSounds.h"
#include "MmiResources.h"
#include "vmd.h"
#include "MmiVoiceMemo.h"
#include "mfw_ffs.h"
#include "Rtc_api.h"
#include "mmibookshared.h"
/*2004/05/18 yhf add */
//#include "mmiicndialogs.h"
// 2004 WYJ add for record
//#include "mmiicnother.h"
#include "mmiiconresource.h"/* 2004/06 sunsj modify for icon manage */
extern const unsigned char gImage_bar[];
//#include "mmibookmenuwindow.h"
#ifndef _SIMULATION_
EXTERN UBYTE vmd_stop_voice_memo_recording (void);
#endif
/*******************************************************************************
internal data
*******************************************************************************/
// Internal events
#define VM_INIT 500
#define VM_DESTROY 501
#define VM_PLAY 502
#define VM_RECORD 503
#define VM_DELETE_BUFFER 504
#define VM_BROWSER 505
#define VM_DELETE 506
#define VM_RECORDCALL 507
#define VOICE_MEMORY_FULL 10
/* glowing: add the following event define for fix the bug that
it can't record if disconnected
*/
#define MAX_RECORD_SECONDS 30
static U8 recordcall_completed;
static T_MFW_HND dynamic_Phonebook_win;
static UINT8 needback=0;
static UINT8 playneedback=0;
static UINT8 playover=1;
extern UINT32 driverFlag;//yq added for don't keybeep 2003/1/20
extern T_call call_data;
typedef struct
{
U8 voicename[PHB_name_len];
U8 index;
} T_voice_name;
typedef struct
{
T_MMI_CONTROL mmi_control;
T_MFW_HND parent_win;
T_MFW_HND info_win;
T_MFW_HND info_tim;
T_MFW_HND animation_timer;/*2004/05/19, yhf add*/
T_MFW_HND info_kbd;
T_MFW_HND menu_options_win;
USHORT Identifier;
USHORT time;
char elapsed_time[7];
ListMenuData *menu_list_data;
U8 index;
U8 current_frame;/*2004/05/19, yhf add*/
} T_voice_memo;
static T_voice_name ListName[VM_file];
static signed char sort_List[VM_file];//yq added for sort voicememo record 2003/1/27
U8 ListTotal;
T_MFW_HND VoiceMemoWin=0;
static T_MFW_HND PlayVoiceMWin=0;
U8 Select_index;
static MfwMnuAttr voicelist_menuAttrib =
{
0,
&menuListArea,
MNU_LEFT | MNU_LIST | MNU_CUR_LINE, /* centered page menu */
-1, /* use default font */
NULL, /* with these items */
0 /* number of items */
};
// this keeps always the position of the voicememo buffer
// it tells the remaining time for the recording
//USHORT record_position;
/*******************************************************************************
Local prototypes
*******************************************************************************/
T_MFW_HND voice_memo_start (T_MFW_HND parent_win, SHORT ID);
static T_MFW_HND voice_memo_create (T_MFW_HND parent_win);
void voice_memo_destroy (T_MFW_HND own_window);
static void voice_memo_dialog (T_MFW_HND win, USHORT event, SHORT value, void * parameter);
static int voice_memo_win_cb (T_MFW_EVENT event, T_MFW_WIN * win);
static T_MFW_CB voice_memo_tim_cb (T_MFW_EVENT event, T_MFW_TIM * tc);
static T_MFW_CB voice_memo_tim_animation_cb(T_MFW_EVENT event, T_MFW_TIM * tc);/*2004/05/19 yhf modify*/
static int voice_memo_kbd_cb (T_MFW_EVENT event, T_MFW_KBD * keyboard);
void voice_memo_dialog_cb (T_MFW_HND win, UBYTE identifier, UBYTE reason);
static void VmRecordCB (void* parameter);
static void voice_delete_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason);
static T_MFW_HND GetVoiceMenuWindow();
static void SetVoiceMenuWindow(T_MFW_HND win);
static void voice_Information_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason);
static void voicememoRead_cb(T_MFW_HND * Parent, ListMenuData * ListData);
static T_MFW_HND voice_play_create (T_MFW_HND parent_win);
static void voice_play_destroy (T_MFW_HND own_window);
static int voice_play_win_cb (T_MFW_EVENT event, T_MFW_WIN * win);
static T_MFW_CB voice_play_tim_cb (T_MFW_EVENT event, T_MFW_TIM *tc);
static int voice_play_kbd_cb (T_MFW_EVENT event, T_MFW_KBD *keyboard);
static void voice_play_dialog (T_MFW_HND win, USHORT event, SHORT value, void * parameter);
static void SortVoiceMemo();
/*******************************************************************************
$Function: voice_memo_init
$Description:
$Returns:
$Arguments:
*******************************************************************************/
GLOBAL void voice_memo_init (void)
{
TRACE_FUNCTION ("voice_memo_init()");
}
/*******************************************************************************
$Function: voice_memo_exit
$Description:
$Returns:
$Arguments:
*******************************************************************************/
GLOBAL void voice_memo_exit (void)
{
TRACE_FUNCTION ("voice_memo_exit()");
//vmd_exit ();
}
/*******************************************************************************
$Function: voice_memo_play
$Description:
$Returns:
$Arguments:
*******************************************************************************/
/*
GLOBAL int voice_memo_play (MfwMnu* m, MfwMnuItem* i)
{
T_MFW_HND win = mfw_parent(mfw_header());
TRACE_FUNCTION ("voice_memo_play()");
//create a new voice memo dialog
voice_memo_start (win, VM_PLAY);
}
*/
/*******************************************************************************
$Function: voice_memo_start
$Description: create a new voicememo dialog
$Returns: Dialogue info win
$Arguments: parent win, display info
*******************************************************************************/
T_MFW_HND voice_memo_start (T_MFW_HND parent_win, SHORT ID)
{
T_MFW_HND win;
if( ID==VM_RECORD||ID==VM_RECORDCALL )
driverFlag|=0x0001;
win = voice_memo_create (parent_win);
if( win NEQ NULL )
{
if( ID==VM_BROWSER )
SetWindowsHandle(win);
SEND_EVENT (win, ID, NULL, NULL);
}
if( call_data.win )
{
call_data.win_voicerecord=win;//zy 2003-04-01 when start in call win should set this data
}
return win;
}
/*******************************************************************************
$Function: vocie_memo_create
$Description: Creation of window
$Returns: Dialogue info win
$Arguments: parent win
*******************************************************************************/
static T_MFW_HND voice_memo_create (T_MFW_HND parent_win)
{
T_MFW_WIN * win_data;
T_voice_memo * data = (T_voice_memo *)ALLOC_MEMORY (sizeof (T_voice_memo));
TRACE_FUNCTION ("vocie_memo_create()");
data->info_win = win_create (parent_win, 0, E_WIN_VISIBLE, (T_MFW_CB)voice_memo_win_cb);
if( data->info_win EQ 0 ) return 0;
// Create window handler
data->mmi_control.dialog = (T_DIALOG_FUNC)voice_memo_dialog;
data->mmi_control.data = data;
data->parent_win = parent_win;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -