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

config: make the monitor properties & rules available in global tables

This allows altering monitor properties or adding rules in different
lua files that get loaded before 90-enable*.lua
parent 1d40e771
No related branches found
No related tags found
No related merge requests found
-- ALSA monitor config file -- -- ALSA monitor config file --
local properties = { alsa_monitor = {}
alsa_monitor.properties = {
-- Create a JACK device. This is not enabled by default because -- Create a JACK device. This is not enabled by default because
-- it requires that the PipeWire JACK replacement libraries are -- it requires that the PipeWire JACK replacement libraries are
-- not used by the session manager, in order to be able to -- not used by the session manager, in order to be able to
...@@ -13,7 +15,7 @@ local properties = { ...@@ -13,7 +15,7 @@ local properties = {
--["alsa.reserve.application-name"] = "WirePlumber", --["alsa.reserve.application-name"] = "WirePlumber",
} }
local rules = { alsa_monitor.rules = {
-- An array of matches/actions to evaluate. -- An array of matches/actions to evaluate.
{ {
-- Rules for matching a device or node. It is an array of -- Rules for matching a device or node. It is an array of
...@@ -96,14 +98,14 @@ local rules = { ...@@ -96,14 +98,14 @@ local rules = {
} }
} }
function enable_alsa() function alsa_monitor.enable()
-- The "reserve-device" module needs to be loaded for reservation to work -- The "reserve-device" module needs to be loaded for reservation to work
if properties["alsa.reserve"] then if alsa_monitor.properties["alsa.reserve"] then
load_module("reserve-device") load_module("reserve-device")
end end
load_monitor("alsa", { load_monitor("alsa", {
properties = properties, properties = alsa_monitor.properties,
rules = rules, rules = alsa_monitor.rules,
}) })
end end
-- Bluez monitor config file -- -- Bluez monitor config file --
local properties = { bluez_monitor = {}
bluez_monitor.properties = {
-- MSBC is not expected to work on all headset + adapter combinations. -- MSBC is not expected to work on all headset + adapter combinations.
--["bluez5.msbc-support"] = true, --["bluez5.msbc-support"] = true,
--["bluez5.sbc-xq-support"] = true, --["bluez5.sbc-xq-support"] = true,
...@@ -19,7 +21,7 @@ local properties = { ...@@ -19,7 +21,7 @@ local properties = {
--["bluez5.codecs"] = "[ sbc aac ldac aptx aptx_hd ]", --["bluez5.codecs"] = "[ sbc aac ldac aptx aptx_hd ]",
} }
local rules = { bluez_monitor.rules = {
-- An array of matches/actions to evaluate. -- An array of matches/actions to evaluate.
{ {
-- Rules for matching a device or node. It is an array of -- Rules for matching a device or node. It is an array of
...@@ -59,9 +61,9 @@ local rules = { ...@@ -59,9 +61,9 @@ local rules = {
}, },
} }
function enable_bluetooth() function bluez_monitor.enable()
load_monitor("bluez5", { load_monitor("bluez5", {
properties = properties, properties = bluez_monitor.properties,
rules = rules, rules = bluez_monitor.rules,
}) })
end end
-- V4L2 monitor config file -- -- V4L2 monitor config file --
local properties = { } v4l2_monitor = {}
local rules = { v4l2_monitor.properties = { }
v4l2_monitor.rules = {
-- An array of matches/actions to evaluate. -- An array of matches/actions to evaluate.
{ {
-- Rules for matching a device or node. It is an array of -- Rules for matching a device or node. It is an array of
...@@ -39,9 +41,9 @@ local rules = { ...@@ -39,9 +41,9 @@ local rules = {
}, },
} }
function enable_v4l2() function v4l2_monitor.enable()
load_monitor("v4l2", { load_monitor("v4l2", {
properties = properties, properties = v4l2_monitor.properties,
rules = rules, rules = v4l2_monitor.rules,
}) })
end end
enable_audio() enable_audio()
enable_alsa() alsa_monitor.enable()
enable_bluetooth() bluez_monitor.enable()
enable_v4l2() v4l2_monitor.enable()
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