Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: foo_uie_webview (Read 89714 times) previous topic - next topic
0 Members and 10 Guests are viewing this topic.

foo_uie_webview

foo_uie_webview (formerly foo_vis_text) is a component that exposes the Microsoft Edge WebView2 control as UI panel.

It takes an HTML file that receives playback notifications from foobar2000. The panel can react to those notifications and adjust its output using JavaScript code.

Available in the Components repository and on GitHub.


MOD edit: foo_vis_text > foo_uie_webview

Re: foo_uie_webview

Reply #1
Text Visualizer 0.1.0.0 (foo_vis_text) 2024-06-02

foobar2000 v2.1.5 64-bit
Default UI element
Layout Editing Mode > Add New UI Element... > Playback Visualization > Text Visualizer
Menu > View > Visualizations > Text Visualizer

Both crash.

Why is this component type Visualization?
I thought it was the 64-bit version of Text Display (UI element).

Thanks.
SHURE SRH1840, SENNHEISER HD660S2, SENNHEISER HD620S, SENNHEISER HD 490 Pro Plus, beyerdynamic DT 1990 PRO, HiFiMAN Edition XS, Bowers & Wilkins P7, FiiO FT5, 水月雨 (MOONDROP) 空鳴 - VOID, Nakamichi Elite FIVE ANC, SONY WH1000XM5 (made a Upgrade/Balanced Cable by myself)

Re: foo_uie_webview

Reply #2
foobar2000 v2.1.5 64-bit
Default UI element
Layout Editing Mode > Add New UI Element... > Playback Visualization > Text Visualizer
Menu > View > Visualizations > Text Visualizer

Both crash.
Not reproducible. Both CUI and DUI, x86 and x64 are stable here. Do you have a crash log? The component relies on EdgeView/Chromium which comes with the Edge browser.

Edit: Found the problem. I lost track of the first-run scenario where the path to the template is not yet set by the user. The error checking and handling was a little bit too assertive.

Edit 2: https://github.com/stuerp/foo_vis_text/releases/tag/v0.1.1.0
Why is this component type Visualization?
Erh... because it visualizes stuff? What category else?

Re: foo_uie_webview

Reply #3
> Erh... because it visualizes stuff? What category else?

UI Element > Utility
It is a very common panel that allows you to easily edit text, font, album art, etc.
It would be great if you could set it from the context menu.
SHURE SRH1840, SENNHEISER HD660S2, SENNHEISER HD620S, SENNHEISER HD 490 Pro Plus, beyerdynamic DT 1990 PRO, HiFiMAN Edition XS, Bowers & Wilkins P7, FiiO FT5, 水月雨 (MOONDROP) 空鳴 - VOID, Nakamichi Elite FIVE ANC, SONY WH1000XM5 (made a Upgrade/Balanced Cable by myself)

Re: foo_uie_webview

Reply #4
> Erh... because it visualizes stuff? What category else?

UI Element > Utility
It is a very common panel that allows you to easily edit text, font, album art, etc.
Fine by me.

Edit: On second thought: it is not a utility. It visualizes the metadata of a track. I'll leave it like this for now.
It would be great if you could set it from the context menu.
Please explain. Currently the component only needs a template file that can be edited outside fb2k. The file gets reloaded automatically when it changes. What would you like to see in a context menu (which is not trivial because the WebView hijacks the right mousebutton click)?

Re: foo_uie_webview

Reply #5
Sorry, it was "Selection Information".

It means that there is a "Setting..." in the context menu, which takes you to the Settings screen. This is quite common.
What users are expecting is a "Text Display UI Element" and more.
SHURE SRH1840, SENNHEISER HD660S2, SENNHEISER HD620S, SENNHEISER HD 490 Pro Plus, beyerdynamic DT 1990 PRO, HiFiMAN Edition XS, Bowers & Wilkins P7, FiiO FT5, 水月雨 (MOONDROP) 空鳴 - VOID, Nakamichi Elite FIVE ANC, SONY WH1000XM5 (made a Upgrade/Balanced Cable by myself)

Re: foo_uie_webview

Reply #6
Does this component run on version 1.6.18?

Re: foo_uie_webview

Reply #7
Does this component run on version 1.6.18?
I don't explicitly exclude it but it hasn't been tested. AFAIK I haven't used any fb2k API's that require 2.0.

Re: foo_uie_webview

Reply #8
@pqyt,
Interesting component. I tried to replace foo_textdisplay.dll with it:
1. How to set dark mode for slide bar of the component panel?
2. It seems that carriage returns in text are not recognized.
3. Is it possible to implement the "Follow selected track" mode?
4. How to copy the component panel in "Layout Editing Mode"?
Thanks!

