feat(Player): V2 playback command namespace + segment_duration fix + mode field

F-024 — V1 single-segment fix: when continuous_loop=false, total_duration is
now always overwritten with segment_duration regardless of what the client
sent. Sending total_duration:0 explicitly no longer bypasses the stop timer.
The play-once fallback in onMelodyLoopCompleted is tightened to only fire when
both segment_duration and total_duration are zero.

F-025 — V2 command namespace: PlaybackHandler now registers playback.play and
playback.stop instead of the old root-level playback command. LegacyAdapter
maps V1 { cmd:playback, action:play/stop } to the new V2 names so all deployed
clients keep working without changes.

F-026 — V2 mode field: setMelodyAttributes accepts a mode string (single /
timed / interval / infinite) with a duration field, replacing the ambiguous
continuous_loop + segment_duration + total_duration triplet. V1 timing fields
are still parsed when mode is absent.

Docs: feature-catalog.md entries F-024, F-025, F-026 added.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-07-07 10:30:05 +03:00
co-authored by Claude Sonnet 4.6
parent 7e8d91673f
commit 9f33f90ea9
5 changed files with 131 additions and 12 deletions
@@ -14,4 +14,7 @@ public:
private:
Player& _player;
CommandResult handlePlay(const CommandEnvelope& envelope);
CommandResult handleStop(const CommandEnvelope& envelope);
};