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

pa_cvolume* pa_cvolume_merge ( pa_cvolume dest,
const pa_cvolume a,
const pa_cvolume b 
)

This goes through all channels in a and b and sets the corresponding channel in dest to the greater volume of both. a, b and dest may point to the same structure.

Since:
0.9.16

Definition at line 870 of file volume.c.

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

                                                                                         {
    unsigned i;

    pa_assert(dest);
    pa_assert(a);
    pa_assert(b);

    pa_return_val_if_fail(pa_cvolume_valid(a), NULL);
    pa_return_val_if_fail(pa_cvolume_valid(b), NULL);

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

    dest->channels = (uint8_t) i;

    return dest;
}


Generated by  Doxygen 1.6.0   Back to index