📄 pic_main.c
字号:
/******************
* mp3_main.c
*****************/
#include <string.h>
#include "api.h"
#include "lcd.h"
#include "common.h"
#include "ap_common.h"
#include "display.h"
#include "pic_utile.h"
//#include "pic_display.h"
#include "pic_sub_menu.h"
#include "prefer.h"
#include "ui_main.h"
#include "ui_message.h"
#include "res.h"
BOOLEAN pic_init;
BOOLEAN play_statu=0;
void screen_jpeg(UINT8 key);
void screen_jpeg_init(void)
{
/* Stop any playing process */
if(!pic_init)
{
screen_jpeg(KEY_PLAY);
return;
}
else
{
play_statu = 0;
api_bStop();
/* Change to ROOT dir */
change_dir(0);
scan_dir_file(SEARCH_MODE_CURRDIR, "JPG", 1);
if(totfile==0)
{
ui_show_message(MFILEOUT);
#ifdef dynamic_load
api_vLoad(Code_USER1,1);
#else
Print("Load Function\n");
#endif
}
else
{
curr_finfo.u16Order = 0;
screen_map(SCREEN_FILEBROWSER);
pic_init = 0;
}
}
}
void screen_jpeg(UINT8 key)
{
BOOLEAN clr_flag;
INT8 dir;
switch(key) {
case KEY_MENU:
//api_vLcdPinSelect();
//write2c(ENTRY_MODE_SET,0x00); // 0xE
//api_vLcdPinRecover();
lcd_set_disply_mode(0x00,0x22);
api_bStop();
select = curr_finfo.u16Order-1;// + totdir - 1;
pic_sub_menu();
return;
case KEY_PLAY: //if we start play please use it.
//if(play_statu == 1)
//{
// select = curr_music.u16Order + totdir - 1;
// play_statu = 0;
// screen_map(SCREEN_FILEBROWSER);
// return;
//}
//else
dir = 0;
break;
case KEY_NEXT:
dir = 1;
break;
case KEY_PREV:
dir = -1;
break;
default:
return;
}
if(!api_bStop())
return;
if(dir == 0) {
lcd_clear();
lcd_set_disply_mode(0x02,0x27);
lcd_set_rw_area(0, -2, 128, 160);
}
if(dir == 0)
{
api_bSelectFile(curr_finfo.u16Order,SEEK_SET);
//api_bGetSelectFileInfo(&curr_finfo);
api_bSelectFileOpen();
}
else
{
if(!find_good_media(dir, SELECT_CUR))
return;
}
//api_vLcdPinSelect();
//write2c(ENTRY_MODE_SET,0x00); // 0xE
//api_vLcdPinRecover();
//lcd_set_disply_mode(0x00,0x22);
lcd_set_disply_mode(0x02,0x27);
lcd_set_rw_area(0, -2, 128, 160);
api_bPlay();
//api_vLcdPinSelect();
//write2c(ENTRY_MODE_SET,0x04); // 0xE
//api_vLcdPinRecover();
//lcd_set_disply_mode(0x00,0x22);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -