From fda829a1fa011c11808b151af135fa5c4dd9bf65 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 7 Feb 2023 10:35:43 +0100 Subject: [PATCH] conf: fixup config comments Use () to mark optional fields to avoid confusion with [] for arrays. Add contition fields where available. --- src/daemon/client-rt.conf.in | 5 +++-- src/daemon/client.conf.in | 5 +++-- src/daemon/filter-chain.conf.in | 5 +++-- src/daemon/jack.conf.in | 5 +++-- src/daemon/minimal.conf.in | 15 ++++++++++----- src/daemon/pipewire-pulse.conf.in | 4 ++-- src/modules/module-protocol-pulse/cmd.c | 5 ++++- 7 files changed, 28 insertions(+), 16 deletions(-) diff --git a/src/daemon/client-rt.conf.in b/src/daemon/client-rt.conf.in index b73a904e3..692048fb1 100644 --- a/src/daemon/client-rt.conf.in +++ b/src/daemon/client-rt.conf.in @@ -31,8 +31,9 @@ context.spa-libs = { context.modules = [ #{ name = - # [ args = { = ... } ] - # [ flags = [ [ ifexists ] [ nofail ] ] + # ( args = { = ... } ) + # ( flags = [ ( ifexists ) ( nofail ) ] ) + # ( condition = [ { = ... } ... ] ) #} # # Loads a module with the given parameters. diff --git a/src/daemon/client.conf.in b/src/daemon/client.conf.in index b465eb644..896a7381a 100644 --- a/src/daemon/client.conf.in +++ b/src/daemon/client.conf.in @@ -31,8 +31,9 @@ context.spa-libs = { context.modules = [ #{ name = - # [ args = { = ... } ] - # [ flags = [ [ ifexists ] [ nofail ] ] + # ( args = { = ... } ) + # ( flags = [ ( ifexists ) ( nofail ) ] ) + # ( condition = [ { = ... } ... ] ) #} # # Loads a module with the given parameters. diff --git a/src/daemon/filter-chain.conf.in b/src/daemon/filter-chain.conf.in index 28d2a5ad3..d1b4cdab8 100644 --- a/src/daemon/filter-chain.conf.in +++ b/src/daemon/filter-chain.conf.in @@ -30,8 +30,9 @@ context.spa-libs = { context.modules = [ #{ name = - # [ args = { = ... } ] - # [ flags = [ [ ifexists ] [ nofail ] ] + # ( args = { = ... } ) + # ( flags = [ ( ifexists ) ( nofail ) ] ) + # ( condition = [ { = ... } ... ] ) #} # # Loads a module with the given parameters. diff --git a/src/daemon/jack.conf.in b/src/daemon/jack.conf.in index 95a86cb49..1a449f199 100644 --- a/src/daemon/jack.conf.in +++ b/src/daemon/jack.conf.in @@ -30,8 +30,9 @@ context.spa-libs = { context.modules = [ #{ name = - # [ args = { = ... } ] - # [ flags = [ [ ifexists ] [ nofail ] ] + # ( args = { = ... } ) + # ( flags = [ ( ifexists ) ( nofail ) ] ) + # ( condition = [ { = ... } ... ] ) #} # # Loads a module with the given parameters. diff --git a/src/daemon/minimal.conf.in b/src/daemon/minimal.conf.in index 4a3a2cb07..6d7122b65 100644 --- a/src/daemon/minimal.conf.in +++ b/src/daemon/minimal.conf.in @@ -60,8 +60,9 @@ context.spa-libs = { context.modules = [ #{ name = - # [ args = { = ... } ] - # [ flags = [ [ ifexists ] [ nofail ] ] + # ( args = { = ... } ) + # ( flags = [ ( ifexists ) ( nofail ) ] ) + # ( condition = [ { = ... } ... ] ) #} # # Loads a module with the given parameters. @@ -135,8 +136,9 @@ context.modules = [ context.objects = [ #{ factory = - # [ args = { = ... } ] - # [ flags = [ [ nofail ] ] + # ( args = { = ... } ) + # ( flags = [ ( nofail ) ] ) + # ( condition = [ { = ... } ... ] ) #} # # Creates an object from a PipeWire factory with the given parameters. @@ -339,7 +341,10 @@ context.objects = [ ] context.exec = [ - #{ path = [ args = "" ] } + #{ path = + # ( args = "" ) + # ( condition = [ { = ... } ... ] ) + #} # # Execute the given program with arguments. # diff --git a/src/daemon/pipewire-pulse.conf.in b/src/daemon/pipewire-pulse.conf.in index 18bca3a1e..3b0700627 100644 --- a/src/daemon/pipewire-pulse.conf.in +++ b/src/daemon/pipewire-pulse.conf.in @@ -57,11 +57,11 @@ context.exec = [ # Extra commands can be executed here. # load-module : loads a module with args and flags # args = " " -# flags = [ "no-fail" ] +# ( flags = [ nofail ] ) pulse.cmd = [ { cmd = "load-module" args = "module-always-sink" flags = [ ] } #{ cmd = "load-module" args = "module-switch-on-connect" } - #{ cmd = "load-module" args = "module-gsettings" flags = [ "nofail" ] } + #{ cmd = "load-module" args = "module-gsettings" flags = [ nofail ] } ] stream.properties = { diff --git a/src/modules/module-protocol-pulse/cmd.c b/src/modules/module-protocol-pulse/cmd.c index e8e6406ca..529e37407 100644 --- a/src/modules/module-protocol-pulse/cmd.c +++ b/src/modules/module-protocol-pulse/cmd.c @@ -76,7 +76,10 @@ static int do_cmd(struct impl *impl, const char *cmd, char *args, const char *fl /* * pulse.cmd = [ - * { cmd = [ args = "" ] } + * { cmd = + * ( args = "" ) + * ( flags = [ ( nofail ) ] ) + * } * ... * ] */