Logo Search packages:      
Sourcecode: pulseaudio version File versions  Download package

pa_cvolume* pa_sw_cvolume_multiply_scalar ( pa_cvolume dest,
const pa_cvolume a,
pa_volume_t  b 
)

Multiply a per-channel volume with a scalar volume and return the result in *dest. This is only valid for software volumes! a and dest may point to the same structure.

Since:
0.9.16

Definition at line 414 of file volume.c.

References pa_cvolume::channels, PA_VOLUME_INVALID, and pa_cvolume::values.

                                                                                                {
    unsigned i;

    pa_assert(dest);
    pa_assert(a);

    pa_return_val_if_fail(pa_cvolume_valid(a), NULL);
    pa_return_val_if_fail(b != PA_VOLUME_INVALID, NULL);

    for (i = 0; i < a->channels; i++)
        dest->values[i] = pa_sw_volume_multiply(a->values[i], b);

    dest->channels = (uint8_t) i;

    return dest;
}


Generated by  Doxygen 1.6.0   Back to index