Skip to content
Snippets Groups Projects
Commit c00a7069 authored by George Kiagiadakis's avatar George Kiagiadakis
Browse files

scripts: add static-sessions.lua

Replaces the old create-session wireplumber.conf commands
parent 03b17bcb
No related branches found
No related tags found
No related merge requests found
......@@ -24,9 +24,9 @@ function load_pw_module(m)
end
end
function load_script(s)
function load_script(s, a)
if not components[s] then
components[s] = { s, type = "script/lua" }
components[s] = { s, type = "script/lua", args = a }
end
end
......@@ -88,6 +88,10 @@ function enable_bluetooth()
end
function enable_endpoints()
load_script("static-sessions.lua", {
["audio"] = {},
["video"] = {},
})
load_script("create-endpoint.lua")
load_script("policy-endpoint.lua")
end
......
-- WirePlumber
--
-- Copyright © 2021 Collabora Ltd.
-- @author George Kiagiadakis <george.kiagiadakis@collabora.com>
--
-- SPDX-License-Identifier: MIT
-- Receive script arguments from config.lua
local sessions_config = ...
if sessions_config then
sessions = {}
for k, v in pairs(sessions_config) do
Log.info("Creating session: " .. k)
sessions[k] = ImplSession()
if type(v) == "table" then
v["session.name"] = k
sessions[k]:update_properties(v)
else
sessions[k]:update_properties({
["session.name"] = k
})
end
sessions[k]:activate()
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment