Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Implement IDLE command in mpd frontend #32
Our current design doesn't make it straight forward to implement 'idle' support. Though, we do have plans for some changes -- needed by e.g. the upcoming MPRIS and HTTP frontends -- that will make implementation of 'idle' easier.
Short answer: yes, but not right away.
As you can see at http://www.mopidy.com/docs/master/clients/mpd/, the only client we've tested that depends on 'idle' working is ncmpc. If you know of any other popular clients that doesn't work without 'idle', please tell us, and we'll update the client compatability list.
With the glib-loop branch in place (but not merged yet) I started doing some research against MPD to try and figure out the idle behavior. The following output is the subsystems that are triggered for each comment, with notes clarifying which playbacks state each applies to. I have a rather ugly script that I have hacked together to quickly get this data.
Other things to note about behavior is that as soon as a client connects MPD starts tracking all subsystems for this client. By this I mean that if client 1 connects first, then client 2, client 2 starts playback and then client 1 does an idle call the result will be that client on gets a player subsystem changed response right away. This despite the player change happening before the idle call was invoked. This exact detail could probably be overlooked if we choose to.
As for the actual implementation of this, I would prefer that as little as possible of the code to support this leak out of
Sounds like a good plan.
I have some upcoming ideas/commits on the MPRIS branch which takes the started_playing/stopped_playing events currently sent by the backend to the frontends (thus far only consumed by the Last.fm scrobbler) a bit further and adds more events, as needed by the MPRIS frontend. I believe this should be solved in approximately the same way. Hope to push the code during this weekend.