mirror of
https://github.com/vsariola/sointu.git
synced 2025-07-18 21:14:31 -04:00
fix(tracker): ID collisions in ClearUnit and Instruments.unmarshal
This commit is contained in:
parent
9da6c2216c
commit
74972b5ff4
@ -408,6 +408,18 @@ func (m *Model) send(message interface{}) {
|
||||
m.modelMessages <- message
|
||||
}
|
||||
|
||||
func (m *Model) maxID() int {
|
||||
maxID := 0
|
||||
for _, instr := range m.d.Song.Patch {
|
||||
for _, unit := range instr.Units {
|
||||
if unit.ID > maxID {
|
||||
maxID = unit.ID
|
||||
}
|
||||
}
|
||||
}
|
||||
return maxID
|
||||
}
|
||||
|
||||
func (m *Model) assignUnitIDs(units []sointu.Unit) {
|
||||
maxId := 0
|
||||
usedIds := make(map[int]bool)
|
||||
|
Reference in New Issue
Block a user