jacquesh / foo_openlyrics

An open-source lyric display panel for foobar2000
MIT License
429 stars 24 forks source link

Consider not searching if fb2k is minimised #135

Closed jacquesh closed 2 years ago

jacquesh commented 2 years ago

Suggested in #129, this would would searching if you just leave fb2k running in the background. It would only skip searching if fb2k is actually minimised though, not if its maximised and simply behind other windows.

This has the downside that if you have fb2k minimised, a track starts that you don't have lyrics for, and you maximise it to see the lyrics, you'd have to first wait for the search (rather than probably having lyrics available already by the time you maximised the window).

It'd be a fairly minor improvement I expect, but it should be very simple to do. Just set a flag and initiate lyric search on draw rather than immediately when a track starts.

Tenome commented 2 months ago

I came to post this exact issue, but is there an option to revert this? I'm playing foobar while minimized and it's not searching for or saving lyrics.

jacquesh commented 2 months ago

And is that a problem? If fb2k is minimized then you can't see the lyrics anyway. As soon as you maximise it should search & save as normal again. Is that not happening?

Tenome commented 2 months ago

And is that a problem? If fb2k is minimized then you can't see the lyrics anyway. As soon as you maximise it should search & save as normal again. Is that not happening?

Well, I was hoping it would search for and save lyrics anyway (ESLyric does this if I recall) so that they'd exist. It does search when I open, but I was just wondering why searching while closed was considered a problem.

jacquesh commented 2 months ago

why searching while closed was considered a problem.

It's not that it's a "problem" so much as it provides very little value (basically the only benefit is that it saves 2 seconds the first time you search while maximised) so in general I'm trying to be a good internet citizen and not generate unnecessary traffic to remote sources (who are deriving essentially no benefit from our usage, which does involve some cost to them, however small).

Ultimately fb2k doesn't have any way to detect whether the window is foregrounded or not so it will still search if it's maximised and just behind something else (I believe...I haven't tested it but that's what my understanding of how the redraws work would suggest).