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

char* pa_cvolume_snprint ( char *  s,
size_t  l,
const pa_cvolume c 
)

Pretty print a volume structure

Definition at line 118 of file volume.c.

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

                                                                 {
    unsigned channel;
    int first = 1;
    char *e;

    pa_assert(s);
    pa_assert(l > 0);
    pa_assert(c);

    *(e = s) = 0;

    for (channel = 0; channel < c->channels && l > 1; channel++) {
        l -= pa_snprintf(e, l, "%s%u: %3u%%",
                      first ? "" : " ",
                      channel,
                      (c->values[channel]*100)/PA_VOLUME_NORM);

        e = strchr(e, 0);
        first = 0;
    }

    return s;
}


Generated by  Doxygen 1.6.0   Back to index