Skip to content

lua: change the Conf API, cache rules early, close WpConf

George Kiagiadakis requested to merge gkiagia/wireplumber:conf-close into master

In some cases we need to get a section as JSON, so that we can pass it down to the rules parser, while in other cases we need to get it as a table to use it natively, and in that case we even need to differentiate between it being an object, an array or an object with WpProperties.

Make it also possible to optionally pass tables with default values to the functions so that we can get rid of cutils.get_config_section() as well.


Cache the rules in a global variable in each script, as JSON, and use JsonUtils directly to evaluate them. This will allow us to close the WpConf in the future after loading the scripts.

Also change the order of the return values of the match_rules_apply_properties function to be able to easily ignore the number of changed values, which is useless in most cases.


Finally, close WpConf after loading all components.

Merge request reports