jacquesh / foo_openlyrics

An open-source lyric display panel for foobar2000
MIT License
449 stars 26 forks source link

Add OpenLyrics context menu options to foobar's "View" menu #412

Open TT-ReBORN opened 1 month ago

TT-ReBORN commented 1 month ago

Hi @jacquesh,

this feature request is referred to my last reply from here: https://github.com/jacquesh/foo_openlyrics/issues/177.

Can you please add your OpenLyrics context menu options: 1

to foobar's "View" menu:

2

As you know. when holding Shift key + clicking on foobar's "View" menu the advanced options will be shown.

Also can you please add two additional options "Next lyrics" which will cycle to the next lyrics source and automatically display the new lyrics and add the option "Save lyrics to tags", which will write the lyrics to the %lyrics% metadata field. I have my own lyrics context menu in my theme with some ESLyric context menu options: 3

When I have these context menu options, I can call them like this: fb.RunMainMenuCommand('View/ESLyric/Panels/Lyric information'); In your case it would be: fb.RunMainMenuCommand('View/OpenLyrics/Search for lyrics'); fb.RunMainMenuCommand('View/OpenLyrics/Save lyrics'); fb.RunMainMenuCommand('View/OpenLyrics/About lyrics'); etc... you get the picture...

This should be quick and easy to implement, can you add it in your next version? Thanks!

-TT

jacquesh commented 1 month ago

As you know. when holding Shift key + clicking on foobar's "View" menu the advanced options will be shown.

I actually didn't know this. That's interesting. Do you know what the distinction is between regular and "advanced" menu items? How do I specify that something only shows up in the advanced menu? I'm guessing I specify flag_defaulthidden from menu.h's mainmenu_commands?

You also have a few other requests in here:

"Next lyrics" which will cycle to the next lyrics source and automatically display the new lyrics

This isn't really a thing, but it's been asked for before. The closest issue I can find is #211 so I'd say we should track it there

"Save lyrics to tags", which will write the lyrics to the %lyrics% metadata field.

This looks somewhat like #352. I seem to recall somebody else was asking recently to allow saving to tags when the lyric is loaded from files (or something to that effect) but I can't find the issue now =/

When I have these context menu options, I can call them like this:

You can already do this for the examples given though, right? The items registered with the context menu are at least available for setting hotkeys. Are they also available via whatever API you're using there (since it clearly isn't the C++ SDK)?

TT-ReBORN commented 1 month ago

As you know. when holding Shift key + clicking on foobar's "View" menu the advanced options will be shown.

I actually didn't know this. That's interesting. Do you know what the distinction is between regular and "advanced" menu items? How do I specify that something only shows up in the advanced menu? I'm guessing I specify flag_defaulthidden from menu.h's mainmenu_commands?

No idea, I am not a foobar component developer nor have knowledge about C++, only HTML, CSS and JavaScript... When holding Shift key + clicking on foobar's menu "File", "View" and "Playback", you will get extra hidden menu items of foobar and user-components. @TheQwertiest and @marc2k3 would definitely know about this. Can you please share your knowledge @marc2k3? Thanks.

You can already do this for the examples given though, right? The items registered with the context menu are at least available for setting hotkeys. Are they also available via whatever API you're using there (since it clearly isn't the C++ SDK)?

I am using @TheQwertiest Spider Monkey Panel component which is an interface between foobar and JavaScript. There is also the predecessor of SMP -> JScript Panel 3 ( which is actively maintained by @marc2k3 ). Both have the method fb.RunMainMenuCommand which just executes available main menu items: https://theqwertiest.github.io/foo_spider_monkey_panel/assets/generated_files/docs/html/fb.html#.RunMainMenuCommand https://jscript-panel.github.io/docs/namespaces/fb/#fbrunmainmenucommandcommand

So I need these in the foobar "View" menu to be able to execute them. ESLyric options are all available in the "View" context menu as shown in the second screenshot, then I can implement these in my own theme context menu with JavaScript and call them with the fb.RunMainMenuCommand method.

-TT