feat(ncm): 播放模式三态(随机/列表循环/单曲循环,播放页三键左)+当前实时播放列表(三键右,歌单滑窗/meow_listview虚拟化分页至5194首,当前曲高亮,点播切歌) — 模式持久化,宿主modetest/queuetest全过
This commit is contained in:
1 parent
29e13b2b5e
commit
7ca3e5bd84
8 files changed
+707
-28
No files matched your search
@@ -24,7 +24,7 @@ volatile int g_net_ready = 0;
|
||||
int g_host_mock = 0;
|
||||
|
||||
static meow_view *g_login_view, *g_home_view, *g_pl_view, *g_plr_view, *g_set_view,
|
||||
*g_search_view;
|
||||
*g_search_view, *g_queue_view;
|
||||
|
||||
static void on_sigterm(int s) { (void)s; meow_ui_request_exit(); }
|
||||
|
||||
@@ -92,6 +92,7 @@ static void app_on_tap(int x, int y)
|
||||
if (player_is_active()) { player_on_tap(x, y); return; }
|
||||
if (settings_is_active()) { settings_on_tap(x, y); return; }
|
||||
if (playlist_is_active()) { playlist_on_tap(x, y); return; }
|
||||
if (queue_is_active()) { queue_on_tap(x, y); return; }
|
||||
if (search_is_active()) { search_on_tap(x, y); return; }
|
||||
home_on_tap(x, y);
|
||||
}
|
||||
@@ -105,6 +106,7 @@ static void app_on_swipe(int dir, int dx, int dy)
|
||||
if (player_is_active()) { meow_view_page_pop(); return; }
|
||||
if (settings_is_active()) { meow_view_page_pop(); return; }
|
||||
if (playlist_is_active()) { meow_view_page_pop(); return; }
|
||||
if (queue_is_active()) { meow_view_page_pop(); return; }
|
||||
if (search_is_active()) { meow_view_page_pop(); return; }
|
||||
if (home_is_active()) {
|
||||
/* 任务2:home 根页左滑不再退出进程 → 请求 launcher 退到桌面/后台(进程+媒体会话保留)。
|
||||
@@ -121,6 +123,7 @@ static void app_on_swipe(int dir, int dx, int dy)
|
||||
}
|
||||
if (home_is_active()) { home_swipe(dir, dy); return; }
|
||||
if (playlist_is_active()) { playlist_swipe(dir, dy); return; }
|
||||
if (queue_is_active()) { queue_swipe(dir, dy); return; }
|
||||
if (search_is_active()) { search_swipe(dir, dy); return; }
|
||||
if (player_is_active()) { player_on_swipe(dir, dy); return; }
|
||||
}
|
||||
@@ -130,6 +133,7 @@ static void app_on_touch_down(int x, int y)
|
||||
if (player_is_active()) player_touch_down(x, y); /* §22 中部横滑页切换跟踪 */
|
||||
else if (home_is_active()) home_touch_down(x, y);
|
||||
else if (playlist_is_active()) playlist_touch_down(x, y);
|
||||
else if (queue_is_active()) queue_touch_down(x, y);
|
||||
else if (settings_is_active()) settings_touch_down(x, y);
|
||||
else if (search_is_active()) search_touch_down(x, y);
|
||||
}
|
||||
@@ -139,6 +143,7 @@ static void app_on_touch_move(int x, int y)
|
||||
if (player_is_active()) player_touch_move(x, y);
|
||||
else if (home_is_active()) home_touch_move(x, y);
|
||||
else if (playlist_is_active()) playlist_touch_move(x, y);
|
||||
else if (queue_is_active()) queue_touch_move(x, y);
|
||||
else if (settings_is_active()) settings_touch_move(x, y);
|
||||
else if (search_is_active()) search_touch_move(x, y);
|
||||
}
|
||||
@@ -188,6 +193,7 @@ static void app_on_tick(void)
|
||||
if (login_is_active()) { login_tick(now); return; }
|
||||
if (player_is_active()) { player_tick(now); return; }
|
||||
if (search_is_active()) { search_tick(now); return; }
|
||||
if (queue_is_active()) { queue_tick(now); return; }
|
||||
if (home_is_active()) { home_tick(now); }
|
||||
if (playlist_is_active()) { playlist_tick(now); }
|
||||
chrome_tick();
|
||||
@@ -219,13 +225,14 @@ int main(void)
|
||||
ipc_media_start();
|
||||
g_net_ready = 1;
|
||||
|
||||
/* 建六页 view */
|
||||
/* 建页 view */
|
||||
g_login_view = login_view_create();
|
||||
g_home_view = home_view_create();
|
||||
g_pl_view = playlist_view_create();
|
||||
g_plr_view = player_view_create();
|
||||
g_set_view = settings_view_create();
|
||||
g_search_view = search_view_create();
|
||||
g_queue_view = queue_view_create(); /* §NEW 当前播放队列页 */
|
||||
mini_bar_init(); /* mini 播放栏:登记跨 Activity 绘制物(进 root 页前,首帧即参与重画) */
|
||||
|
||||
/* 进入根页:已登录→home,否则→login */
|
||||
@@ -248,6 +255,7 @@ int main(void)
|
||||
meow_view_free(g_home_view);
|
||||
meow_view_free(g_login_view);
|
||||
meow_view_free(g_search_view);
|
||||
meow_view_free(g_queue_view);
|
||||
meow_ui_shutdown();
|
||||
meow_log(MEOW_LOG_INFO, "exit");
|
||||
return 0;
|
||||
|
||||
Reference in new issue
Block a user