1) 音频均衡器
- 新增 KtvEqualizer:参考开源项目 OpenEQ(Turbofan3360/OpenEQ, GPL-3.0) 的 EQUtils,
直接用系统 android.media.audiofx.Equalizer, 按设备真实频段数与增益范围自适应
(频段动态生成, 频段标签规则同 OpenEQ: 60/230/910/3.6K ...)。
- 挂载方式改为按"实际播放会话": player.audioSessionId() /
vocalPlayer.audioSessionId / embeddedVocalEngine.audioSessionId()(IJK 原生
IjkMediaPlayer_getAudioSessionId 即真实 AudioTrack 会话)。会话随歌曲变化,
由 500ms lyricTicker -> syncEqualizerSessions() 周期对齐, 消失会话延迟 3s 释放;
设备不支持按会话挂载时可显式开启 globalMix(会话 0, 默认关闭)。
- UI(showEqualizerDialog)与调音弹窗同风格: 深色圆角面板/紫色频段卡/橙色焦点反馈;
滑杆固定 30 档、步进由设备增益范围均分(保证 0 dB 可选中), 5 个预设
标准/流行/抒情/摇滚/唱将, 手动调整后转"自定义"。
- 四个入口: 主页顶栏「调音」弹窗、播放界面「调音」面板、声音设置「均衡器入口」、
远程点歌页面「均衡器」卡片(PATCH /api/v1/player/equalizer, 状态随
GET /api/v1/state 的 equalizer 下发)。
- 设置持久化: KtvStore.eqEnabled/eqPreset/eqLevels/eqGlobalMix。
2) 随机续播改为伪随机公放清单
- 新增 RandomPlayQueue(纯内存): 随机续播一次性生成打乱顺序的临时清单, 一轮内不重复;
播完一首 markFinished +1; next() 每次重新比对曲库, 自动吸纳新增歌曲、剔除已删除歌曲;
一轮播完自动开新一轮(尽量不把刚播完的放开头)。
- 不显示(界面不展示)、不关联已点清单(orderQueue 完全独立, 随机歌曲不入队)、
App 退出即清理(onDestroy 里 isFinishing 时 clear(), 不落盘)。
版本号 1.3.3 -> 1.3.4(versionCode 9 -> 10)。按约定本次不发布 Release, 仅本地打包测试。
117 lines
5.8 KiB
XML
117 lines
5.8 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||
android:layout_width="470dp"
|
||
android:layout_height="404dp"
|
||
android:background="@drawable/bg_tuning_dialog"
|
||
android:orientation="vertical"
|
||
android:paddingStart="28dp"
|
||
android:paddingTop="20dp"
|
||
android:paddingEnd="28dp"
|
||
android:paddingBottom="22dp">
|
||
|
||
<FrameLayout
|
||
android:layout_width="match_parent"
|
||
android:layout_height="44dp">
|
||
|
||
<TextView
|
||
android:layout_width="match_parent"
|
||
android:layout_height="match_parent"
|
||
android:gravity="center"
|
||
android:text="调音"
|
||
android:textColor="#FFFFFFFF"
|
||
android:textSize="24sp" />
|
||
|
||
<TextView
|
||
android:id="@+id/btn_tuning_close"
|
||
android:layout_width="36dp"
|
||
android:layout_height="36dp"
|
||
android:layout_gravity="end|center_vertical"
|
||
android:gravity="center"
|
||
android:text="×"
|
||
android:textColor="#99FFFFFF"
|
||
android:textSize="22sp" />
|
||
</FrameLayout>
|
||
|
||
<LinearLayout
|
||
android:layout_width="match_parent"
|
||
android:layout_height="116dp"
|
||
android:layout_marginTop="12dp"
|
||
android:orientation="horizontal">
|
||
|
||
<LinearLayout
|
||
android:layout_width="0dp"
|
||
android:layout_height="match_parent"
|
||
android:layout_weight="1"
|
||
android:layout_marginEnd="12dp"
|
||
android:background="@drawable/bg_tuning_counter"
|
||
android:gravity="center"
|
||
android:orientation="vertical">
|
||
|
||
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content"
|
||
android:text="升降调" android:textColor="#BFFFFFFF" android:textSize="17sp" />
|
||
|
||
<LinearLayout android:layout_width="match_parent" android:layout_height="54dp"
|
||
android:gravity="center" android:orientation="horizontal">
|
||
<TextView android:id="@+id/btn_tone_down" android:layout_width="48dp" android:layout_height="48dp"
|
||
android:gravity="center" android:text="−" android:textColor="#BFFFFFFF" android:textSize="34sp" />
|
||
<TextView android:id="@+id/text_tone_counter" android:layout_width="56dp" android:layout_height="48dp"
|
||
android:gravity="center" android:text="0" android:textColor="#BFFFFFFF" android:textSize="20sp" />
|
||
<TextView android:id="@+id/btn_tone_up" android:layout_width="48dp" android:layout_height="48dp"
|
||
android:gravity="center" android:text="+" android:textColor="#BFFFFFFF" android:textSize="30sp" />
|
||
</LinearLayout>
|
||
</LinearLayout>
|
||
|
||
<LinearLayout
|
||
android:layout_width="0dp"
|
||
android:layout_height="match_parent"
|
||
android:layout_weight="1"
|
||
android:background="@drawable/bg_tuning_counter"
|
||
android:gravity="center"
|
||
android:orientation="vertical">
|
||
|
||
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content"
|
||
android:text="麦克风" android:textColor="#FFFFFFFF" android:textSize="17sp" />
|
||
|
||
<LinearLayout android:layout_width="match_parent" android:layout_height="54dp"
|
||
android:gravity="center" android:orientation="horizontal">
|
||
<TextView android:id="@+id/btn_mic_down" android:layout_width="48dp" android:layout_height="48dp"
|
||
android:gravity="center" android:text="−" android:textColor="#FFFFFFFF" android:textSize="34sp" />
|
||
<TextView android:id="@+id/text_mic_counter" android:layout_width="56dp" android:layout_height="48dp"
|
||
android:gravity="center" android:text="50" android:textColor="#FFFFFFFF" android:textSize="20sp" />
|
||
<TextView android:id="@+id/btn_mic_up" android:layout_width="48dp" android:layout_height="48dp"
|
||
android:gravity="center" android:text="+" android:textColor="#FFFFFFFF" android:textSize="30sp" />
|
||
</LinearLayout>
|
||
</LinearLayout>
|
||
</LinearLayout>
|
||
|
||
<LinearLayout
|
||
android:layout_width="match_parent"
|
||
android:layout_height="0dp"
|
||
android:layout_weight="1"
|
||
android:gravity="center"
|
||
android:orientation="horizontal"
|
||
android:weightSum="4">
|
||
|
||
<TextView android:id="@+id/btn_preset_pop" android:layout_width="0dp" android:layout_height="92dp"
|
||
android:layout_weight="1" android:gravity="center" android:text="♬\n流行" android:textColor="#FFFFFFFF" android:textSize="16sp" />
|
||
<TextView android:id="@+id/btn_preset_lyric" android:layout_width="0dp" android:layout_height="92dp"
|
||
android:layout_weight="1" android:gravity="center" android:text="▥\n抒情" android:textColor="#FFFFFFFF" android:textSize="16sp" />
|
||
<TextView android:id="@+id/btn_preset_rock" android:layout_width="0dp" android:layout_height="92dp"
|
||
android:layout_weight="1" android:gravity="center" android:text="♨\n摇滚" android:textColor="#FFFFFFFF" android:textSize="16sp" />
|
||
<TextView android:id="@+id/btn_preset_singer" android:layout_width="0dp" android:layout_height="92dp"
|
||
android:layout_weight="1" android:gravity="center" android:text="♪\n唱将" android:textColor="#FFFFFFFF" android:textSize="16sp" />
|
||
</LinearLayout>
|
||
|
||
<!-- 均衡器入口(内核参考开源项目 OpenEQ, 按设备真实频段自适应) -->
|
||
<TextView
|
||
android:id="@+id/btn_tuning_equalizer"
|
||
android:layout_width="match_parent"
|
||
android:layout_height="46dp"
|
||
android:layout_marginTop="8dp"
|
||
android:background="@drawable/bg_btn_glass"
|
||
android:gravity="center"
|
||
android:text="均衡器"
|
||
android:textColor="#FFFFFFFF"
|
||
android:textSize="17sp" />
|
||
</LinearLayout>
|