I use this to monitor with mpc idle and mpc connect, to drive a OLED displaying the streaming source that is currently running. it’s working for other plugins, Tidal, Qobuz and local files.
It seems that spop doesn’t provide a status to MPC, can this be added?
Listening to MPC (MPD) for state changes is a mistake, as you will receive status updates for mpd only, and not for TIDAL Connect, Spotify Connect and many other music sources.
Your best way would be to listen for websocket pushState event or poll via the REST API.
You get notified on any change Fairly easy to implement.
Here’s an example:
var io=require('socket.io-client');
self.stateSocket= io.connect('http://localhost:3000');
self.stateSocket.on('connect', function() {
self.stateSocket.emit('getState', '');
});
self.stateSocket.on('pushState', function (data) {
// This is your state object
var status = data.status; // play|stop|pause
});