On Fri, 21 Mar 2025 15:09:14 -0400 Yoni Rabkin <[email protected]> wrote:
> Mike Kazantsev <[email protected]> writes: > > > On Fri, 14 Feb 2025 11:03:15 -0500 > > Richard Sent <[email protected]> wrote: > > > >> Understood. For now I'll keep it separate since it's easier for me to > >> track mentally but we can move it later. > > > > Yeah, thanks, it looks great. > > > > Guess I can merge and push it, unless anyone spots any issues in a > > couple days? > > Mike, can you please incorporate these changes into the main git repo? Did merge and push it, fixing couple warnings from "make" there. Added to mpv example in the docs as well, as it seem to be useful to highlight there as an optional functionality. Also wanted to add emms-volume-get for mpv, which has to be simple and synchronous of course, but was surprised to find that it seem to be difficult to do using similar sync-thread trick. As in order for that to work, main thread actually needs to wait on result in a blocking fashion, which I think means that emms-player-mpv internals can't run there at the same time (with that blocking wait). So I think better solution to this and having generally nicer synchronous mpv interface like "(let ((vol (mpv-get 'volume))) ...)" is to just move all that internal emms-player-mpv async code into its own thread, so that main thread can wait on stuff from there easily. Not sure if it's possible in emacs at the moment, with various process output hooks in particular, but will check later. Also might need to check if this approach is compatible enough in general, i.e. maybe "offloading process hooks to threads" is a bit recent emacs-30.1+ thing or something, in which case probably best to change all that plumbing sometime later. If I might be missing something obvious with this line of thinking - let me know, as I haven't really looked at changes wrt async stuff in emacs recently, and only just realized that this can be done (after looking at synchronous-looking calls in emms-volume-mpv), so might be thinking in a wrong direction entirely. -- Mike Kazantsev // fraggod.net
