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

📄 mmisounds.h

📁 是一个手机功能的模拟程序
💻 H
字号:
#ifndef _MMI_SOUNDS_H_
#define _MMI_SOUNDS_H_ 1

/*******************************************************************************

					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:		Sounds
 $File:		    MmiSounds.h
 $Revision:		1.0                                                       
                                                                              
 $Author:		Condat(UK)                                                         
 $Date:		    25/10/00                                                      
                                                                               
********************************************************************************
                                                                              
 Description:

    This provides the implementation of the sounds for the basic MMI
                        
		1. Playing various system sounds such as the paging ring,
		   new sms message etc.  
		2. The menus used to enable or disable the system sounds
		3. The menu used to select the paging ring tone
		4. The menu used to select the volume.
		5. The menu used to select the key press tone or dtmf

	The mmi should play system sounds by calling soundExec with the appropriate
	SoundsXXXX message it is possible to go directly to the audio driver to play
	a sound but this will bypass any user settings to turn sounds on or off.

	The MelodySelect and SettingXXXX messages are used to control the key events
	during menu handling, entry to the sounds menus is through the soundsXXXX
	functions. These display the appropriate menu and handle the keypad events. 

	The settings are read from PCM on startup and saved whenever a setting menu
	is selected.
	
********************************************************************************
 $History: MmiSounds.h

	25/10/00			Original Condat(UK) BMI version.	
	   
 $End

*******************************************************************************/
#include "MmiLists.h" 
#include "mmiQQSwitch.h" //hxl add for check qq func
#include "mmisounds_defs.h"	//2004.4.9 WYJ
/*******************************************************************************
                                                                              
                                Basic definitions
                                                                              
*******************************************************************************/

/* Redefine the alloc and free memory routines for use in the sounds
   module.
*/
#define ALLOC_MEMORY mfwAlloc
#define FREE_MEMORY  mfwFree
#define TIM4SECOND      3000
#define TIMERESULT	500		/*   time for results(later to change!!*/
#define MAX_USER_RING_NUM 5  //chenjun add for user ring 2003-01-09
#define MAX_RING_NAME_LEN   13   //chenjun add for user ring 2003-01-14

/* Provide message ids for the messages we will deal with in
   the sounds module.
*/
typedef enum
{
	SoundsNone = SoundsDummy,
	SoundsStop,
	SoundsPagingStart,
	SoundsMuteClick,
	SoundsRingAlarm,
	SoundsRingOrganiser,
	SoundsCreditRing,
	SoundsSMSRing,
	SoundsSMSBroadcast,
	SoundsErrorTone,
	SoundsBattLowIdle,
	SoundsBattLowDedic,
	SoundsConnCharger,
	SoundsDisconnCharger,
	SoundsSwitchOff,
	MelodySelect,
	SettingVibrator,
	SettingKeypadTone,
	SettingSMSTone,
	SettingSMSBroadcastTone,
	SettingBatteryLowBeep,
	SettingCreditLowBeep,
	SettingOrganiserAlert,
	SettingAlarm,
	SettingVolume,
	SettingLanguage,
	SettingPHBKGrouping,
	SoundsDone,
	SoundsCancel
} SoundSettingState;


/* typedefs */
typedef enum {
    ENV_INIT,
    RINGVOLUME,              //xsf add 2002.08.28
    ALARMVOLUME,
    SPEAKERVOLUME,   //xusufang add 2002.08.30
    SMSVOLUME,
    IDLEVOLUME,   //xusufang add 2002.09.05
    CALLEARVOLUME,
    CALLVOLDESTROY,//zy 2003-04-01 add for destroy adjustvol in callwin
    KEYTONEVOLUME,		/* 2003/12/08 sunsj */
    ONTONEVOLUME,	//2004.1.14 WYJ ADD
    OFFTONEVOLUME,	//2004.1.14 WYJ ADD
	HALLONOFFVOLUME,//2004.2.12 WYJ ADD
    MAX_ENV_MODE
	} ENV_CASE;

