Debian Codegraph @

src/scripts/session-services.lua

raw
1 -- WirePlumber
2 --
3 -- Copyright © 2024 Collabora Ltd.
4 --
5 -- SPDX-License-Identifier: MIT
6
7 local features_to_services = {
8 ["monitor.alsa"] = { "audio", "api.alsa" },
9 ["monitor.alsa-midi"] = { "midi", "api.alsa-seq" },
10 ["monitor.bluez"] = { "bluetooth.audio", "api.bluez" },
11 ["monitor.bluez-midi"] = { "bluetooth.midi", "api.bluez" },
12 ["monitor.v4l2"] = { "video-capture", "api.v4l2" },
13 ["monitor.libcamera"] = { "video-capture", "api.libcamera" },
14 ["policy.device.profile"] = { "policy.device.profile" },
15 ["policy.device.routes"] = { "policy.device.routes" },
16 ["policy.default-nodes"] = { "policy.default-nodes" },
17 ["policy.linking.standard"] = { "policy.linking.standard" },
18 ["policy.linking.role-based"] = { "policy.linking.role-based" },
19 }
20
21 local services = {}
22 for k, v in pairs (features_to_services) do
23 if Core.test_feature (k) then
24 for _, s in pairs (v) do
25 services[s] = s
26 end
27 end
28 end
29
30 -- convert to array with numeric indices
31 local services_array = {}
32 for _, s in pairs (services) do
33 table.insert (services_array, s)
34 end
35
36 Core.update_properties {
37 ["session.services"] = "[" .. table.concat (services_array, ", ") .. "]"
38 }