feat(tracker, gioui): add error message if vuanalyzer detects a NaN

Closes #50
This commit is contained in:
vsariola
2021-04-12 20:05:18 +03:00
parent 68a50247bd
commit ce52aa0ee9
3 changed files with 14 additions and 3 deletions

View File

@ -69,6 +69,7 @@ type Tracker struct {
player *tracker.Player
refresh chan struct{}
playerCloser chan struct{}
errorChannel chan error
audioContext sointu.AudioContext
*tracker.Model
@ -152,10 +153,11 @@ func New(audioContext sointu.AudioContext, synthService sointu.SynthService, syn
PatternOrderList: &layout.List{Axis: layout.Vertical},
PatternOrderScrollBar: &ScrollBar{Axis: layout.Vertical},
ConfirmInstrDelete: new(Dialog),
errorChannel: make(chan error, 32),
}
t.Model = tracker.NewModel()
vuBufferObserver := make(chan []float32)
go tracker.VuAnalyzer(0.3, 1e-4, 1, -100, 20, vuBufferObserver, t.volumeChan)
go tracker.VuAnalyzer(0.3, 1e-4, 1, -100, 20, vuBufferObserver, t.volumeChan, t.errorChannel)
t.Theme.Palette.Fg = primaryColor
t.Theme.Palette.ContrastFg = black
t.SetEditMode(tracker.EditTracks)