mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-10 00:45:41 +01:00
6e3fc0433e
Introduce a new kyword "SubTreeCopy" for extneding existing conf nodes with additional nodes. This feature is useful for extending previous pipeline class definitions with the addition of one or more widgets without having to duplicate everything in the new class definition. For example: Consider a pipeline class definition as below. Note that only the widgets & routes are shown here. Class.Pipeline.mixout-gain-dai-copier-playback { Object.Widget { mixout."1" {} dai-copier."1" {} gain."1" {} pipeline."1" {} } Object.Base { !route [ { source mixout.$index.1 sink gain.$index.1 } ] } } If we want to extend this pipeline with the addition of an eqiir/eqfir, we can create a SubTreeCopy node with type extend as follows: Class.Pipeline.mixout-gain-eqiir-eqfir-dai-copier-playback { SubTreeCopy.baseclass { source "Class.Pipeline.mixout-gain-dai-copier-playback" type extend tree { Object.Widget { eqiir.1 {} eqfir.1 {} } Object.Base { !route [ { source gain.$index.1 sink eqiir.$index.1 } { source eqiir.$index.1 sink eqfir.$index.1 } ] } } } } Note that the target is left undefined, which means that the newly created subtree will be merged to the parent node that contains the "SubTreeCopy" node i.e. in this case Class.Pipeline.mixout-gain-eqiir-eqfir-dai-copier-playback". But if we want to modify an existing pipeline class while modifying the order of widgets and/or inserting new widgets, we should use the type "override" instead. This allows for adding new widgets to the list of widgets in the base class definition while also allowing overriding the routes to allow inserting the new widgets and reordering the widgets in the base class. For example, if we want to add a drc widget between the gain and the eqiir modules in the above class, we can do the following: Class.Pipeline.mixout-efx-dai-copier-playback { # This copy will override all widgets/routes in the base class SubTreeCopy.baseclass { source "Class.Pipeline.mixout-gain-eqiir-eqfir-dai-copier-playback" target "Class.Pipeline" type override tree { Object.Widget { drc.1 {} } Object.Base { !route [ { source mixout.$index.1 sink gain.$index.1 } { source gain.$index.1 sink drc.$index.1 } { source drc.$index.1 sink eqiir.$index.1 } { source eqiir.$index.1 sink eqfir.$index.1 } ] } } } # Explicitly copy the widgets from the base class now SubTreeCopy.widgets { source "Class.Pipeline.mixout-gain-eqiir-eqfir-dai-copier-playback.Object.Widget" target "Class.Pipeline.mixout-efx-dai-copier-playback.Object.Widget" } } Closes: https://github.com/alsa-project/alsa-utils/pull/268 Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz> |
||
---|---|---|
.. | ||
nhlt | ||
alsatplg.rst | ||
Makefile.am | ||
pre-process-class.c | ||
pre-process-dai.c | ||
pre-process-dapm.c | ||
pre-process-external.h | ||
pre-process-object.c | ||
pre-processor.c | ||
pre-processor.h | ||
topology.c | ||
topology.h |