typedef enum
{
   AUDIO_KEYBEEP,
   AUDIO_MELODY,
   AUDIO_TONE,
   AUDIO_VIBRA,
   AUDIO_VM
   
}AUDIO_DEVICE_ID;//chenjun add

typedef struct
{
  T_MMI_CONTROL    mmi_control;
  T_MFW_HND        sounds_win; 				   /* MFW win handler      */
  T_MFW_HND        parent;
  T_MFW_HND        melody_handler;         /* MFW sms handler      */
  unsigned char      local_status;
  ListMenuData     * menu_list_data;
} T_MELODY_INFO;

/* 2004/06/10 sunsj modify */
#ifdef SEVEN_COLORS_LED
typedef enum
{
	REDLED,
	BLUELED,
	GREENLED,
}LedColorType;
#endif

/* The following definition provides a structure to control the
   ringing operation
*/

extern char* MelodyTablestr[14+MAX_USER_RING_NUM];  //chenjun changed 2003-01-10 for user ring
extern char* SmsMelodyTablestr[6];  //xsf add 2003.03.13
typedef struct MMI_CURRENT_RINGER_STRUCT {
                      /* variable to browse a list */
  UBYTE ringer;             // index of permanent active tune in soundlist and ringerItem
  UBYTE vibrator;             // vibrator
  UBYTE volumeSetting;          // values (0 = silent, 4= loud, 5 = increasing)
  UBYTE keypadOn;             // on/off values
  UBYTE AlarmOn;
  UBYTE OrganiserAlert;
  UBYTE CreditLow;
  UBYTE SMSTone;
  UBYTE SMSBroadcast;
  UBYTE battLow;
  UBYTE earpiece;
  UBYTE language;
  UBYTE Equalizer;
} RINGER_STRUCT_BROWSER;

typedef struct
{
   int  number;
   char filename[MAX_USER_RING_NUM][MAX_RING_NAME_LEN];
  
} T_USER_RING;  //chenjun add for user ring 2003-01-09    
/*******************************************************************************
                                                                              
                                Public Methods
                                                                              
*******************************************************************************/

void soundInit( MfwHnd parent );
void soundExit( void );
void soundExec( int reason, MmiState next );

/* functions setting the focus for entering configuration menus.
*/
int settingsVibrator(   MfwMnu* m, MfwMnuItem* i );
int settingsLanguages(  MfwMnu* m, MfwMnuItem* i );
int soundsRinger(       MfwMnu* m, MfwMnuItem* i );
int soundsVolume(       MfwMnu* m, MfwMnuItem* i );

int soundsKeypadSilent(MfwMnu* m, MfwMnuItem* i);
int soundsKeypadClick(MfwMnu* m, MfwMnuItem* i);
int soundsKeypadDTMF(MfwMnu* m, MfwMnuItem* i);

int soundsNewMessage(   MfwMnu* m, MfwMnuItem* i );
int soundsNewBroadcast( MfwMnu* m, MfwMnuItem* i );
int soundsBatteryLow(   MfwMnu* m, MfwMnuItem* i );
int soundsCreditLow(    MfwMnu* m, MfwMnuItem* i );
int soundsOrganiser(    MfwMnu* m, MfwMnuItem* i );
int soundsAlarm(        MfwMnu* m, MfwMnuItem* i );

USHORT soundReasonRinger( struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi );
USHORT soundReasonSmsTone( struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi );
USHORT soundReasonAlarm( struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi );
USHORT soundReasonPhbk( struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi );
void soundsVolSilent(void);
void soundsVolLow(void);
void soundsVolMedium(void);
void soundsVolHigh(void);
void soundsVolInc(void);
void restoreSilentModeVolume(void);
void setSilentModeVolume(void);

void setSoundsReason(USHORT reason);
void StartMelody2(char * melody_name, BOOLEANS looping);
void StartMelody2_aloud(char * melody_name, BOOLEANS looping);
void StopMelody2(char * melody_name);
void StartMelody(BOOLEANS looping);
void StopMelody(void);
void StartKeyBeep(BOOLEANS keycode);
void StopKeyBeep(void);

void StartKeyVoice(unsigned char keytone_type, unsigned char keycode); // glowing, 2003-12-11, play key voice


