feat(ncm §22): 播放页重做——封面页/歌词页双页(NCM_CACHE_DESIGN §6 定案)
- 去标题栏(不再用 ncm_topbar);返回=左缘手势/系统返回钮语义 - 双页结构:封面页/歌词页,屏幕正中左/右滑切换(与左缘≤24px返回、顶部通知分流), 页面指示点显示当前页;中部横滑=on_touch_move 锁存 page-drag + on_tap/on_swipe 判向 - 封面页:方形大图+圆角(无旋转动画)+进度条(点 seek)+MD3 矢量控制钮(prev/play/pause/next, 新增 app/ui/ncm_icons.h 32x32 单通道 alpha,参照 sb_icons.h 范式)+元信息+实际音质档 - 歌词页:LRC 滚动(当前行居中高亮、上下渐隐)+点行跳转(新增 lyric_line_time); 默认=封面模糊置底(封面铺底+主题 scrim),省电=封面背景+黑色半透明叠加层(设置 ncm.player_bg_mode) - 日夜间:主题配色只映射到半透明叠加层/scrim/accent(红),不动沉浸底(NCM_PLAYER_BG 恒定) - 分带刷新沿用:封面页=封面静态带+动态带(互不重叠 bbox,tick 只刷动态带);歌词页换行(~5s)才重画 - 性能:宿主 4 页 PPM 核验+手势自检 PASS;mipsel -Wall -Wextra 0 warning;qemu core 回归 PASS; 0 真实请求(封面/歌词用本地样本注入)。未部署真机(主会话统一) md5: ncm 730e0b6e / ncm_host 500ac85 / player.c 00934de / ncm_icons.h 20f0bba
This commit is contained in:
1 parent
ed2ae10320
commit
7bd6962ccb
13 files changed
+795
-343
No files matched your search
@@ -24,7 +24,7 @@ static int g_custom_id;
|
||||
static int g_row_h; /* 行高 */
|
||||
static uint64_t g_cache_used; /* 缓存占用字节(进设置页时算一次,清理后清零) */
|
||||
|
||||
#define SETTINGS_ROWS 5
|
||||
#define SETTINGS_ROWS 6
|
||||
|
||||
/* 八档音质 UI 表(用户手机 App 口径为权威,NCM_CACHE_DESIGN §3):显示顺序高→低。
|
||||
* HIGHER(较高)与 DOLBY(杜比全景声)不进 UI 清单(映射保留,见 ncm_api.h)。 */
|
||||
@@ -71,13 +71,14 @@ static void settings_draw(void *ctx)
|
||||
char usetxt[24];
|
||||
fmt_bytes(g_cache_used, usetxt, sizeof usetxt);
|
||||
|
||||
/* 行:音质 / 缓存上限 / 清理缓存 / 退出登录 / 关于。 */
|
||||
/* 行:音质 / 歌词页背景 / 缓存上限 / 清理缓存 / 退出登录 / 关于。 */
|
||||
struct { const char *title; char sub[160]; int red; } rows[SETTINGS_ROWS];
|
||||
rows[0].title = "音质"; rows[0].red = 0;
|
||||
rows[1].title = "缓存上限"; rows[1].red = 0;
|
||||
rows[2].title = "清理缓存"; rows[2].red = 0;
|
||||
rows[3].title = "退出登录"; rows[3].red = 1;
|
||||
rows[4].title = "关于网易云"; rows[4].red = 0;
|
||||
rows[1].title = "歌词页背景"; rows[1].red = 0;
|
||||
rows[2].title = "缓存上限"; rows[2].red = 0;
|
||||
rows[3].title = "清理缓存"; rows[3].red = 0;
|
||||
rows[4].title = "退出登录"; rows[4].red = 1;
|
||||
rows[5].title = "关于网易云"; rows[5].red = 0;
|
||||
{
|
||||
/* 当前档 + 会员门槛标注;超权限(未解锁)时提示将降级(不硬拒,§20) */
|
||||
int gate = ncm_api_level_gate(g_st.level);
|
||||
@@ -91,10 +92,13 @@ static void settings_draw(void *ctx)
|
||||
snprintf(rows[0].sub, sizeof rows[0].sub, "当前: %s (%s)",
|
||||
ncm_level_name(g_st.level), ncm_level_spec(g_st.level));
|
||||
}
|
||||
snprintf(rows[1].sub, sizeof rows[1].sub, "当前: %d GB · 上限 100", g_st.cache_limit_gb);
|
||||
snprintf(rows[2].sub, sizeof rows[2].sub, "占用: %s", usetxt);
|
||||
snprintf(rows[3].sub, sizeof rows[3].sub, "%s", g_st.nickname[0] ? g_st.nickname : "退出");
|
||||
snprintf(rows[4].sub, sizeof rows[4].sub, "%s", "v0.1 · MeowOS");
|
||||
/* §22:歌词页背景模式(default=封面模糊置底 / power_save=封面+黑叠加层) */
|
||||
snprintf(rows[1].sub, sizeof rows[1].sub, "当前: %s",
|
||||
g_st.player_bg_mode == NCM_BG_POWER_SAVE ? "省电模式" : "默认(模糊置底)");
|
||||
snprintf(rows[2].sub, sizeof rows[2].sub, "当前: %d GB · 上限 100", g_st.cache_limit_gb);
|
||||
snprintf(rows[3].sub, sizeof rows[3].sub, "占用: %s", usetxt);
|
||||
snprintf(rows[4].sub, sizeof rows[4].sub, "%s", g_st.nickname[0] ? g_st.nickname : "退出");
|
||||
snprintf(rows[5].sub, sizeof rows[5].sub, "%s", "v0.1 · MeowOS");
|
||||
|
||||
for (int i = 0; i < SETTINGS_ROWS; i++) {
|
||||
int yy = y + i * (g_row_h + 8);
|
||||
@@ -186,7 +190,20 @@ int settings_on_tap(int x, int y)
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
if (row == 1) { /* 缓存上限:预设 + 自定义(数字输入 1~100) */
|
||||
if (row == 1) { /* §22 歌词页背景:default(封面模糊置底)/ power_save(省电) */
|
||||
meow_sheet *s = meow_sheet_create("歌词页背景", 0);
|
||||
meow_sheet_add_item(s, "默认 (模糊置底)");
|
||||
meow_sheet_add_item(s, "省电模式 (黑叠加层)");
|
||||
int op = meow_sheet_open(s);
|
||||
meow_sheet_free(s);
|
||||
if (op == 0 || op == 1) {
|
||||
g_st.player_bg_mode = (op == 1) ? NCM_BG_POWER_SAVE : NCM_BG_DEFAULT;
|
||||
appstate_save_settings();
|
||||
meow_ui_invalidate(r_cont.x, r_cont.y, r_cont.w, r_cont.h);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
if (row == 2) { /* 缓存上限:预设 + 自定义(数字输入 1~100) */
|
||||
static const int gbs[] = { 1, 2, 5, 10, 20, 30, 50, 100 };
|
||||
static const char *labels[] = { "1 GB", "2 GB", "5 GB", "10 GB",
|
||||
"20 GB", "30 GB", "50 GB", "100 GB" };
|
||||
@@ -204,7 +221,7 @@ int settings_on_tap(int x, int y)
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
if (row == 2) { /* 清理缓存 */
|
||||
if (row == 3) { /* 清理缓存 */
|
||||
meow_dialog *d = meow_dialog_create(MEOW_DLG_CONFIRM, "清理缓存?");
|
||||
char msg[160];
|
||||
char usetxt[24];
|
||||
@@ -223,7 +240,7 @@ int settings_on_tap(int x, int y)
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
if (row == 3) { /* 退出登录 */
|
||||
if (row == 4) { /* 退出登录 */
|
||||
meow_dialog *d = meow_dialog_create(MEOW_DLG_CONFIRM, "退出登录?");
|
||||
const char *msgs[1];
|
||||
msgs[0] = "将停止播放并清除登录态,\n下次使用需重新扫码。";
|
||||
@@ -236,7 +253,7 @@ int settings_on_tap(int x, int y)
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
if (row == 4) { /* 关于 */
|
||||
if (row == 5) { /* 关于 */
|
||||
ncm_snack("网易云音乐 v0.1 · MeowOS 移植版");
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user