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:
@@ -0,0 +1,14 @@
|
||||
diff --git a/cspot/include/SpircHandler.h b/cspot/include/SpircHandler.h
|
||||
index 7ff930b..c17caa0 100644
|
||||
--- a/cspot/include/SpircHandler.h
|
||||
+++ b/cspot/include/SpircHandler.h
|
||||
@@ -44,6 +44,9 @@ class SpircHandler {
|
||||
|
||||
void subscribeToMercury();
|
||||
std::shared_ptr<TrackPlayer> getTrackPlayer();
|
||||
+ // Read access for the host (now-playing info: track position, play state).
|
||||
+ std::shared_ptr<PlaybackState> getPlaybackState() { return playbackState; }
|
||||
+ std::shared_ptr<cspot::Context> getContext() { return ctx; }
|
||||
|
||||
void setEventHandler(EventHandler handler);
|
||||
|
||||
Reference in New Issue
Block a user