add flac support and files management app
This commit is contained in:
1 parent
4126ea13a1
commit
45f7b83e7c
12 files changed
+1526
-139
No files matched your search
+31
-6
@@ -25,6 +25,7 @@
|
||||
|
||||
#include "ui_home.h"
|
||||
#include "ui_player.h"
|
||||
#include "ui_files.h"
|
||||
|
||||
static app_mode_t s_last_mode = APP_MODE_NUM;
|
||||
|
||||
@@ -39,6 +40,10 @@ static void ui_load_mode(app_mode_t mode)
|
||||
ui_player_show();
|
||||
break;
|
||||
|
||||
case APP_MODE_FILES:
|
||||
ui_files_show();
|
||||
break;
|
||||
|
||||
case APP_MODE_HOME:
|
||||
default:
|
||||
ui_home_show();
|
||||
@@ -57,13 +62,20 @@ static void ui_dispatch(const app_event_t *ev)
|
||||
if (ev->key == APP_KEY_0)
|
||||
{
|
||||
/* 高亮交给当前界面,纯视觉效果 */
|
||||
if (mode == APP_MODE_PLAYER)
|
||||
switch (mode)
|
||||
{
|
||||
ui_player_flash(ev->key);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui_home_flash(ev->key);
|
||||
case APP_MODE_PLAYER:
|
||||
ui_player_flash(ev->key);
|
||||
break;
|
||||
|
||||
case APP_MODE_FILES:
|
||||
ui_files_flash(ev->key);
|
||||
break;
|
||||
|
||||
case APP_MODE_HOME:
|
||||
default:
|
||||
ui_home_flash(ev->key);
|
||||
break;
|
||||
}
|
||||
|
||||
if (ev->type == APP_KEY_LONG)
|
||||
@@ -74,6 +86,10 @@ static void ui_dispatch(const app_event_t *ev)
|
||||
{
|
||||
app_switch_next(); /* 主界面短按:切换应用 */
|
||||
}
|
||||
else if ((mode == APP_MODE_FILES) && ui_files_back())
|
||||
{
|
||||
/* 文件管理器:先返回上一级目录,停留在本应用内 */
|
||||
}
|
||||
else
|
||||
{
|
||||
app_set_mode(APP_MODE_HOME); /* App 内短按:返回主界面 */
|
||||
@@ -94,6 +110,10 @@ static void ui_dispatch(const app_event_t *ev)
|
||||
ui_player_handle_key(ev->key);
|
||||
break;
|
||||
|
||||
case APP_MODE_FILES:
|
||||
ui_files_handle_key(ev->key);
|
||||
break;
|
||||
|
||||
case APP_MODE_HOME:
|
||||
default:
|
||||
ui_home_handle_key(ev->key);
|
||||
@@ -131,6 +151,10 @@ static void ui_tick_cb(lv_timer_t *timer)
|
||||
ui_player_tick();
|
||||
break;
|
||||
|
||||
case APP_MODE_FILES:
|
||||
ui_files_tick();
|
||||
break;
|
||||
|
||||
case APP_MODE_HOME:
|
||||
default:
|
||||
ui_home_tick();
|
||||
@@ -142,6 +166,7 @@ void ui_create(void)
|
||||
{
|
||||
ui_home_create();
|
||||
ui_player_create();
|
||||
ui_files_create();
|
||||
|
||||
s_last_mode = app_get_mode();
|
||||
ui_load_mode(s_last_mode);
|
||||
|
||||
Reference in new issue
Block a user