summaryrefslogtreecommitdiff
path: root/src/tests/channelmap-test.c
blob: 124ce5768dd336454d31e8aa59ee5cb5aafc6989 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* $Id$ */

#include <stdio.h>
#include <assert.h>

#include <pulse/channelmap.h>
#include <pulsecore/gccmacro.h>

int main(PA_GCC_UNUSED int argc, PA_GCC_UNUSED char *argv[]) {
    char cm[PA_CHANNEL_MAP_SNPRINT_MAX];
    pa_channel_map map, map2;

    pa_channel_map_init_auto(&map, 6, PA_CHANNEL_MAP_AIFF);
    
    fprintf(stderr, "map: <%s>\n", pa_channel_map_snprint(cm, sizeof(cm), &map));

    pa_channel_map_init_auto(&map, 6, PA_CHANNEL_MAP_AUX);
    
    fprintf(stderr, "map: <%s>\n", pa_channel_map_snprint(cm, sizeof(cm), &map));

    pa_channel_map_init_auto(&map, 6, PA_CHANNEL_MAP_ALSA);
    
    fprintf(stderr, "map: <%s>\n", pa_channel_map_snprint(cm, sizeof(cm), &map));
    
    pa_channel_map_parse(&map2, cm);

    assert(pa_channel_map_equal(&map, &map2));

    pa_channel_map_parse(&map2, "left,test");

    
    return 0;
}