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

pa_volume_t pa_cvolume_max_mask ( const pa_cvolume a,
const pa_channel_map cm,
pa_channel_position_mask_t  mask 
)

Return the maximum volume of all channels that are included in the specified channel map with the specified channel position mask. If cm is NULL this call is identical to pa_cvolume_max(). If no channel is selected the returned value will be PA_VOLUME_MUTED.

Since:
0.9.16

Definition at line 156 of file volume.c.

References pa_cvolume::channels, pa_channel_map::map, PA_CHANNEL_POSITION_MASK, PA_VOLUME_MUTED, pa_volume_t, and pa_cvolume::values.

                                                                                                                {
    pa_volume_t m = PA_VOLUME_MUTED;
    unsigned c;

    pa_assert(a);

    if (!cm)
        return pa_cvolume_max(a);

    pa_return_val_if_fail(pa_cvolume_compatible_with_channel_map(a, cm), PA_VOLUME_MUTED);

    for (c = 0; c < a->channels; c++) {

        if (!(PA_CHANNEL_POSITION_MASK(cm->map[c]) & mask))
            continue;

        if (a->values[c] > m)
            m = a->values[c];
    }

    return m;
}


Generated by  Doxygen 1.6.0   Back to index