From 20e9ec25be10cc602b6b15e97e7b32df99989ccc Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 31 Dec 2020 10:19:48 +0100 Subject: [PATCH] media-session: use simplified syntax Now sure about this, it looks better but it's less compatible. --- src/daemon/media-session.d/alsa-monitor.conf | 82 ++++++++-------- src/daemon/media-session.d/media-session.conf | 98 +++++++++---------- 2 files changed, 90 insertions(+), 90 deletions(-) diff --git a/src/daemon/media-session.d/alsa-monitor.conf b/src/daemon/media-session.d/alsa-monitor.conf index 4516b65ff..41fe39c82 100644 --- a/src/daemon/media-session.d/alsa-monitor.conf +++ b/src/daemon/media-session.d/alsa-monitor.conf @@ -1,55 +1,55 @@ { - "properties": { - }, - "rules": [ + properties = { + } + + rules = [ { - "#": [ "rules for matching a device or node. It is an array of", - "properties that all need to match the regexp. If any of the", - "matches work, the actions are executed for the object." - ], + # rules for matching a device or node. It is an array of + # properties that all need to match the regexp. If any of the + # matches work, the actions are executed for the object. - "matches": [ + matches = [ { - "device.name": "~alsa_card.*" + device.name = ~alsa_card.* } - ], - "actions": { - "#": [ "actions can update properties on the matched object." - ], + ] + actions = { + # actions can update properties on the matched object. - "update-props": { - "api.alsa.use-acp": true, - "#api.alsa.use-ucm": true, - "#api.alsa.soft-mixer": false, - "#api.alsa.ignore-dB": false, - "#device.profile-set": "profileset-name", - "#device.profile": "default profile name", - "#api.acp.auto-port": true, - "#api.acp.auto-profile": true - "#device.nick": "My Device", + update-props = { + api.alsa.use-acp = true + #api.alsa.use-ucm = true + #api.alsa.soft-mixer = false + #api.alsa.ignore-dB = false + #device.profile-set = "profileset-name" + #device.profile = "default profile name" + #api.acp.auto-port = true + #api.acp.auto-profile = true + #device.nick = "My Device" } } - }, + } { - "matches": [ + matches = [ { - "node.name": "~alsa_input.*" - }, - { - "node.name": "~alsa_output.*" + node.name = ~alsa_input.* } - ], - "actions": { - "update-props": { - "#node.nick": "My Node", - "#node.nick": null, - "#priority.driver": 100, - "#resample.quality": 4, - "#channelmix.normalize": false, - "#channelmix.mix-lfe": false, - "#audio.format": "S16LE", - "#audio.rate": 44100, - "#audio.position": "FL,FR" + { + node.name = ~alsa_output.* + } + ] + actions = { + update-props = { + #node.nick = "My Node" + #node.nick = null + #priority.driver = 100 + #priority.session = 100 + #resample.quality = 4 + #channelmix.normalize = false + #channelmix.mix-lfe = false + #audio.format = "S16LE" + #audio.rate = 44100 + #audio.position = "FL,FR" } } } diff --git a/src/daemon/media-session.d/media-session.conf b/src/daemon/media-session.d/media-session.conf index 577166dd1..fe2dc9268 100644 --- a/src/daemon/media-session.d/media-session.conf +++ b/src/daemon/media-session.d/media-session.conf @@ -1,55 +1,55 @@ { - "properties": { - }, - "spa-libs": { - "#": [ "Mapping from factory name to library." - ], + properties = { + } - "api.bluez5.*": "bluez5/libspa-bluez5", - "api.alsa.*": "alsa/libspa-alsa", - "api.v4l2.*": "v4l2/libspa-v4l2", - "api.libcamera.*": "libcamera/libspa-libcamera" - }, - "modules": { - "#": [ "These are the modules that are enabled when a file with", - "the key name is found in the media-session.d config directory.", - "the default bundle is always enabled." - ], + spa-libs = { + # Mapping from factory name to library. - "default": [ - "flatpak", "# manages flatpak access", - "portal", "# manage portal permissions", - "v4l2", "# video for linux udev detection", - "#libcamera", "# libcamera udev detection", - "suspend-node", "# suspend inactive nodes", - "policy-node", "# configure and link nodes", - "#metadata", "# export metadata API", - "#default-nodes", "# restore default nodes", - "#default-profile", "# restore default profiles", - "#default-routes", "# restore default route", - "#alsa-seq", "# alsa seq midi support", - "#alsa-monitor", "# alsa udev detection", - "#bluez5", "# bluetooth support", - "#restore-stream", "#restore stream settings" - ], - "with-audio": [ - "metadata", - "default-nodes", - "default-profile", - "default-routes", - "alsa-seq", - "alsa-monitor" - ], - "with-alsa": [ - "with-audio" - ], - "with-jack": [ - "with-audio" - ], - "with-pulseaudio": [ - "with-audio", - "bluez5", - "restore-stream" + api.bluez5.* = bluez5/libspa-bluez5 + api.alsa.* = alsa/libspa-alsa + api.v4l2.* = v4l2/libspa-v4l2 + api.libcamera.* = libcamera/libspa-libcamera + } + + modules = { + # These are the modules that are enabled when a file with + # the key name is found in the media-session.d config directory. + # the default bundle is always enabled. + + default = [ + flatpak # manages flatpak access + portal # manage portal permissions + v4l2 # video for linux udev detection + #libcamera # libcamera udev detection + suspend-node # suspend inactive nodes + policy-node # configure and link nodes + #metadata # export metadata API + #default-nodes # restore default nodes + #default-profile # restore default profiles + #default-routes # restore default route + #alsa-seq # alsa seq midi support + #alsa-monitor # alsa udev detection + #bluez5 # bluetooth support + #restore-stream # restore stream settings + ] + with-audio = [ + metadata + default-nodes + default-profile + default-routes + alsa-seq + alsa-monitor + ] + with-alsa = [ + with-audio + ] + with-jack = [ + with-audio + ] + with-pulseaudio = [ + with-audio + bluez5 + restore-stream ] } }