mirror of
https://github.com/vsariola/sointu.git
synced 2026-02-07 16:20:21 -05:00
feat(tracker): enum-style values and menus to choose one option
This commit is contained in:
parent
ca4b87d43d
commit
4bb5df9c87
@ -1,8 +1,9 @@
|
||||
package tracker
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"github.com/vsariola/sointu"
|
||||
"github.com/vsariola/sointu/vm"
|
||||
)
|
||||
|
||||
// Scope returns the ScopeModel view of the Model, used for oscilloscope
|
||||
@ -53,7 +54,16 @@ func (s *scopeTriggerChannel) SetValue(val int) bool {
|
||||
s.scopeData.triggerChannel = val
|
||||
return true
|
||||
}
|
||||
func (s *scopeTriggerChannel) Range() RangeInclusive { return RangeInclusive{0, vm.MAX_VOICES} }
|
||||
func (s *scopeTriggerChannel) Range() RangeInclusive { return RangeInclusive{0, len(s.d.Song.Patch)} }
|
||||
func (s *scopeTriggerChannel) StringOf(value int) string {
|
||||
if value == 0 {
|
||||
return "Disabled"
|
||||
}
|
||||
if value >= 1 && value <= len(s.d.Song.Patch) && s.d.Song.Patch[value-1].Name != "" {
|
||||
return s.d.Song.Patch[value-1].Name
|
||||
}
|
||||
return strconv.Itoa(value)
|
||||
}
|
||||
|
||||
// Waveform returns the oscilloscope waveform buffer.
|
||||
func (s *ScopeModel) Waveform() RingBuffer[[2]float32] { return s.scopeData.waveForm }
|
||||
|
||||
Reference in New Issue
Block a user