summaryrefslogtreecommitdiffstats
path: root/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/host.lua.d/40-device-defaults.lua
diff options
context:
space:
mode:
Diffstat (limited to 'meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/host.lua.d/40-device-defaults.lua')
-rw-r--r--meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/host.lua.d/40-device-defaults.lua26
1 files changed, 26 insertions, 0 deletions
diff --git a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/host.lua.d/40-device-defaults.lua b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/host.lua.d/40-device-defaults.lua
new file mode 100644
index 000000000..365bab59a
--- /dev/null
+++ b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/host.lua.d/40-device-defaults.lua
@@ -0,0 +1,26 @@
+device_defaults = {}
+
+device_defaults.properties = {
+ -- store preferences to the file system and restore them at startup;
+ -- when set to false, default nodes and routes are selected based on
+ -- their priorities and any runtime changes do not persist after restart
+ ["use-persistent-storage"] = false,
+}
+
+function device_defaults.enable()
+ -- Selects appropriate default nodes and enables saving and restoring them
+ load_module("default-nodes", device_defaults.properties)
+
+ -- Selects appropriate default routes ("ports" in pulseaudio terminology)
+ -- and enables saving and restoring them together with
+ -- their properties (per-route/port volume levels, channel maps, etc)
+ load_script("default-routes.lua", device_defaults.properties)
+
+ if device_defaults.properties["use-persistent-storage"] then
+ -- Enables functionality to save and restore default device profiles
+ load_module("default-profile")
+
+ -- Save and restore stream-specific properties
+ load_script("restore-stream.lua")
+ end
+end