Add settings schema
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 thewireplumber.settings
section ofwireplumber.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 theWpSettings
API always checks for the default value of a setting if it does not exist, and returns that value.
Edited by Julian Bouzas