void StartTone(void);
void StopTone(void);
void StartVibrator(void);
void StopVibrator(void);
int SetEnvironmentmode( MfwMnu *m, MfwMnuItem *i ); //2002.06.26
//begin of xsf change 2002.08.27 
int scenemode_normal (MfwMnu *m, MfwMnuItem *i);
int scenemode_out (MfwMnu *m, MfwMnuItem *i);
int scenemode_meeting (MfwMnu *m, MfwMnuItem *i);
int scenemode_incar(MfwMnu *m, MfwMnuItem *i);
	
//end of xsf change 2002.08.27
//begin of yq change 2002.11.12
void StartVDEnroll(char * source);
void SetEnrollflag(unsigned char flag);
void SetUpdateflag(unsigned char flag);
void SetDialflag(unsigned char flag);
void SetEnrollName(char * name);
void StopVDEnroll(void);
void StartVDUpdate();
int StartVDReco(void);
void StopVDReco(void);
void StopVDUpdate(void);
//end of yq change 2002.11.12
void scenemode_mute (void);
void SetRingmode(MfwMnu* m, MfwMnuItem* i);  //xsf change 'void' to ''MfwMnu* m, MfwMnuItem* i'' 2002.09.05 10 items
void SetAlarmRingmode(MfwMnu* m, MfwMnuItem* i);   //xsf changed 2002.09.24 2 lines
void SetAlarmVibramode(MfwMnu* m, MfwMnuItem* i);
void SetRingAndVib(MfwMnu* m, MfwMnuItem* i);
void SetVibramode(MfwMnu* m, MfwMnuItem* i);
void SetRingVibra(MfwMnu* m, MfwMnuItem* i);
void SetMuteMode(MfwMnu* m, MfwMnuItem* i);
void SetSmsRing(MfwMnu* m, MfwMnuItem* i);
void SetSpecialRing(MfwMnu* m, MfwMnuItem* i);
void SetSmsVibra(MfwMnu* m, MfwMnuItem* i);
void SetSmsRVibra(MfwMnu* m, MfwMnuItem* i);
void SetSmsMute(MfwMnu* m, MfwMnuItem* i);
void SetMissedcallTone(MfwMnu* m, MfwMnuItem* i);
void SetKeypadTone(MfwMnu* m, MfwMnuItem* i);
void SetUnreadsmsTone(MfwMnu* m, MfwMnuItem* i); 
int Smstone_menu_entry (void);
USHORT Stopplaying( struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi );
USHORT environment_check (struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi);
void Stopplayingdevice( void );
void StopPlayByReasonId(AUDIO_REASON reasonid);
int HallStatus(void);//zy 08/15
void AdjustSpk_VolUp(void);//zy 08/15
void AdjustSpkHandsetHallOff_VolUp(void);//zy 12/29
void AdjustSpk_VolDown(void);//zy 12/29
void AdjustSpkHandsetHallOff_VolDown(void);//zy 12/29
void SetEarMode(void); //zym 09/03
void SetMelodyMode(void);//zym 09/03
void StartTonebypara(UINT16 repeat);  //XSF ADD 2002.08.14 2 LINES
void StartStdTone(UBYTE  toneValue);  // wms add 12/12,2002
void StartConnectedTone(void);//wms added  StartConnectedTone for the connected sound 2002/12/25
void StartPlayByReason(AUDIO_REASON reasonid, BOOLEANS index);
void SetASpk_UpLinkPGA(UINT16 Amp);  //xsf 08.25
int AdjustRingerVolume (MfwMnu *m, MfwMnuItem *i);
USHORT MelodymenuItemCheck(struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi);//xsf add 2002.09.04
void AdjustRingerVolumeIdle (void);  //xsf add 2002.09.05 for adjust ringer volume in idle window
void SetModeConnectTonewer(MfwMnu* m, MfwMnuItem* i);
void SetModeEasyanswer(MfwMnu* m, MfwMnuItem* i);
void OpenMic(void);//zy use zym's function 09/23 open microphone
void CloseMic(void);//zy use zym's function 09/23 close microphone
void SetSpk_UplinkSLT(UINT16 Amp);//zym for echo 10/30
USHORT IsHandsetKey(void);
USHORT IsHandsetPlugin(void);
USHORT GetIO12Status(void);
void AdjustEarVolumeCall (void);
void IncallLed(BOOL IncallLedControl);//zy add 01-23-2003
void stopIncallLed();//zy add 01-23-2003
void StartIncallLed();//zy add 01-23-2003
BOOL GetUserRingFileName(int index,char *filename);//chenjun 2003-01-09 user ring
 UBYTE GetUserRingNum();//chenjun 2003-01-09 user ring
