Player: GET /api/player with Spotify now-playing info
Source, state, artist/title/album, position and duration (from cspot's playback state, so it matches the app), volume and `can`. cspot patch 0004 adds read getters for the playback state and context. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -42,6 +42,14 @@ void spotify_suspend(bool suspend);
|
||||
void spotify_set_volume(int pct);
|
||||
// A session is running (an app is connected to this device).
|
||||
bool spotify_session_active(void);
|
||||
|
||||
typedef struct {
|
||||
char artist[96], title[128], album[96]; // "" until the first track is audible
|
||||
uint32_t duration_ms, position_ms; // position as the Spotify app sees it
|
||||
bool paused;
|
||||
} spotify_track_t;
|
||||
// The current track of the running session. False without a session.
|
||||
bool spotify_now_playing(spotify_track_t *t);
|
||||
// Current state for status.spotify_state.
|
||||
const char *spotify_state(void);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user