[mw_shl_code=c,true]void Main_cb_BkWindow(WM_MESSAGE *pMsg)
{
int Id;
int NCode;
static int Sel;
switch(pMsg->MsgId)
{
case WM_TIMER:
Mainview_TimeEvent(pMsg);
//TEXT_SetText(WM_GetDialogItem(hWin, TEXT_NOW),"123");
// printf("nimenhao\r\n");
WM_RestartTimer(pMsg->Data.v,100);
break;
case WM_PAINT:
GUI_DrawBitmap(&bmbackground,0,0);
//GUI_SetBkColor(GUI_BLUE);
//GUI_Clear();
break;
case WM_NOTIFY_PARENT:
Id=WM_GetId(pMsg->hWinSrc);
NCode=pMsg->Data.v;
switch(Id)
{
case MAIN_ICONVIEW: //ICONVIEW0控件
switch(NCode) //通知代码
{
case WM_NOTIFICATION_CLICKED:
Sel=ICONVIEW_GetSel(pMsg->hWinSrc);
switch(Sel)
{
case 0: //APP0
call_MainTask();
break;
case 1: //APP1
Calculator_MainTask();
break;
case 2: //APP2
break;
case 3: //APP3
break;
case 4: //APP4
break;
case 5: //APP5
break;
case 6: //APP6
WM_HideWindow(WM_GetDialogItem(pMsg->hWin,MAIN_ICONVIEW));
WM_HideWindow(WM_GetDialogItem(pMsg->hWin,MAIN_TEXT_INFO));
WM_HideWindow(WM_GetDialogItem(pMsg->hWin,MAIN_TEXT_CALENDAR));
WM_HideWindow(WM_GetDialogItem(pMsg->hWin,MAIN_TEXT_TIME));
WM_HideWindow(WM_GetDialogItem(pMsg->hWin,MAIN_TEXT_CALL));
WM_HideWindow(WM_GetDialogItem(pMsg->hWin,MAIN_TEXT_MSG));
GUI_SetBkColor(GUI_BLUE);
GUI_Clear();
Music_MainTask();
GUI_Delay(1000);
WM_SetCallback(WM_HBKWIN,Main_cb_BkWindow);
WM_ShowWindow(WM_GetDialogItem(pMsg->hWin,MAIN_ICONVIEW));
WM_ShowWindow(WM_GetDialogItem(pMsg->hWin,MAIN_TEXT_INFO));
WM_ShowWindow(WM_GetDialogItem(pMsg->hWin,MAIN_TEXT_CALENDAR));
WM_ShowWindow(WM_GetDialogItem(pMsg->hWin,MAIN_TEXT_TIME));
WM_ShowWindow(WM_GetDialogItem(pMsg->hWin,MAIN_TEXT_CALL));
WM_ShowWindow(WM_GetDialogItem(pMsg->hWin,MAIN_TEXT_MSG));
break;
case 7: //APP7
break;
case 8: //APP8
break;
case 9: //APP9
break;
}
break;
case WM_NOTIFICATION_RELEASED:
break;
case WM_NOTIFICATION_SEL_CHANGED:
break;
}
break;
}
break;
default:
WM_DefaultProc(pMsg);
break;
}
}
void Music_MainTask(void)
{
OS_CPU_SR cpu_sr=0;
GUI_Init();
music_new=mymalloc(SRAMEX,10);
mymemset(music_new,0,10);
if(!mp3)
{
OS_ENTER_CRITICAL();
// music_msg=OSMboxCreate((void*)0); //创建消息邮箱 用于传输通信 UI->AUDIOPLAY task
OSTaskCreate(music_task,(void *)0,(OS_STK *)&MUSIC_TASK_STK[MUSIC_STK_SIZE-1],MUSIC_TASK_PRIO );
//OSTaskCreate(uart_task,(void *)0,(OS_STK*)&UART_TASK_STK[UART_STK_SIZE-1],UART_TASK_PRIO);
OS_EXIT_CRITICAL();
}
else
{
audio_start();
OSTaskResume(UART_TASK_PRIO);
}
// music_msg=OSMboxCreate((void*)0);
mp3=true;
// GUI_EnableAlpha(1);
// WM_SetDesktopColor(GUI_WHITE); /* Automacally update desktop window */
WM_SetCreateFlags(WM_CF_MEMDEV); /* Use memory devices on all windows to avoid flicker */
FRAMEWIN_SetDefaultSkin(FRAMEWIN_SKIN_FLEX);
PROGBAR_SetDefaultSkin(PROGBAR_SKIN_FLEX);
BUTTON_SetDefaultSkin(BUTTON_SKIN_FLEX);
SLIDER_SetDefaultSkin(SLIDER_SKIN_FLEX);
OS_ENTER_CRITICAL();
Win=GUI_CreateDialogBox(Music_aDialogCreate, GUI_COUNTOF(Music_aDialogCreate), &Music_cbCallback, 0, 0, 0);
GUI_Exec();
OS_EXIT_CRITICAL();
flage=true;
while(flage)
{
GUI_Delay(500);
}
myfree(SRAMEX,music_new);
return;
}
void print_task(void *pdata)
{
WM8978_ADDA_Cfg(1,0); //开启DAC
WM8978_Input_Cfg(0,0,0);//关闭输入通道
WM8978_Output_Cfg(1,0); //开启DAC输出
while(1)
{
// Calculator_MainTask();
// call_MainTask();
// OSTimeDlyHMSM(0,0,0,5);//延时5ms
//GUIDEMO_Skinning();
// Music_MainTask();
//Input_MainTask();
//Sendmsg_MainTask();
// Read_msg_MainTask();
Mainview_MainTask(0);
// jpegshow("1:/测试用文件/示例图片.jpg");
// TESTMainTask();
GUI_Delay(200);
// mp3_play_song("1:/测试用文件/这条街.mp3");
// mp3_play_song("1:/","测试用文件/这条街.mp3");
// lrc_test("1:/测试用文件/","这条街.mp3");
//jpegdisplay_demo();
}
}[/mw_shl_code]
|