# Add a specific named PipeWire pcm

defaults.pipewire.server "pipewire-0"
defaults.pipewire.node "-1"
defaults.pipewire.exclusive false
defaults.pipewire.role ""

pcm.pipewire {
	@args [ SERVER NODE EXCLUSIVE ROLE ]
	@args.SERVER {
		type string
		default {
			@func refer
			name defaults.pipewire.server
		}
	}
	@args.NODE {
		type string
		default {
			@func refer
			name defaults.pipewire.node
		}
	}
	@args.EXCLUSIVE {
		type integer
		default {
			@func refer
			name defaults.pipewire.exclusive
		}
	}
	@args.ROLE {
		type string
		default {
			@func refer
			name defaults.pipewire.role
		}
	}


	type pipewire
	server $SERVER
	playback_node $NODE
	capture_node $NODE
	exclusive $EXCLUSIVE
	role $ROLE
	hint {
		show on
		description "PipeWire Sound Server"
	}
}

ctl.pipewire {
        @args.SERVER {
                type string
                default {
                        @func refer
                        name defaults.pipewire.server
                }
        }
        type pipewire
        server $SERVER
}