Re: foo_uie_webview

Reply #9
@pqyt,
Interesting component. I tried to replace foo_textdisplay.dll with it:
1. How to set dark mode for slide bar of the component panel?
Still working on that. The component and the prefs are implemented but I still need to make WebView listen to the mode.
2. It seems that carriage returns in text are not recognized.
That's to be expected since a linebreak has no meaning in HTML. Try replacing the linebreaks with <br/>.
3. Is it possible to implement the "Follow selected track" mode?
It's on my To Do list.
4. How to copy the component panel in "Layout Editing Mode"?
Never thought of that. I can add stuff to the WebView context menu. If there's an fb2k API to copy the element then I can implement it.

Re: foo_uie_webview

Reply #10
foo_vis_text v0.1.2.0

  • New: Added OnPlaybackDynamicInfo() and OnPlaybackDynamicTrackInfo() callback. Useful to display meta data from streamed audio.
  • Improved: A copy of the default template file is created when the component starts the first time.
  • Improved: The context menu contains a menu item to access the preferences page.

Available in the Components repository and on GitHub.

Re: foo_uie_webview

Reply #11
foo_vis_text v0.1.2.0

  • New: Added OnPlaybackDynamicInfo() and OnPlaybackDynamicTrackInfo() callback. Useful to display meta data from streamed audio.
  • Improved: A copy of the default template file is created when the component starts the first time.
  • Improved: The context menu contains a menu item to access the preferences page.

Available in the Components repository and on GitHub.

Hi @pqyt,
sorry for silly question but how do we use this plugin? It displays some predefined values/texts but I can't find any options to change it. I wanted to add other things to it but clicking on the only clickable button in the preferences gives me error. Is there a file to be changed/rewritten somewhere?
Is displaying art as a background planned?

Re: foo_uie_webview

Reply #12
foo_vis_text v0.1.2.0

  • New: Added OnPlaybackDynamicInfo() and OnPlaybackDynamicTrackInfo() callback. Useful to display meta data from streamed audio.
  • Improved: A copy of the default template file is created when the component starts the first time.
  • Improved: The context menu contains a menu item to access the preferences page.

Available in the Components repository and on GitHub.

Hi @pqyt,
sorry for silly question but how do we use this plugin? It displays some predefined values/texts but I can't find any options to change it. I wanted to add other things to it but clicking on the only clickable button in the preferences gives me error. Is there a file to be changed/rewritten somewhere?
Is displaying art as a background planned?
The component uses WebView. So you have full control of what you want to display and from where. It only needs the location of the HTML file. I have tested only local HTML files but adding support for a web server hosted file should be easy.

You get an error because you don't have an editor associated with HTML files in Windows.

The component has a few callbacks to the HTML file for the common playback events: start, stop, etc... The HTML file can react to that with Javascript. As an extra the HTML file can ask the component to process fb2k title formatting to get information about the current or focused track in a playlist.

The Default-Template.html file contains an example of all implemented functionality.

Artwork needs to come from an external source. Embedded artwork is not (yet?) supported.

I want to keep things lean.

Re: foo_uie_webview

Reply #13
Default UI element "Layout Editing Mode" will no longer be available.

foobar2000 v2.1.5 64-bit
SHURE SRH1840, SENNHEISER HD660S2, SENNHEISER HD620S, SENNHEISER HD 490 Pro Plus, beyerdynamic DT 1990 PRO, HiFiMAN Edition XS, Bowers & Wilkins P7, FiiO FT5, 水月雨 (MOONDROP) 空鳴 - VOID, Nakamichi Elite FIVE ANC, SONY WH1000XM5 (made a Upgrade/Balanced Cable by myself)

Re: foo_uie_webview

Reply #14
Default UI element "Layout Editing Mode" will no longer be available.
foobar2000 v2.1.5 64-bit
I developed the component with foo_flowin and there the fb2k context menu is still accessible in the window title bar (unless you hide it). I'll see if there is an elegant solution for panels hosted by the main fb2k interface.

Re: foo_uie_webview

Reply #15
Only the Text Visualizer doesn't work (Layout Editing Mode).
SHURE SRH1840, SENNHEISER HD660S2, SENNHEISER HD620S, SENNHEISER HD 490 Pro Plus, beyerdynamic DT 1990 PRO, HiFiMAN Edition XS, Bowers & Wilkins P7, FiiO FT5, 水月雨 (MOONDROP) 空鳴 - VOID, Nakamichi Elite FIVE ANC, SONY WH1000XM5 (made a Upgrade/Balanced Cable by myself)

