Logo Search packages:      
Sourcecode: pulseaudio version File versions

char* pa_channel_map_snprint ( char *  s,
size_t  l,
const pa_channel_map map 
)

Make a humand readable string from the specified channel map

Definition at line 460 of file channelmap.c.

References pa_channel_map::channels, and pa_channel_map::map.

                                                                           {
    unsigned channel;
    pa_bool_t first = TRUE;
    char *e;

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

    pa_init_i18n();

    if (!pa_channel_map_valid(map)) {
        pa_snprintf(s, l, _("(invalid)"));
        return s;
    }

    *(e = s) = 0;

    for (channel = 0; channel < map->channels && l > 1; channel++) {
        l -= pa_snprintf(e, l, "%s%s",
                      first ? "" : ",",
                      pa_channel_position_to_string(map->map[channel]));

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

    return s;
}


Generated by  Doxygen 1.6.0   Back to index