PromyLOPh / pianobar

Console-based pandora.com player
http://6xq.net/pianobar/
Other
1.73k stars 323 forks source link

Events for pause/resume playback, or a 'poll' type event that fires periodically. #712

Open nneul opened 3 years ago

nneul commented 3 years ago

I'm wanting to have an event to communicate externally (dashboard/toolbar/etc.) that music/stream is actively playing. This is independent of song start/stop.

Would like to see an event transmitted for 'pause' and 'resume' - or 'audio-start', 'audio-stop'.

Alternatively - a "songactive" event that fires regularly (every 15-30 seconds or something) while a song is playing. (Since this would be a significant change in behavior, would probably suggest having a 'status_command' setting along with 'status_interval'.) If you do it as separate command, consider json on stdin.

I'm unsure on whether those events should be fired in between songs though.

Key piece is - right now, if I start playback, and hit pause, there is no indication in events that pianobar is no longer active, no matter how long it sites.

Another possibility, particularly if you do single line json: event_stream_command, event_stream_interval -- and have it keep a pipe open to that external command, sending one event per line instead of one command invocation per event.