Repository navigation
feat: 新增智能交叉过渡与播放过渡设置 - #332
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
停止与设置变更存在交接竞态,动态降速可能触发错误超时,且生成声明引用了不存在的组件。
Review effort: Balanced
Findings: 1
Open (3)
What changed in this PR
新增智能交叉过渡能力,贯通播放设置、下一曲预载、主进程 IPC、原生双槽混音与歌词时间同步。
Changes:
- 新增三档交接偏好、预载联动及过渡状态 UI。
- 实现曲尾静音分析、双槽混音、CUE 边界与过渡取消机制。
- 补充渲染端、主进程及原生模块测试。
| File | Description |
|---|---|
windows/shared/composables/useNowPlayingSync.ts |
倍速补偿 IPC 延迟。 |
src/types/settings.ts |
增加过渡设置类型。 |
src/stores/status.ts |
增加过渡状态。 |
src/stores/settings.ts |
增加默认值及持久化校正。 |
src/settings/categories/player.ts |
增加过渡设置 UI 与缓存联动。 |
src/settings/categories/player.spec.ts |
测试设置确认流程。 |
src/services/nextTrackPreloader.ts |
扩展预载上下文与槽位查询。 |
src/services/nextTrackPreloader.spec.ts |
覆盖本地、缓存及 CUE 预载。 |
src/services/autoClose.ts |
暴露曲末停止状态。 |
src/i18n/locales/zh-CN.json |
增加中文文案。 |
src/i18n/locales/en-US.json |
增加英文文案。 |
src/core/player/preload.spec.ts |
覆盖交接、取消与竞态。 |
src/core/player/index.ts |
实现智能交接调度与状态更新。 |
src/core/player/events.ts |
接入过渡事件。 |
src/components/player/PlayerTimeInfo.vue |
展示过渡提示。 |
src/components/player/FullPlayer/index.vue |
移除多余导入。 |
shared/types/player.ts |
扩展播放事件和 IPC 类型。 |
shared/constants/playback.ts |
定义交接提前量。 |
native/audio-engine/tests/preload.cjs |
增加原生集成测试。 |
native/audio-engine/src/player/transition.rs |
清理加载和 seek 时的过渡状态。 |
native/audio-engine/src/player/tests/preload.rs |
测试双路 DSP 同步。 |
native/audio-engine/src/player/mod.rs |
管理过渡状态和 DSP。 |
native/audio-engine/src/player/events.rs |
增加原生过渡事件。 |
native/audio-engine/src/player/crossfade.rs |
实现交叉过渡状态机。 |
native/audio-engine/src/player/background.rs |
过渡期间抑制旧曲结束事件。 |
native/audio-engine/src/output/wasapi/mod.rs |
接入过渡音源。 |
native/audio-engine/src/output/playback.rs |
支持提交和控制过渡。 |
native/audio-engine/src/output/mod.rs |
统一使用过渡音源。 |
native/audio-engine/src/dsp/fft.rs |
按实际采样率分析频谱。 |
native/audio-engine/src/decoder/transition_source.rs |
实现实时双源混音。 |
native/audio-engine/src/decoder/tests/transition_source.rs |
覆盖混音、欠载和调速。 |
native/audio-engine/src/decoder/tests/source.rs |
覆盖消费位置与 CUE 边界。 |
native/audio-engine/src/decoder/tests/buffer.rs |
覆盖预载缓冲唤醒。 |
native/audio-engine/src/decoder/tail.rs |
实现静音拖尾分析。 |
native/audio-engine/src/decoder/source.rs |
精确跟踪样本消费位置。 |
native/audio-engine/src/decoder/mod.rs |
注册新增解码模块。 |
native/audio-engine/src/bindings/player/types.rs |
扩展原生事件类型。 |
native/audio-engine/src/bindings/player/transition.rs |
暴露交接接口。 |
native/audio-engine/src/bindings/player/tail.rs |
暴露拖尾分析接口。 |
native/audio-engine/src/bindings/player/seek.rs |
调整 seek 提交线程。 |
native/audio-engine/src/bindings/player/mod.rs |
注册新增绑定模块。 |
native/audio-engine/src/bindings/player/load.rs |
调整加载提交及资源释放。 |
native/audio-engine/src/bindings/player/events.rs |
转换过渡事件。 |
native/audio-engine/src/bindings/player/device.rs |
调整设备重建提交线程。 |
native/audio-engine/index.d.ts |
更新生成的原生声明。 |
electron/preload/index.ts |
暴露交接 IPC API。 |
electron/main/services/playerPreloadReset.spec.ts |
覆盖播放器重置清理。 |
electron/main/services/playerPreload.ts |
管理预载租约和曲尾分析。 |
electron/main/services/playerPreload.spec.ts |
覆盖交接通知逻辑。 |
electron/main/services/nowPlaying.ts |
保留交接后的真实播放锚点。 |
electron/main/services/nowPlaying.spec.ts |
测试歌词窗口锚点。 |
electron/main/ipc/player.ts |
编排原生交接及媒体状态。 |
components.d.ts |
更新组件声明,但包含无效路径。 |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+949
to
+950
| const token = trackToken; | ||
| transitionInFlight = true; |
Comment on lines
+52
to
+60
| let mut deadline = | ||
| Instant::now() + Duration::from_secs_f64(remaining_seconds.max(0.0) + 10.0); | ||
| let mut last_poll = Instant::now(); | ||
| let mut announced = false; | ||
| loop { | ||
| let now = Instant::now(); | ||
| if inner.lock().state() == PlayerState::Paused { | ||
| deadline += now.duration_since(last_poll); | ||
| } |
Comment on lines
296
to
+298
| settings.player.preloadNextTrack, | ||
| settings.player.transitionMode, | ||
| settings.player.transitionPreference, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


改动类型
是否包含破坏性变更
改动说明
新增智能交叉过渡,改善相邻曲目切换时的听感,默认保持无过渡。