channelmix: implement per channel volume

Implement per channel volume on channelmix. Extend control on stream to
take an array of values when possible.

Remove name argument from pw_node_new and pw_device_new. We can pass
this as a property instead.

Improve properties on nodes to more closely match what pulseaudio does.
Don't let the monitor do too much with the udev properties but let the
session manager set the description and icon-names.

Remove some change_mask flags for things that don't change in
introspect. Use the flags to mark changes in -cli and -monitor.
This commit is contained in:
Wim Taymans 2019-08-12 14:47:16 +02:00
parent 1c27f48992
commit c6a7b3eedb
45 changed files with 737 additions and 367 deletions

View file

@ -31,7 +31,8 @@ channelmix_copy_c(struct channelmix *mix, uint32_t n_dst, void * SPA_RESTRICT ds
uint32_t i, n;
float **d = (float **)dst;
const float **s = (const float **)src;
float v = mix->volume;
const float *m = mix->matrix;
const float v = mix->volume;
if (v <= VOLUME_MIN) {
for (i = 0; i < n_dst; i++)
@ -42,9 +43,12 @@ channelmix_copy_c(struct channelmix *mix, uint32_t n_dst, void * SPA_RESTRICT ds
spa_memcpy(d[i], s[i], n_samples * sizeof(float));
}
else {
for (i = 0; i < n_dst; i++)
for (i = 0; i < n_dst; i++) {
const float vol = m[i * n_src + i];
for (n = 0; n < n_samples; n++)
d[i][n] = s[i][n] * v;
d[i][n] = s[i][n] * vol;
}
}
}
@ -58,14 +62,13 @@ channelmix_f32_n_m_c(struct channelmix *mix, uint32_t n_dst, void * SPA_RESTRICT
float **d = (float **) dst;
const float **s = (const float **) src;
const float *m = mix->matrix;
float v = mix->volume;
for (n = 0; n < n_samples; n++) {
for (i = 0; i < n_dst; i++) {
float sum = 0.0f;
for (j = 0; j < n_src; j++)
sum += s[j][n] * m[i * n_src + j];
d[i][n] = sum * v;
d[i][n] = sum;
}
}
}