topology: pre-processor: Introduce a new feature for subtree
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.
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
# 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>