lwilletts / mpvc

An mpc-like control interface for mpv.
MIT License
139 stars 18 forks source link

feature request: subscribe #2

Closed neeasade closed 1 year ago

neeasade commented 8 years ago

mpc has mpc idleloop, which will output mpd events as they happen - this is useful for acting as a trigger for say, panel mpd status updates - I would like the same to be possible with mpvc - maybe have it monitor for a change in the socket type of thing?

lwilletts commented 8 years ago

Interesting! So for every new 'event' it outputs a single line of data telling you what has changed? Does mpc stay open on the terminal for this to happen?

neeasade commented 8 years ago

Exactly.

lwilletts commented 8 years ago

I have a rough solution in mind for this, but the issue is, is that the socket doesn't report back changes to the mpv instance if you make them i.e. in the actual mpv player on the commandline, I could only return the data if the user does something that modifies the socket. I could then grab this socket output trivially, but it'll require some intrepid thinking to modify mpvc to stay open.

neeasade commented 8 years ago

yeppyepp -- one part of this that would be nice is if I could point such a feature at a file location that doesn't exist yet, but there a socket will eventually be. then I could depend on that to fire up whenever I start mpv/react to that.

lwilletts commented 8 years ago

Seems there is a new command that might be useful for this: observe_property

gmt4 commented 1 year ago

A bit late, but anyway, the command mpvc idleloop is now available (#51) , it just reports back the events from the mpv socket. This was implemented to have a basic scrobling code in extras/mpvc-tui that reports playback events using libnotify to raise desktop notifications. There's some usage examples to get the idea in https://gmt4.github.io/mpvc/logbook.html#logbook-20221221.

neeasade commented 1 year ago

Thanks for the bump - Could we tag a new release as well?

gmt4 commented 1 year ago

Thanks for the suggestion! A new v1.4 release has been tagged https://github.com/lwilletts/mpvc/releases/tag/1.4. Closing this.