mirror of
https://github.com/vsariola/sointu.git
synced 2025-07-18 21:14:31 -04:00
refactor(tracker): make struct to hold all per voice data in Player
This commit is contained in:
parent
0ce5ca3003
commit
a60814bab7
@ -48,7 +48,7 @@ type InstrumentEditor struct {
|
||||
tag bool
|
||||
wasFocused bool
|
||||
commentExpanded bool
|
||||
voiceStates [vm.MAX_VOICES]float32
|
||||
voiceLevels [vm.MAX_VOICES]float32
|
||||
presetMenuItems []MenuItem
|
||||
presetMenu Menu
|
||||
}
|
||||
@ -314,7 +314,7 @@ func (ie *InstrumentEditor) layoutInstrumentNames(gtx C, t *Tracker) D {
|
||||
loopMax = vm.MAX_VOICES
|
||||
}
|
||||
for j := 0; j < loopMax; j++ {
|
||||
vc := ie.voiceStates[voice]
|
||||
vc := ie.voiceLevels[voice]
|
||||
if c < vc {
|
||||
c = vc
|
||||
}
|
||||
|
@ -201,7 +201,7 @@ mainloop:
|
||||
}
|
||||
t.lastAvgVolume = e.AverageVolume
|
||||
t.lastPeakVolume = e.PeakVolume
|
||||
t.InstrumentEditor.voiceStates = e.VoiceStates
|
||||
t.InstrumentEditor.voiceLevels = e.VoiceLevels
|
||||
t.ProcessPlayerMessage(e)
|
||||
w.Invalidate()
|
||||
case e := <-w.Events():
|
||||
|
Reference in New Issue
Block a user