settings: remove _get_{boolean|int|float|string}() APIs

They is really no needed with the new _get() API and the WpSpaJson API. In C,
users can use 'wp_spa_json_parse_{boolean|int|float|string}()' APIs to parse the
WpSpaJson. In Lua, users can just do 'Settings.get(setting, m):parse()'.
This commit is contained in:
Julian Bouzas
2022-08-18 13:11:34 -04:00
parent 535af7a33e
commit 2f1aece8b6
16 changed files with 163 additions and 301 deletions

View File

@@ -18,12 +18,28 @@
-- settings file: device.conf
use_persistent_storage =
Settings.get_boolean ("device.use-persistent-storage") or false
local use_persistent_storage =
Settings.get ("device.use-persistent-storage"):parse() or false
-- the default volume to apply
default_volume = tonumber (Settings.get_float ("device.default-volume") or 0.4^3)
default_input_volume = tonumber (Settings.get_float ("default-input-volume") or 1.0)
-- the default volume to apply (optional property)
local default_volume = 0.4^3
local default_volume_json = Settings.get ("device.default-volume")
if default_input_volume_json ~= nil then
local val = default_volume_json:parse()
if val ~= nil then
default_volume = val
end
end
-- the default input volume to apply (optional property)
local default_input_volume = 1.0
local default_input_volume_json = Settings.get ("default-input-volume")
if default_input_volume_json ~= nil then
local val = default_input_volume_json:parse()
if val ~= nil then
default_input_volume = val
end
end
-- table of device info
dev_infos = {}