mirror of
https://github.com/vsariola/sointu.git
synced 2025-07-19 05:24:48 -04:00
refactor(tracker): ask for midiContext in the model constructor
This commit is contained in:
parent
f427eca1f4
commit
2809526de6
@ -27,11 +27,11 @@ type (
|
||||
NullMIDIContext struct{}
|
||||
)
|
||||
|
||||
func (m *NullMIDIContext) ListInputDevices() func(yield func(tracker.MIDIDevice) bool) {
|
||||
func (m NullMIDIContext) ListInputDevices() func(yield func(tracker.MIDIDevice) bool) {
|
||||
return func(yield func(tracker.MIDIDevice) bool) {}
|
||||
}
|
||||
|
||||
func (m *NullMIDIContext) Close() {}
|
||||
func (m NullMIDIContext) Close() {}
|
||||
|
||||
func (c *VSTIProcessContext) NextEvent() (event tracker.MIDINoteEvent, ok bool) {
|
||||
for c.eventIndex < len(c.events) {
|
||||
@ -72,8 +72,7 @@ func init() {
|
||||
rand.Read(randBytes)
|
||||
recoveryFile = filepath.Join(configDir, "sointu", "sointu-vsti-recovery-"+hex.EncodeToString(randBytes))
|
||||
}
|
||||
model, player := tracker.NewModelPlayer(cmd.MainSynther, recoveryFile)
|
||||
model.MIDI = &NullMIDIContext{}
|
||||
model, player := tracker.NewModelPlayer(cmd.MainSynther, NullMIDIContext{}, recoveryFile)
|
||||
|
||||
t := gioui.NewTracker(model)
|
||||
tracker.Bool{BoolData: (*tracker.InstrEnlarged)(model)}.Set(true)
|
||||
|
Reference in New Issue
Block a user