365bab59a9f555033cc7e9fe33b78b6f60bc4fc6
[AGL/meta-agl.git] / meta-pipewire / recipes-multimedia / wireplumber / wireplumber-config-agl / host.lua.d / 40-device-defaults.lua
1 device_defaults = {}
2
3 device_defaults.properties = {
4   -- store preferences to the file system and restore them at startup;
5   -- when set to false, default nodes and routes are selected based on
6   -- their priorities and any runtime changes do not persist after restart
7   ["use-persistent-storage"] = false,
8 }
9
10 function device_defaults.enable()
11   -- Selects appropriate default nodes and enables saving and restoring them
12   load_module("default-nodes", device_defaults.properties)
13
14   -- Selects appropriate default routes ("ports" in pulseaudio terminology)
15   -- and enables saving and restoring them together with
16   -- their properties (per-route/port volume levels, channel maps, etc)
17   load_script("default-routes.lua", device_defaults.properties)
18
19   if device_defaults.properties["use-persistent-storage"] then
20     -- Enables functionality to save and restore default device profiles
21     load_module("default-profile")
22
23     -- Save and restore stream-specific properties
24     load_script("restore-stream.lua")
25   end
26 end