Removing debug from numeter for now

This commit is contained in:
Martyn 2021-12-27 13:49:26 +00:00
parent 86afd312d8
commit ce08b48821
1 changed files with 3 additions and 4 deletions

View File

@ -1,7 +1,6 @@
package numeter
import (
"fmt"
"image"
"image/color"
"math"
@ -106,16 +105,16 @@ func (v *vuRenderer) Render(w int, h int) image.Image {
val := (v.meter.Value - v.meter.Min) / (v.meter.Max - v.meter.Min) * 100
vuSet(i, w, h, v.meter.VUMeterDirection, val, g, a, r)
if v.meter.Value > v.lastPeakVal {
fmt.Printf("New peak: %f, expires at %s\n", v.meter.Value, time.Now().Add(v.meter.Peakhold))
//fmt.Printf("New peak: %f, expires at %s\n", v.meter.Value, time.Now().Add(v.meter.Peakhold))
v.lastPeakTime = time.Now()
v.lastPeakVal = v.meter.Value
}
if v.lastPeakTime.Add(v.meter.Peakhold).Before(time.Now()) {
fmt.Printf("Previous peak good, bar at %f\n", v.lastPeakVal)
//fmt.Printf("Previous peak good, bar at %f\n", v.lastPeakVal)
drawPeakBar(i, w, h, v.meter.VUMeterDirection, v.lastPeakVal, g, a, r)
}
if v.lastPeakTime.Add(v.meter.Peakhold).After(time.Now()) {
fmt.Printf("Previous peak expired, holding at %f\n", v.meter.Value)
//fmt.Printf("Previous peak expired, holding at %f\n", v.meter.Value)
v.lastPeakVal = v.meter.Value
v.lastPeakTime = time.Now()
}