modules: document link-factory context.objects

This commit is contained in:
Wim Taymans 2025-01-27 15:24:42 +01:00
parent ab5f81b9a4
commit aecb406a96

View file

@ -20,7 +20,8 @@
* *
* This module creates a new factory. Clients that can see the factory * This module creates a new factory. Clients that can see the factory
* can use the factory name (`link-factory`) to create new link * can use the factory name (`link-factory`) to create new link
* objects with \ref pw_core_create_object(). * objects with \ref pw_core_create_object(). It is also possible to create
* objects in the config file.
* *
* Object of the \ref PW_TYPE_INTERFACE_Link will be created and a proxy * Object of the \ref PW_TYPE_INTERFACE_Link will be created and a proxy
* to it will be returned. * to it will be returned.
@ -90,6 +91,26 @@
* } * }
*\endcode *\endcode
* *
* ## Config objects
*
* To create an object from the factory, one can use the \ref pw_core_create_object()
* method or make an object in the `context.objects` section like:
*
*\code{.unparsed}
* context.objects = [
* { factory = link-factory
* args = {
* link.output.node = system
* link.output.port = capture_2
* link.input.node = my-mic
* link.input.port = input_FR
* }
* }
*\endcode
*
* Note that this only works when the ports that need to be linked are available
* at the time the config file is parsed.
*
* ## See also * ## See also
* *
* - `pw-link`: a tool to manage port links * - `pw-link`: a tool to manage port links