Initial TrueGrowth source import
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
# Change: add audio playback modes
|
||||
|
||||
## Why
|
||||
- 当前播放器只有基础上一首/下一首能力,缺少顺序播放、循环播放和随机播放等常见模式。
|
||||
- 悬浮播放器与音乐播放器工具页共用同一播放状态,如果播放模式只做在某一个入口,会造成体验割裂。
|
||||
|
||||
## What Changes
|
||||
- 为统一音频播放 service 增加 `顺序播放`、`列表循环`、`单曲循环`、`随机播放` 4 种模式
|
||||
- 在悬浮播放器和音乐播放器工具页都提供播放模式下拉切换
|
||||
- 播放模式持久化到本地存储,刷新后恢复
|
||||
- 曲目结束和朗读结束时按当前模式自动续播
|
||||
|
||||
## Impact
|
||||
- Affected specs: `canvas-audio-playback`
|
||||
- Affected code:
|
||||
- `packages/drawnix/src/services/canvas-audio-playback-service.ts`
|
||||
- `packages/drawnix/src/components/audio-node-element/CanvasAudioPlayer.tsx`
|
||||
- `packages/drawnix/src/tools/tools/music-player/MusicPlayerTool.tsx`
|
||||
@@ -0,0 +1,39 @@
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: Shared playback modes for audio players
|
||||
The system SHALL provide shared playback modes for the global floating audio player and the music player tool.
|
||||
|
||||
#### Scenario: Switch playback mode from the floating player
|
||||
- **GIVEN** an audio or reading queue is active
|
||||
- **WHEN** the user changes playback mode from the floating player dropdown
|
||||
- **THEN** the system SHALL update the shared playback mode state
|
||||
- **AND** the music player tool SHALL reflect the same selected mode
|
||||
|
||||
#### Scenario: Switch playback mode from the music player tool
|
||||
- **GIVEN** an audio or reading queue is active
|
||||
- **WHEN** the user changes playback mode from the music player tool dropdown
|
||||
- **THEN** the system SHALL update the shared playback mode state
|
||||
- **AND** the floating player SHALL reflect the same selected mode
|
||||
|
||||
### Requirement: Continue playback according to the selected mode
|
||||
The system SHALL determine queue continuation behavior according to the selected playback mode.
|
||||
|
||||
#### Scenario: Stop at the end in sequential mode
|
||||
- **GIVEN** the current playback mode is `顺序播放`
|
||||
- **WHEN** the last item in the active queue finishes
|
||||
- **THEN** the system SHALL stop playback on the current item
|
||||
|
||||
#### Scenario: Restart queue in list-loop mode
|
||||
- **GIVEN** the current playback mode is `列表循环`
|
||||
- **WHEN** the last item in the active queue finishes
|
||||
- **THEN** the system SHALL continue playback from the first item in the same queue
|
||||
|
||||
#### Scenario: Replay current item in single-loop mode
|
||||
- **GIVEN** the current playback mode is `单曲循环`
|
||||
- **WHEN** the active queue item finishes
|
||||
- **THEN** the system SHALL restart the same queue item from the beginning
|
||||
|
||||
#### Scenario: Pick another item in shuffle mode
|
||||
- **GIVEN** the current playback mode is `随机播放`
|
||||
- **WHEN** the active queue item finishes and the queue contains multiple items
|
||||
- **THEN** the system SHALL continue playback with a different queue item when possible
|
||||
@@ -0,0 +1,6 @@
|
||||
## 1. Implementation
|
||||
- [x] 1.1 为统一音频播放 service 增加播放模式状态、持久化和自动续播逻辑
|
||||
- [x] 1.2 在悬浮播放器增加播放模式下拉切换
|
||||
- [x] 1.3 在音乐播放器工具页增加播放模式下拉切换
|
||||
- [x] 1.4 为播放模式补充单元测试
|
||||
- [x] 1.5 校验 OpenSpec 变更
|
||||
Reference in New Issue
Block a user