media-session: use simplified syntax

Now sure about this, it looks better but it's less compatible.
This commit is contained in:
Wim Taymans 2020-12-31 10:19:48 +01:00
parent 2fd35488c7
commit 20e9ec25be
2 changed files with 90 additions and 90 deletions

View file

@ -1,55 +1,55 @@
{ {
"properties": { properties = {
}, }
"rules": [
rules = [
{ {
"#": [ "rules for matching a device or node. It is an array of", # rules for matching a device or node. It is an array of
"properties that all need to match the regexp. If any of the", # properties that all need to match the regexp. If any of the
"matches work, the actions are executed for the object." # matches work, the actions are executed for the object.
],
"matches": [ matches = [
{ {
"device.name": "~alsa_card.*" device.name = ~alsa_card.*
} }
], ]
"actions": { actions = {
"#": [ "actions can update properties on the matched object." # actions can update properties on the matched object.
],
"update-props": { update-props = {
"api.alsa.use-acp": true, api.alsa.use-acp = true
"#api.alsa.use-ucm": true, #api.alsa.use-ucm = true
"#api.alsa.soft-mixer": false, #api.alsa.soft-mixer = false
"#api.alsa.ignore-dB": false, #api.alsa.ignore-dB = false
"#device.profile-set": "profileset-name", #device.profile-set = "profileset-name"
"#device.profile": "default profile name", #device.profile = "default profile name"
"#api.acp.auto-port": true, #api.acp.auto-port = true
"#api.acp.auto-profile": true #api.acp.auto-profile = true
"#device.nick": "My Device", #device.nick = "My Device"
} }
} }
}, }
{ {
"matches": [ matches = [
{ {
"node.name": "~alsa_input.*" node.name = ~alsa_input.*
},
{
"node.name": "~alsa_output.*"
} }
], {
"actions": { node.name = ~alsa_output.*
"update-props": { }
"#node.nick": "My Node", ]
"#node.nick": null, actions = {
"#priority.driver": 100, update-props = {
"#resample.quality": 4, #node.nick = "My Node"
"#channelmix.normalize": false, #node.nick = null
"#channelmix.mix-lfe": false, #priority.driver = 100
"#audio.format": "S16LE", #priority.session = 100
"#audio.rate": 44100, #resample.quality = 4
"#audio.position": "FL,FR" #channelmix.normalize = false
#channelmix.mix-lfe = false
#audio.format = "S16LE"
#audio.rate = 44100
#audio.position = "FL,FR"
} }
} }
} }

View file

@ -1,55 +1,55 @@
{ {
"properties": { properties = {
}, }
"spa-libs": {
"#": [ "Mapping from factory name to library."
],
"api.bluez5.*": "bluez5/libspa-bluez5", spa-libs = {
"api.alsa.*": "alsa/libspa-alsa", # Mapping from factory name to library.
"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": [ api.bluez5.* = bluez5/libspa-bluez5
"flatpak", "# manages flatpak access", api.alsa.* = alsa/libspa-alsa
"portal", "# manage portal permissions", api.v4l2.* = v4l2/libspa-v4l2
"v4l2", "# video for linux udev detection", api.libcamera.* = libcamera/libspa-libcamera
"#libcamera", "# libcamera udev detection", }
"suspend-node", "# suspend inactive nodes",
"policy-node", "# configure and link nodes", modules = {
"#metadata", "# export metadata API", # These are the modules that are enabled when a file with
"#default-nodes", "# restore default nodes", # the key name is found in the media-session.d config directory.
"#default-profile", "# restore default profiles", # the default bundle is always enabled.
"#default-routes", "# restore default route",
"#alsa-seq", "# alsa seq midi support", default = [
"#alsa-monitor", "# alsa udev detection", flatpak # manages flatpak access
"#bluez5", "# bluetooth support", portal # manage portal permissions
"#restore-stream", "#restore stream settings" v4l2 # video for linux udev detection
], #libcamera # libcamera udev detection
"with-audio": [ suspend-node # suspend inactive nodes
"metadata", policy-node # configure and link nodes
"default-nodes", #metadata # export metadata API
"default-profile", #default-nodes # restore default nodes
"default-routes", #default-profile # restore default profiles
"alsa-seq", #default-routes # restore default route
"alsa-monitor" #alsa-seq # alsa seq midi support
], #alsa-monitor # alsa udev detection
"with-alsa": [ #bluez5 # bluetooth support
"with-audio" #restore-stream # restore stream settings
], ]
"with-jack": [ with-audio = [
"with-audio" metadata
], default-nodes
"with-pulseaudio": [ default-profile
"with-audio", default-routes
"bluez5", alsa-seq
"restore-stream" alsa-monitor
]
with-alsa = [
with-audio
]
with-jack = [
with-audio
]
with-pulseaudio = [
with-audio
bluez5
restore-stream
] ]
} }
} }