———— 详细的说明可以查看《10A_MMI_Resource_Training.pdf》,下面仅以添加AUDIO为例进行说明 ————
添加资源文件
在mcu\plutommi\Customer\Audio\PLUTO下新建资源文件夹myapp,放入需要添加的音频文件,然后将PLUTO文件夹下的所有音频文件打包为audio.zip;
建立RES文件
在mcu\plutommi\mmi下新建myappMmi文件夹,在myappMmi文件夹下建立myappMmiRes文件夹,然后建立myappmmires.res文件;
添加APP
mcu\plutommi\mmi\Inc\mmi_res_range_def.h内,在RESOURCE_BASE_ENUM_BEGIN()
和RESOURCE_BASE_ENUM_END()
之间增加
RESOURCE_BASE_RANGE(APP_MY_TASK, 300),
在RESOURCE_BASE_TABLE_BEGIN()
和RESOURCE_BASE_TABLE_END()
之间增加
#define MY_TASK_BASE ((U16) GET_RESOURCE_BASE(APP_MY_TASK))
#define MY_TASK_BASE_MAX ((U16) GET_RESOURCE_MAX(APP_MY_TASK))
RESOURCE_BASE_TABLE_ITEM_PATH(APP_MY_TASK, ".\\MMI\\myappMmi\\myappMmiRes\\")
RESOURCE_BASE_TABLE_ITEM_PATH
就是第2步中myappmmires.res的路径!
添加资源ID
在myappmmires.res中,添加之前放在myapp文件夹中的文件ID对应的路径
#include "mmi_features.h"
#include "custresdef.h"
<?xml version="1.0" encoding="UTF-8"?>
<APP id="APP_MY_TASK">/* 这里定义的id必须和之前在mmi_res_range_def.h定义的APP的ID一致 */
<!-----------------------------------------------------String Resource Area----------------------------------------------------->
<STRING id="STR_ID_APP_FIRSTAPP_HELLO"/>/* 在这里添加自己的字串ID */
<!-----------------------------------------------------Image Resource Area------------------------------------------------------>
<IMAGE id="IMG_ID_APP_FIRSTAPP_HELLO">CUST_IMG_PATH"\\\\MainLCD\\\\FirstApp\\\\HELLO.BMP"</IMAGE>
/* 这里定义自己的图片ID和路径,注意图片现在的CUST_IMG_PATH路径是在YourProjectPath\plutommi\Customer \Images\FTE320x480,请将图片文件夹放在这里,然后打包整个MainLCD文件夹为image.zip */
<!------------------------------------------------------Menu Resource Area------------------------------------------------------>
/* 这里定义你的菜单ID */
<!------------------------------------------------------Audio section---------------------------------------------------------->
<AUDIO id="AUD_ID_CUSTOM_RING_BEGIN">"..\\\\..\\\\Customer\\\\AUDIO\\\\EmptyAudio.mp3"</AUDIO>
//<AUDIO id="AUD_ID_CUSTOM_RING_POWERON" flag="MULTIBIN">CUST_ADO_PATH"\\\\myapp\\\\1_poweron.mp3"</AUDIO>
//<AUDIO id="AUD_ID_CUSTOM_RING_POWEROFF" flag="MULTIBIN">CUST_ADO_PATH"\\\\myapp\\\\2_poweroff.mp3"</AUDIO>
<AUDIO id="AUD_ID_CUSTOM_RING_NOTSIMCARD" flag="MULTIBIN">CUST_ADO_PATH"\\\\myapp\\\\3_pleasesertsimcard.mp3"</AUDIO>
<AUDIO id="AUD_ID_CUSTOM_RING_CONFIG" flag="MULTIBIN">CUST_ADO_PATH"\\\\myapp\\\\4_ConfigComplete.mp3"</AUDIO>
<AUDIO id="AUD_ID_CUSTOM_RING_SOS_WAIT_CONFIG" flag="MULTIBIN">CUST_ADO_PATH"\\\\myapp\\\\25_SystemInitPlsWait.mp3"</AUDIO>
<AUDIO id="AUD_ID_CUSTOM_RING_TUNNEL_MODE" flag="MULTIBIN">CUST_ADO_PATH"\\\\myapp\\\\17_TunnelModeWork.mp3"</AUDIO>
<AUDIO id="AUD_ID_CUSTOM_RING_PWROFF_CHARGING" flag="MULTIBIN">CUST_ADO_PATH"\\\\myapp\\\\24_PowerOffChargingPlsPressKeyPowerOn.mp3"</AUDIO>
<AUDIO id="AUD_ID_CUSTOM_RING_END">"..\\\\..\\\\Customer\\\\AUDIO\\\\EmptyAudio.mp3"</AUDIO>
<!------------------------------------------------------Other Resource---------------------------------------------------------->
<SCREEN id="SCR_ID_APP_FIRSTAPP_HELLO"/>/* 这里定义你的屏幕ID */
</APP>
编译工程
使用资源
srv_prof_play_tone_with_id(SRV_PROF_TONE_SMS_CARD2,
AUD_ID_CUSTOM_RING_OUTROOM, SRV_PROF_RING_TYPE_ONCE, NULL);
网友评论