summaryrefslogtreecommitdiffstats
path: root/polyp/voltest.c
blob: 286334d087e50dd6f4efb001160709383fcec438 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* $Id$ */

#include <stdio.h>

#include <polyp/sample.h>
#include "gccmacro.h"

int main(PA_GCC_UNUSED int argc, PA_GCC_UNUSED char *argv[]) {
    int p;
    for (p = 0; p <= 200; p++) {
        pa_volume_t v = pa_volume_from_user((double) p/100);
        double dB = pa_volume_to_dB(v);
        printf("%3i%% = %u = %0.2f dB = %u = %3i%%\n", p, v, dB, pa_volume_from_dB(dB), (int) (pa_volume_to_user(v)*100));
    }
}