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>
21 lines
467 B
C++
21 lines
467 B
C++
#pragma once
|
|
|
|
#include <vector>
|
|
#include "../ICommandHandler.hpp"
|
|
|
|
class Player;
|
|
|
|
class PlaybackHandler : public ICommandHandler {
|
|
public:
|
|
explicit PlaybackHandler(Player& player);
|
|
|
|
std::vector<String> commands() const override;
|
|
CommandResult execute(const CommandEnvelope& envelope) override;
|
|
|
|
private:
|
|
Player& _player;
|
|
|
|
CommandResult handlePlay(const CommandEnvelope& envelope);
|
|
CommandResult handleStop(const CommandEnvelope& envelope);
|
|
};
|