From 01bcfc5d692236bffeec5b8de2c27138e71d2bd6 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Mon, 22 Sep 2014 21:38:37 +0200 Subject: Add -L option to print level --- utils.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 utils.h (limited to 'utils.h') diff --git a/utils.h b/utils.h new file mode 100644 index 0000000..7d98ab6 --- /dev/null +++ b/utils.h @@ -0,0 +1,20 @@ +#ifndef _UTILS_H_ +#define _UTILS_H_ + +#include +#include + +#define MIN(a,b) (((a)<(b))?(a):(b)) +#define MAX(a,b) (((a)>(b))?(a):(b)) + +#define NUMOF(l) (sizeof(l) / sizeof(*l)) + +#define linear_to_dB(x) (log10(x) * 20) + +/* Calculate the little string containing a bargraph + * 'VU-meter' from the peak value measured + */ +const char* level(int channel, int* peak); + +#endif + -- cgit v1.2.3