add i to init, a little clearer to read

This commit is contained in:
onyx-and-iris 2022-12-14 23:58:44 +00:00
parent 4b69952fd5
commit 68e9654502
2 changed files with 4 additions and 4 deletions

2
bus.go
View File

@ -277,7 +277,7 @@ func newBusLevels(i int, k *kind) *levels {
func (l *levels) All() []float64 {
levels := make([]float64, l.offset)
for i := range levels {
levels[i] = convertLevel(_levelCache.busLevels[i+l.init])
levels[i] = convertLevel(_levelCache.busLevels[l.init+i])
}
return levels
}

View File

@ -600,7 +600,7 @@ func (l *levels) PreFader() []float64 {
_levelCache.stripMode = 0
levels := make([]float64, l.offset)
for i := range levels {
levels[i] = convertLevel(_levelCache.stripLevels[i+l.init])
levels[i] = convertLevel(_levelCache.stripLevels[l.init+i])
}
return levels
}
@ -610,7 +610,7 @@ func (l *levels) PostFader() []float64 {
_levelCache.stripMode = 1
levels := make([]float64, l.offset)
for i := range levels {
levels[i] = convertLevel(_levelCache.stripLevels[i+l.init])
levels[i] = convertLevel(_levelCache.stripLevels[l.init+i])
}
return levels
}
@ -620,7 +620,7 @@ func (l *levels) PostMute() []float64 {
_levelCache.stripMode = 2
levels := make([]float64, l.offset)
for i := range levels {
levels[i] = convertLevel(_levelCache.stripLevels[i+l.init])
levels[i] = convertLevel(_levelCache.stripLevels[l.init+i])
}
return levels
}