Re: foo_uie_webview

Reply #16
Only the Text Visualizer doesn't work (Layout Editing Mode).
I don't know why you keep hitting the same nail. I already explained that the WebView intercepts the context menu. I need to find a way to merge the fb2k functionality into that context menu or to show the fb2k context menu instead of the one from the WebView.

Re: foo_uie_webview

Reply #17
pqyt,
do you plan (or could you?) to implement different template files for the different panels of component in fb2k layout?
That would be really cool. Just, for example, in my fb2k layout I use five panels with different settings for displaying text information.
Currently, all copies of the component's panels are linked to the same template file.
Thank you.

Re: foo_uie_webview

Reply #18
pqyt,
do you plan (or could you?) to implement different template files for the different panels of component in fb2k layout?
That would be really cool. Just, for example, in my fb2k layout I use five panels with different settings for displaying text information.
Currently, all copies of the component's panels are linked to the same template file.
Thank you.
Sure. Sounds useful.

Maybe another dev can explain what the preferred design is for such a scenario? Should the component do its own bookkeeping of the different instances or is this supported by the SDK? @case, maybe?

Re: foo_uie_webview

Reply #19
foo_vis_text v0.1.3.0

  • New: Added dark mode support to WebView.
  • New: Added "Follow selected track" mode. Supports the "Display / Selection Viewers" user preference ("Prefer current selection" vs. "Prefer currently playing track").
  • Fixed: Added support for "Layout Editing" mode. The foobar2000 context menu is available again.

Available in the Components repository and on GitHub.

@Air KEN, the "Layout Editing" mode was easier to fix than I expected.

Re: foo_uie_webview

Reply #20
This may offend you, but please take it as a report.

> @Air KEN, the "Layout Editing" mode was easier to fix than I expected

Nothing has changed, the problem has not been solved.
After selecting "Layout Editing Mode", right-click on the Panel to enter edit mode. Compare it with other panels
SHURE SRH1840, SENNHEISER HD660S2, SENNHEISER HD620S, SENNHEISER HD 490 Pro Plus, beyerdynamic DT 1990 PRO, HiFiMAN Edition XS, Bowers & Wilkins P7, FiiO FT5, 水月雨 (MOONDROP) 空鳴 - VOID, Nakamichi Elite FIVE ANC, SONY WH1000XM5 (made a Upgrade/Balanced Cable by myself)

Re: foo_uie_webview

Reply #21
This may offend you, but please take it as a report.

> @Air KEN, the "Layout Editing" mode was easier to fix than I expected

Nothing has changed, the problem has not been solved.
After selecting "Layout Editing Mode", right-click on the Panel to enter edit mode. Compare it with other panels
We're probably talking about something else because I get the following context menu when I enable "Layout Edit" mode:

Re: foo_uie_webview

Reply #22
Yes, that's the screen. I tried it on several PCs and several foobar, but I couldn't get to that screen (Layout Editing Mode).

SHURE SRH1840, SENNHEISER HD660S2, SENNHEISER HD620S, SENNHEISER HD 490 Pro Plus, beyerdynamic DT 1990 PRO, HiFiMAN Edition XS, Bowers & Wilkins P7, FiiO FT5, 水月雨 (MOONDROP) 空鳴 - VOID, Nakamichi Elite FIVE ANC, SONY WH1000XM5 (made a Upgrade/Balanced Cable by myself)

Re: foo_uie_webview

Reply #23
Yes, that's the screen. I tried it on several PCs and several foobar, but I couldn't get to that screen (Layout Editing Mode).


Ah, you're using a Tab control. Apparently the Tab control forces a component window to become visible again even if it has been hidden before. Let me see how I can work around that...

Re: foo_uie_webview

Reply #24
Maybe another dev can explain what the preferred design is for such a scenario? Should the component do its own bookkeeping of the different instances or is this supported by the SDK? @case, maybe?

You could save per instance data like your spectrum analyser. Rather than use external html files, save it as a string using stream_writer/stream_reader.

The javascript in this configuration window for my component is saved exactly like that.

https://jscript-panel.github.io/docs/configuration-window/

I'm using Scintilla for javascript code highlighting but you don't have to go that far. You could get away with a simple multi-line edit control.

edit: I can't try this (no Edge) but I'm slightly bemused by a web view being "lighter" than my heavy component. :P