uni.multirx.lis = 0;
uni.multirx.nrx = loc.def.nrx;
- uni.mix.rx = uni.mix.tx = 1.0;
+ uni.mix.rx.flag = uni.mix.tx.flag = FALSE;
+ uni.mix.rx.gain = uni.mix.tx.gain = 1.0;
uni.tick = 0;
}
CXBhave(rx[k].buf.o) = n;
}
- for (i = 0; i < n; i++)
- bufl[i] += auxl[i] * uni.mix.rx,
- bufr[i] += auxr[i] * uni.mix.rx;
+ if (uni.mix.rx.flag)
+ for (i = 0; i < n; i++)
+ bufl[i] += auxl[i] * uni.mix.rx.gain,
+ bufr[i] += auxr[i] * uni.mix.rx.gain;
break;
case TX:
- for (i = 0; i < n; i++)
- bufl[i] += auxl[i] * uni.mix.tx,
- bufr[i] += auxr[i] * uni.mix.tx;
+ if (uni.mix.tx.flag)
+ for (i = 0; i < n; i++)
+ bufl[i] += auxl[i] * uni.mix.tx.gain,
+ bufr[i] += auxr[i] * uni.mix.tx.gain;
for (i = 0; i < n; i++)
CXBimag(tx.buf.i, i) = bufl[i], CXBreal(tx.buf.i, i) = bufr[i];
}
PRIVATE int
-setAuxMix(int n, char **p) {
+setAuxMixSt(int n, char **p) {
if (n < 1) {
- uni.mix.rx = uni.mix.tx = 1.0;
+ uni.mix.rx.flag = uni.mix.tx.flag = FALSE;
+ return 0;
+ } else {
+ BOOLEAN flag = atoi(p[0]);
+ if (n > 1) {
+ switch (atoi(p[1])) {
+ case TX: uni.mix.tx.flag = flag; break;
+ case RX:
+ default: uni.mix.rx.flag = flag; break;
+ }
+ } else
+ uni.mix.rx.flag = uni.mix.tx.flag = flag;
+ return 0;
+ }
+}
+
+PRIVATE int
+setAuxMixGain(int n, char **p) {
+ if (n < 1) {
+ uni.mix.rx.gain = uni.mix.tx.gain = 1.0;
return 0;
} else {
REAL gain = dB2lin(atof(p[0]));
if (n > 1) {
switch (atoi(p[1])) {
- case TX: uni.mix.tx = gain; break;
+ case TX: uni.mix.tx.gain = gain; break;
case RX:
- default: uni.mix.rx = gain; break;
+ default: uni.mix.rx.gain = gain; break;
}
} else
- uni.mix.rx = uni.mix.tx = gain;
+ uni.mix.rx.gain = uni.mix.tx.gain = gain;
return 0;
}
}
{"setRXOn", setRXOn},
{"setRXOff", setRXOff},
{"setRXPan", setRXPan},
- {"setAuxMix", setAuxMix},
+ {"setAuxMixSt", setAuxMixSt},
+ {"setAuxMixGain", setAuxMixGain},
{ 0, 0 }
};