# Helper macros
#
-DefineMacro.SplitPCM_chnpos.If.a {
- Condition {
- Type String
- Empty "${var:__HWChannelPos}"
- }
- False.LibraryConfig.0.SubstiConfig.pcm."${var:__Name}" {
- slave.pcm.chmap [ "${var:__HWChannelPos}" ]
+DefineMacro.SplitPCM_chnpos {
+ Define._varrefpos "__HWChannelPos${var:__Index}"
+ Define._pos "$${var:$_varrefpos}"
+ If.a {
+ Condition {
+ Type String
+ Empty "${var:_pos}"
+ }
+ False.LibraryConfig.0.SubstiConfig.pcm."${var:__Name}" {
+ slave.pcm.chmap [ "${var:_pos}" ]
+ }
}
}
}
}
-DefineMacro.SplitPCMDevice_chnpos.If.a {
- Condition {
- Type String
- Empty "${var:__Channel}"
- }
- False.Value {
- "${var:__Direction}Channel${var:__Index}" "${var:__Channel}"
- "${var:__Direction}ChannelPos${var:__Index}" "${var:__ChannelPos}"
+DefineMacro.SplitPCMDevice_chnpos {
+ Define._varrefchn "__Channel${var:__Index}"
+ Define._chn "$${var:$_varrefchn}"
+ If.a {
+ Condition {
+ Type String
+ Empty "${var:-_chn}"
+ }
+ False {
+ Define._varrefpos "__ChannelPos${var:__Index}"
+ Define._pos "$${var:$_varrefpos}"
+ Value {
+ "${var:__Direction}Channel${var:__Index}" "${var:_chn}"
+ "${var:__Direction}ChannelPos${var:__Index}" "${var:_pos}"
+ }
+ }
}
}
-DefineMacro.SplitPCMDevice_addchn.If.a {
- Condition {
- Type String
- Empty "${var:__Channel}"
+DefineMacro.SplitPCMDevice_addchn {
+ Define._varrefchn "__Channel${var:__Index}"
+ Define._chn "$${var:$_varrefchn}"
+ If.a {
+ Condition {
+ Type String
+ Empty "${var:_chn}"
+ }
+ False.Define.__pcmdev "${var:__pcmdev},${var:_chn}"
}
- False.Define.__pcmdev "${var:__pcmdev},${var:__Channel}"
}
#
type hw
card $CARD
device $DEV
- chmap [ "${var:__HWChannelPos0}" ]
}
format "${var:__Format}"
channels "${evali:$__HWChannels}"
bindings.0 $CHN0
}
- Macro.pos1.SplitPCM_chnpos "HWChannelPos='${var:-__HWChannelPos1}'"
- Macro.pos2.SplitPCM_chnpos "HWChannelPos='${var:-__HWChannelPos2}'"
- Macro.pos3.SplitPCM_chnpos "HWChannelPos='${var:-__HWChannelPos3}'"
- Macro.pos4.SplitPCM_chnpos "HWChannelPos='${var:-__HWChannelPos4}'"
- Macro.pos5.SplitPCM_chnpos "HWChannelPos='${var:-__HWChannelPos5}'"
- Macro.pos6.SplitPCM_chnpos "HWChannelPos='${var:-__HWChannelPos6}'"
- Macro.pos7.SplitPCM_chnpos "HWChannelPos='${var:-__HWChannelPos7}'"
- Macro.pos8.SplitPCM_chnpos "HWChannelPos='${var:-__HWChannelPos8}'"
- Macro.pos9.SplitPCM_chnpos "HWChannelPos='${var:-__HWChannelPos9}'"
- Macro.pos10.SplitPCM_chnpos "HWChannelPos='${var:-__HWChannelPos10}'"
- Macro.pos11.SplitPCM_chnpos "HWChannelPos='${var:-__HWChannelPos11}'"
- Macro.pos12.SplitPCM_chnpos "HWChannelPos='${var:-__HWChannelPos12}'"
- Macro.pos13.SplitPCM_chnpos "HWChannelPos='${var:-__HWChannelPos13}'"
- Macro.pos14.SplitPCM_chnpos "HWChannelPos='${var:-__HWChannelPos14}'"
- Macro.pos15.SplitPCM_chnpos "HWChannelPos='${var:-__HWChannelPos15}'"
- Macro.pos16.SplitPCM_chnpos "HWChannelPos='${var:-__HWChannelPos16}'"
- Macro.pos17.SplitPCM_chnpos "HWChannelPos='${var:-__HWChannelPos17}'"
- Macro.pos18.SplitPCM_chnpos "HWChannelPos='${var:-__HWChannelPos18}'"
- Macro.pos19.SplitPCM_chnpos "HWChannelPos='${var:-__HWChannelPos19}'"
- Macro.pos20.SplitPCM_chnpos "HWChannelPos='${var:-__HWChannelPos20}'"
- Macro.pos21.SplitPCM_chnpos "HWChannelPos='${var:-__HWChannelPos21}'"
- Macro.pos22.SplitPCM_chnpos "HWChannelPos='${var:-__HWChannelPos22}'"
- Macro.pos23.SplitPCM_chnpos "HWChannelPos='${var:-__HWChannelPos23}'"
- Macro.pos24.SplitPCM_chnpos "HWChannelPos='${var:-__HWChannelPos24}'"
- Macro.pos25.SplitPCM_chnpos "HWChannelPos='${var:-__HWChannelPos25}'"
- Macro.pos26.SplitPCM_chnpos "HWChannelPos='${var:-__HWChannelPos26}'"
- Macro.pos27.SplitPCM_chnpos "HWChannelPos='${var:-__HWChannelPos27}'"
- Macro.pos28.SplitPCM_chnpos "HWChannelPos='${var:-__HWChannelPos28}'"
- Macro.pos29.SplitPCM_chnpos "HWChannelPos='${var:-__HWChannelPos29}'"
- Macro.pos30.SplitPCM_chnpos "HWChannelPos='${var:-__HWChannelPos30}'"
- Macro.pos31.SplitPCM_chnpos "HWChannelPos='${var:-__HWChannelPos31}'"
- Macro.pos32.SplitPCM_chnpos "HWChannelPos='${var:-__HWChannelPos32}'"
+ Macro.pos00.SplitPCM_chnpos "Index=0"
+ Macro.pos01.SplitPCM_chnpos "Index=1"
+ Macro.pos02.SplitPCM_chnpos "Index=2"
+ Macro.pos03.SplitPCM_chnpos "Index=3"
+ Macro.pos04.SplitPCM_chnpos "Index=4"
+ Macro.pos05.SplitPCM_chnpos "Index=5"
+ Macro.pos06.SplitPCM_chnpos "Index=6"
+ Macro.pos07.SplitPCM_chnpos "Index=7"
+ Macro.pos08.SplitPCM_chnpos "Index=8"
+ Macro.pos09.SplitPCM_chnpos "Index=9"
+ Macro.pos10.SplitPCM_chnpos "Index=10"
+ Macro.pos11.SplitPCM_chnpos "Index=11"
+ Macro.pos12.SplitPCM_chnpos "Index=12"
+ Macro.pos13.SplitPCM_chnpos "Index=13"
+ Macro.pos14.SplitPCM_chnpos "Index=14"
+ Macro.pos15.SplitPCM_chnpos "Index=15"
+ Macro.pos16.SplitPCM_chnpos "Index=16"
+ Macro.pos17.SplitPCM_chnpos "Index=17"
+ Macro.pos18.SplitPCM_chnpos "Index=18"
+ Macro.pos19.SplitPCM_chnpos "Index=19"
+ Macro.pos20.SplitPCM_chnpos "Index=20"
+ Macro.pos21.SplitPCM_chnpos "Index=21"
+ Macro.pos22.SplitPCM_chnpos "Index=22"
+ Macro.pos23.SplitPCM_chnpos "Index=23"
+ Macro.pos24.SplitPCM_chnpos "Index=24"
+ Macro.pos25.SplitPCM_chnpos "Index=25"
+ Macro.pos26.SplitPCM_chnpos "Index=26"
+ Macro.pos27.SplitPCM_chnpos "Index=27"
+ Macro.pos28.SplitPCM_chnpos "Index=28"
+ Macro.pos29.SplitPCM_chnpos "Index=29"
+ Macro.pos30.SplitPCM_chnpos "Index=30"
+ Macro.pos31.SplitPCM_chnpos "Index=31"
Macro.ch1.SplitPCM_chn "ChIndex=1 ChRegex='^([2-9]|[1-9][0-9])$'"
Macro.ch2.SplitPCM_chn "ChIndex=2 ChRegex='^([3-9]|[1-9][0-9])$'"
Value {
"${var:__Direction}Channels" "${var:__HWChannels}"
"${var:__Direction}PCM" "hw:${CardId},${var:__Device}"
- "${var:__Direction}Channel0" "${var:__Channel0}"
- "${var:__Direction}ChannelPos0" "${var:__ChannelPos0}"
}
- Macro.chn1.SplitPCMDevice_chnpos "Index=1 Channel='${var:-__Channel1}' ChannelPos='${var:-__ChannelPos1}'"
- Macro.chn2.SplitPCMDevice_chnpos "Index=2 Channel='${var:-__Channel2}' ChannelPos='${var:-__ChannelPos2}'"
- Macro.chn3.SplitPCMDevice_chnpos "Index=3 Channel='${var:-__Channel3}' ChannelPos='${var:-__ChannelPos3}'"
- Macro.chn4.SplitPCMDevice_chnpos "Index=4 Channel='${var:-__Channel4}' ChannelPos='${var:-__ChannelPos4}'"
- Macro.chn5.SplitPCMDevice_chnpos "Index=5 Channel='${var:-__Channel5}' ChannelPos='${var:-__ChannelPos5}'"
- Macro.chn6.SplitPCMDevice_chnpos "Index=6 Channel='${var:-__Channel6}' ChannelPos='${var:-__ChannelPos6}'"
- Macro.chn7.SplitPCMDevice_chnpos "Index=7 Channel='${var:-__Channel7}' ChannelPos='${var:-__ChannelPos7}'"
+ Macro.chn0.SplitPCMDevice_chnpos "Index=0"
+ Macro.chn1.SplitPCMDevice_chnpos "Index=1"
+ Macro.chn2.SplitPCMDevice_chnpos "Index=2"
+ Macro.chn3.SplitPCMDevice_chnpos "Index=3"
+ Macro.chn4.SplitPCMDevice_chnpos "Index=4"
+ Macro.chn5.SplitPCMDevice_chnpos "Index=5"
+ Macro.chn6.SplitPCMDevice_chnpos "Index=6"
+ Macro.chn7.SplitPCMDevice_chnpos "Index=7"
}
True {
- Define.__pcmdev "${var:__Name}:${CardId},${var:__Device},${var:__Channel0}"
- Macro.ch1.SplitPCMDevice_addchn "Channel='${var:-__Channel1}'"
- Macro.ch2.SplitPCMDevice_addchn "Channel='${var:-__Channel2}'"
- Macro.ch3.SplitPCMDevice_addchn "Channel='${var:-__Channel3}'"
- Macro.ch4.SplitPCMDevice_addchn "Channel='${var:-__Channel4}'"
- Macro.ch5.SplitPCMDevice_addchn "Channel='${var:-__Channel5}'"
- Macro.ch6.SplitPCMDevice_addchn "Channel='${var:-__Channel6}'"
- Macro.ch7.SplitPCMDevice_addchn "Channel='${var:-__Channel7}'"
+ Define.__pcmdev "${var:__Name}:${CardId},${var:__Device}"
+ Macro.ch0.SplitPCMDevice_addchn "Index=0"
+ Macro.ch1.SplitPCMDevice_addchn "Index=1"
+ Macro.ch2.SplitPCMDevice_addchn "Index=2"
+ Macro.ch3.SplitPCMDevice_addchn "Index=3"
+ Macro.ch4.SplitPCMDevice_addchn "Index=4"
+ Macro.ch5.SplitPCMDevice_addchn "Index=5"
+ Macro.ch6.SplitPCMDevice_addchn "Index=6"
+ Macro.ch7.SplitPCMDevice_addchn "Index=7"
Value {
"${var:__Direction}Channels" "${var:__Channels}"
"${var:__Direction}PCM" "${var:__pcmdev}"