node/software-dsp: implement loading filter graphs from disk
Using the new Conf() constructor, we can load and parse a filter graph from a file on disk. This is useful when, for example, maintaining a large database of filter graphs. It also keeps wireplumber.conf.d free from clutter. Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
This commit is contained in:
@@ -36,6 +36,19 @@ SimpleEventHook {
|
|||||||
if props["filter-graph"] then
|
if props["filter-graph"] then
|
||||||
log:debug("Loading filter graph for " .. node.properties["node.name"])
|
log:debug("Loading filter graph for " .. node.properties["node.name"])
|
||||||
filter_nodes[node.properties["object.id"]] = LocalModule("libpipewire-module-filter-chain", props["filter-graph"], {})
|
filter_nodes[node.properties["object.id"]] = LocalModule("libpipewire-module-filter-chain", props["filter-graph"], {})
|
||||||
|
elseif props["filter-path"] then
|
||||||
|
log:debug("Loading filter graph for " .. node.properties["node.name"] .. " from disk")
|
||||||
|
local conf = Conf(props["filter-path"], {
|
||||||
|
["as-section"] = "node.software-dsp.graph",
|
||||||
|
["no-fragments"] = true
|
||||||
|
})
|
||||||
|
local err = conf:open()
|
||||||
|
if not err then
|
||||||
|
local args = conf:get_section_as_json("node.software-dsp.graph"):to_string()
|
||||||
|
filter_nodes[node.properties["object.id"]] = LocalModule("libpipewire-module-filter-chain", args, {})
|
||||||
|
else
|
||||||
|
log:warning("Unable to load filter graph for " .. node.properties["node.name"])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if cutils.parseBool (props["hide-parent"]) then
|
if cutils.parseBool (props["hide-parent"]) then
|
||||||
|
Reference in New Issue
Block a user