jacquesh / foo_openlyrics

An open-source lyric display panel for foobar2000
MIT License
433 stars 25 forks source link

Fetch lyrics also when OpenLyrics panel is hidden #177

Closed TT-ReBORN closed 1 month ago

TT-ReBORN commented 2 years ago

Hi Jacques,

can you make an option to enable lyrics fetching also when the OpenLyrics panel is hidden in the DUI/CUI layout? This works for Lyrics Show 3 panel but not for OpenLyrics, it will start searching only when the panel is visible. I have my own script to parse and display the lyrics, so I don't need the whole panel in my theme. I'm certain other devs would also appreciate this option.

When do you plan to make OpenLyrics with streaming ( radio ) compatible?

I really want to switch to OpenLyrics and bury the old Lyrics Show 3 component once and for all, but these two important missing features are preventing me to do that.

Thanks and keep up the good work!

-TT

jacquesh commented 2 years ago

Radios are #49. I don't any specific plans or timelines for that at the moment.

When you say "enable lyrics fetching also when the OpenLyrics panel is hidden". What do you mean by "hidden"? If you mean "there is no OpenLyrics panel present in layout" then I'm tempted to say "no" because 1) that would require a significant rearrangement of how lyric searching gets triggered and 2) supporting lyric fetching other than to show it on the (openlyrics) panel inside fb2k is not a goal for the project.

You could always add an openlyrics panel to your layout and make it small & blend into the background (match the background colour of the rest of the application, make lyrics the same colour so you don't see anything scrolling, etc).

In what way is the openlyrics panel insufficient (enough to justify using your own separate display)?

TT-ReBORN commented 2 years ago

I'm the author of Georgia-ReBORN and I have a special layout. That means I only have one big SMP. Lyrics are handled by the theme itself.

It looks like this, and the vertical splitter is hidden, I'm only using the component for lyrics fetching:

Hidden_Panel

If I replace Lyrics Show 3 panel with your OpenLyrics panel and hide it, it does not start fetching lyrics, only when it's not hidden.

I think some other themes are also using this trick.

-TT

jacquesh commented 2 years ago

Do you know what the significance of marking panels as "Hidden" is? How is it different to just not having the panels in the tree in the first place?

I'd have to investigate how ColumnsUI actually calls down to the panel in that situation.

TT-ReBORN commented 2 years ago

Sorry but I have no idea. @reupen ( dev of Columns UI ) knows the answer. @reupen can you please help us out? Thank you.

I can tell you only this, OpenLyrics works when the panel is either open in a new window, i.e via command fb.RunMainMenuCommand('View/OpenLyrics Panel'); or it's visible ( not hidden ). It starts searching for lyrics and when it's found ( saved on HDD ), it will be immediately displayed.

With a hidden Lyrics Show 3 Panel panel, it fetches without problems with the multi-source component.

I thought this is no big deal and you could add this as a setting in the Preferences > OpenLyrics options.

-TT

reupen commented 2 years ago

Hidden simply makes the panel zero width or height.

jacquesh commented 11 months ago

Note to the reader: there is some good discussion about this (now marked as off-topic) in #286. In particular it seems like the only requests that would happen if we allow this, that wouldn't while we don't, is requests skipped while fb2k is minimized. This is also likely to be a tiny minority of requests and therefore unlikely to matter.

It would be worth at least attempting this to see how complicated it would be. I anticipate significant complexity or rework because of the current threading model and how saving is handled. I could easily be wrong though!

It also occurs to me that if we do this then it would probably be reasonable to see if there's an easy way to expose a notification that other plugins can listen for to learn about newly-retrieved lyrics.

TT-ReBORN commented 3 days ago

Hi @jacquesh,

just saw that you implement this, thanks!

For my Georgia-ReBORN user base, I want to offer OpenLyrics support besides the already implemented ESLyric component. They can choose what they want to use ( ESLyric or OpenLyrics ) with just one click in the Columns UI layout change and predefined OpenLyrics settings which I will provide the user with the foo_openlyrics.dll.cfg file.

I have tried your latest OpenLyrics version and it works, but I can not call your OpenLyrics context menu options. This is needed for theme developers, especially when the panel is hidden...

I have opened a new thread with detailed explanation here: https://github.com/jacquesh/foo_openlyrics/issues/412

If I can use your OpenLyrics component for my theme, I'll credit your OpenLyrics component in my thanks section here: https://github.com/TT-ReBORN/Georgia-ReBORN#thanks

Cheers!

-TT

jacquesh commented 3 days ago

predefined OpenLyrics settings which I will provide the user with the foo_openlyrics.dll.cfg file.

Oh interesting. Do you do this by just creating the config in fb2k and then saving the config file, or do you have a parser for the format? I semi-regularly want to manually decode config files and I know what the format is for most of the file (it's mostly a list of GUIDs with a length and a value) but there's a bunch of data at the beginning that I don't know the format of, and if you know of somewhere that this is documented, that'd be helpful :)

TT-ReBORN commented 3 days ago

Do you do this by just creating the config in fb2k and then saving the config file

Yes exactly, setting up all options in foobar components and then exit foobar. The new settings will then be automatically written in the config files when foobar exits. This procedure is for most foobar and component settings, but for example Columns UI config file foo_ui_columns.dll.cfg saves Spider Monkey Panel settings as an object with just string values, i.e JSON format: cfg_file

As you see in the screenshot, I can open it in VS Code but it can not parse the entire file. Spider Monkey Panel has its own context menu where you can open the panel properties, I always clear it to remove leftovers when adding newly written JavaScript options and removing old ones ( leftovers ) to keep it clean. Then I open both config files and compare the changes in VS Code -> old vs new - to see if everything is alright. Also it should be mentioned that every time foobar creates those config files, the unparsed code blocks always changes, i.e foobar itself handles this...

Years ago I have searched on HydrogenAudio for editing config files, but it is not possible and it is managed ( creating/modifying config files ) by foobar itself as far as I can remember from threads.

Sorry that this information didn't help much, I guess only Peter knows...

-TT