alsa-utils/topology
Jyri Sarha cf25cf6767 topology: pre-process-object: Expand definitions within strings
Expand the pre-processor to allow for expanding the definitions,
object attribute references and arithmetic expressions within strings.

With this extension its possible to embedded definitions or attribute
references into topology string objects. For example:

Define {
       PCM_NUMBER	1
}

Object.Pipeline {
	pcm-playback.0 {

	Object.Widget {
		copier.1 {
			copier_type	"host"
		}
		gain.1 {
			Object.Control.mixer.1 {
				name 'hw:$[$PCM_NUMBER - 1] Playback Volume'
		}
	}

	Object.Base {
		route.1 {
			source	copier.host.$index.1
			sink	gain.$index.1
		}
	}
}

In the example the $[$PCM_NUMBER - 1] would be replaced with the
result of arithmetic expression '1 - 1' in other words '0' , and
$index in all occurrences with index attribute found from pipeline
object. Any non alpha numeric or '_' character are treated as
delimiters for variable names if $[]-notation is not used.

Fixes: https://github.com/alsa-project/alsa-utils/pull/189
Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-02-06 15:49:14 +01:00
..
nhlt topology: nhlt: intel: add support for ssp blob ver 1.5 2023-01-24 09:43:52 +01:00
alsatplg.rst alsatplg: add decode command 2020-02-09 20:52:30 +01:00
Makefile.am topology: add missing pre-process-external.h to Makefile.am 2022-05-03 14:06:13 +02:00
pre-process-class.c alsatplg: use standard include/asoundlib.h instead direct headers 2021-09-03 08:49:03 +02:00
pre-process-dai.c alsatplg: use standard include/asoundlib.h instead direct headers 2021-09-03 08:49:03 +02:00
pre-process-dapm.c topology: pre-processor: Move the call to expand variables 2021-12-19 20:32:38 +01:00
pre-process-external.h topology: add simple topology plugin mechanism 2022-05-03 13:23:36 +02:00
pre-process-object.c topology: pre-process-object: Expand definitions within strings 2023-02-06 15:49:14 +01:00
pre-processor.c topology: pre-processor: support to include conf block with IncludeByKey 2023-01-24 09:45:45 +01:00
pre-processor.h topology: add simple topology plugin mechanism 2022-05-03 13:23:36 +02:00
topology.c topology: fix the comment for improved -D option 2022-01-28 09:29:34 +01:00
topology.h topology: rename function free_pre_preprocessor to free_pre_processor 2022-01-27 15:02:02 +01:00