Skip to content

Add settings schema

Julian Bouzas requested to merge julian/wireplumber:settings-schema into master

This MR adds a settings schema that is defined in JSON format in a new section of wireplumber.conf called wireplumber.settings.schema. This settings schema is then exported into a new schema-sm-settings metadata object so that the WpSettings object can know more information about each wireplumber settings.

Apart from this, new improvements have been done involving WpSettings:

  • New APIs were added to set, save, reset, delete, get_saved, iterate and get the spec of a setting.
  • The WpSettings unit tests have been refactored and improved to test all these new APIs
  • The wpctl tool uses the WpSettings API instead of the metadata to show, set, reset, save and delete settings
  • When wireplumber starts, all the settings are loaded into the sm-settings metadata, and they are initialized to the default value if not defined in the wireplumber.settings section of wireplumber.conf.
  • Types and boundaries are now checked when updating a setting. For example, you cannot set a JSON boolean setting with a JSON array value.
  • The settings-manager.lua has been removed because it is not needed anymore. This is because the WpSettings API always checks for the default value of a setting if it does not exist, and returns that value.
Edited by Julian Bouzas

Merge request reports