BOOL ReadUserRingInfo(T_USER_RING* Ringinfo);//chenjun 2003-01-21
USHORT IsPcsyncRemove(void);//hxl add for check if pcsync line is taken out,2003-2-13

void SetKeypadToneRing(MfwMnu* m, MfwMnuItem* i);	/* 2003/12/08 sunsj add */
void SetKeypadToneSpcial(MfwMnu* m, MfwMnuItem* i);	/* 2003/12/08 sunsj add */

/* 2004.1.4 WYJ add key sound mute option */
void	setKeypadMute(MfwMnu* m, MfwMnuItem* i);
USHORT	checkKeypadMute( struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi );




void StartPlayingMelody2( UBYTE melody_id, UBYTE count );
void StopPlayingMelody2( void );


/*--------------- 2004.1.13 WYJ add On&Off Ring -----------*/
void SetOnSpecial(MfwMnu* m, MfwMnuItem* i);  
void SetOffSpecial(MfwMnu* m, MfwMnuItem* i);
void SetOnRingMute(MfwMnu* m, MfwMnuItem* i);
void SetOffRingMute(MfwMnu* m, MfwMnuItem* i);
void SetOnOffSpecial(MfwMnu* m, MfwMnuItem* i);

//	2004.5.10 WYJ add
void SetOnMenu(MfwMnu* m, MfwMnuItem* i); 
void SetOffMenu(MfwMnu* m, MfwMnuItem* i); 
//	end of 2004.5.10 WYJ add


USHORT OnOff_check( struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi );
USHORT OnOffSelect_check( struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi );
/*--------------- end of 2004.1.13 WYJ add On&Off Ring ----*/


/*--------------- 2004.2.12 WYJ add hall On&Off Ring -----------*/
void SetHallOnMenu(MfwMnu* m, MfwMnuItem* i); 
void SetHallOffMenu(MfwMnu* m, MfwMnuItem* i); 
void SetHallOnOffSpecial(MfwMnu* m, MfwMnuItem* i);  
void SetHallOnOffRingMute(MfwMnu* m, MfwMnuItem* i);

USHORT HallOnOff_check( struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi );
USHORT HallOnOffSelect_check( struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi );
/*--------------- end of 2004.2.12 WYJ add hall On&Off Ring -----------*/

//2004.3.18 WYJ add ring select window
int callSelect(MfwMnu* m, MfwMnuItem* i);
int alarmSelect(MfwMnu* m, MfwMnuItem* i);
int smsSelect(MfwMnu* m, MfwMnuItem* i);
int powerOnSelect(MfwMnu* m, MfwMnuItem* i);
int powerOffSelect(MfwMnu* m, MfwMnuItem* i);
int hallOnOffSelect(MfwMnu* m, MfwMnuItem* i);
int groupSelect(MfwMnu* m, MfwMnuItem* i);

USHORT group_check( struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi );
int SetGroupMute(MfwMnu* m, MfwMnuItem* i);

// 2004.4.16 WYJ add
void MC_StopVibra(void);

//glowing,2004-05-22,import from mmisettings.c
/* 2004/06/09 sunsj modify */
void LEDStart(int loopflag);
void LEDOff();

/* 2004/06/10 sunsj modify */
#ifdef SEVEN_COLORS_LED
void SinglLedLight(int LedType);
#endif
/*******************************************************************************
                                                                              
                                End of File
                                                                              
*******************************************************************************/

#endif

⌨️ 快捷键说明

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