reupen / columns_ui

Alternative UI for the foobar2000 audio player
https://yuo.be/columns-ui
GNU Lesser General Public License v3.0
525 stars 32 forks source link

Make global variables available in groups #336

Open stephen147 opened 4 years ago

stephen147 commented 4 years ago

I have a global variable: $set_global(txtlightclr,$rgb(128,128,128))

Is it possible to then assign it in the grouping but it says unknown function.

foobar2000_OML0ysbw33

reupen commented 4 years ago

No, unfortunately. For performance reasons global variables weren't made available in groups.

This is because all group titles are evaluated up front (i.e. when foobar2000 starts or you switch playlist), while playlist items titles are evaluated lazily (when they come into view).

stephen147 commented 4 years ago

No worries, I'm just in the process off changing the theme to use global colours.

Would it be a big hit if there was an option to use it with the default, it been turned off?

reupen commented 4 years ago

No, there wouldn't be a performance hit if it were an option and that option was turned off.

The hit when the (not currently existing) option is enabled would depend on things like the complexity of the global variables script and the number of tracks in the playlist.

stephen147 commented 4 years ago

I meant that of you could add this functionality but have the default to it been off.

I wouldn't mind the performance hit. So it would be nice to have the option to enable this.