Player: transport commands on /api/player
play/pause/toggle/stop/next/prev. Spotify commands run on the session task (same thread as cspot's frame handling) and the POST waits until they ran, so it answers the new state. HLS pause stops fetching and resume rejoins at the live edge; next/prev on HLS and anything on tone/off return 409. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -32,8 +32,10 @@ esp_err_t spotify_init(spotify_pcm_cb_t pcm, spotify_event_cb_t event, spotify_p
|
||||
// the client credentials are set; otherwise not advertised and a running session is ended.
|
||||
// A new device name ends the session and re-advertises.
|
||||
void spotify_apply(void);
|
||||
// Pause/resume the running session (the Spotify app follows). No-op without a session.
|
||||
void spotify_pause(bool pause);
|
||||
typedef enum { SPOTIFY_CMD_PLAY, SPOTIFY_CMD_PAUSE, SPOTIFY_CMD_NEXT, SPOTIFY_CMD_PREV } spotify_cmd_t;
|
||||
// Control the running session (the Spotify app follows). Runs on the session task; waits until it
|
||||
// has run (max 1 s). Returns false without a session.
|
||||
bool spotify_command(spotify_cmd_t cmd);
|
||||
// Suspend: end any running session (waits until its tasks are gone, max ~3 s) and refuse new ones.
|
||||
// Resume: back to what the config says. Used around firmware uploads.
|
||||
void spotify_suspend(bool suspend);
|
||||
|
||||
Reference in New Issue
Block a user