diff --git a/src/fft.c b/src/fft.c index c9eeb96..5a6427c 100755 --- a/src/fft.c +++ b/src/fft.c @@ -105,7 +105,7 @@ int i, j, step, k=0; unsigned int avg; - step = inLen/(max); + step = inLen/(max)-2; for(i=0; i 0) { // clear screen for printing (only if new data on fifo) - erase(); - print_visual(fftBuf, fftAvg); - // print mpd status (if not refreshed, print old one) + if(cnt == NICENESS) { + erase(); + print_visual(fftBuf, fftAvg); + } } // print mpd status even if no new data is avaiable print_mpd_status(status, maxC, maxR/2+maxR/6); diff --git a/src/settings.h b/src/settings.h index a853f2d..e36c4f3 100644 --- a/src/settings.h +++ b/src/settings.h @@ -3,3 +3,9 @@ static char defDBlocation[] = "/home/francesco/.mpd/mpd.db"; // the location of the database to be used with the custom search #define TIMEOUT 1000 // timeout for connection, define at your own risk. Good values range between 1000 and 5000 #define STATUS_REFRESH 5 // #seconds between each mpd status refresh +#define NICENESS 0 // nuber of buffers whose computation is skipped (cyclically). + // More skips mean less precision, nicer on older cpus + // 0 -> do not skip + // 1 -> process one out of two + // 2 -> process one out of three + // etc