librespot icon indicating copy to clipboard operation
librespot copied to clipboard

Implement some sort of State handler with some sort of RO-API

Open psych0d0g opened this issue 9 years ago • 3 comments

Is there a way to notice when a device connects / disconnects? and could we supply some kind of state file for tracking? what i have in mind is another argument to enable that feature and if enabled create a file where librespot writes the current state (like the proc file system on linux just a single line which gets updated on state changes) example content of that file:

Device connects: "connected"

Device disconnects: "noendpoint"

Device disconnects and no music playing or end of playlist: "noendpointnotplaying"

psych0d0g avatar Jan 14 '16 14:01 psych0d0g

Agreed, this is a must have for the library given that it is going to be standalone. As per the gitter chat, here is a list of possible event emitters that it would be good to have:

  • Track Start
  • Track Finish
  • Track Change
  • Track Play
  • Track Pause
  • Track Stop
  • Track Rewind/Fast Forward
  • Track Seek Position
  • Track Shuffle/Repeat enabled/disabled
  • Device Connected [See above]
  • Device Disconnected [See above]
  • Device Disconnected no music [See above]
  • Current Track Metadata
  • Playlist Metadata [Track, Artist, Album, Duration]
  • Queue updated
  • Queue Metadata
  • Volume Up/Down

I'm sure there are more, but I think this is more than good enough to start with.

sashahilton00 avatar Jan 18 '16 23:01 sashahilton00

Native Spotify clients seem to periodically report playback progress to their servers, maybe that's another possible event (some kind of a heartbeat).

There are also a couple error events, like not authorized (anymore), song not available in target market, too many requests, premium required, app key invalid/banned...

CoDEmanX avatar Jan 19 '16 00:01 CoDEmanX

Good point, I forgot about the errors.

sashahilton00 avatar Jan 19 '16 00:01 sashahilton00