mirror of
https://github.com/vsariola/sointu.git
synced 2026-03-16 11:50:21 -04:00
refactor: put all info about different unit types into UnitTypes map
This commit is contained in:
parent
8ea9d3a191
commit
6a331f7a57
@ -116,7 +116,7 @@ func (m *Model) deriveParams(unit *sointu.Unit, ret []Parameter) []Parameter {
|
||||
return ret
|
||||
}
|
||||
portIndex := 0
|
||||
for i, up := range unitType {
|
||||
for i, up := range unitType.Params {
|
||||
if !up.CanSet && !up.CanModulate {
|
||||
continue // skip parameters that cannot be set or modulated
|
||||
}
|
||||
@ -131,7 +131,7 @@ func (m *Model) deriveParams(unit *sointu.Unit, ret []Parameter) []Parameter {
|
||||
portIndex++
|
||||
q = portIndex
|
||||
}
|
||||
ret = append(ret, Parameter{m: m, unit: unit, up: &unitType[i], vtable: &namedParameter{}, port: q})
|
||||
ret = append(ret, Parameter{m: m, unit: unit, up: &unitType.Params[i], vtable: &namedParameter{}, port: q})
|
||||
}
|
||||
if unit.Type == "oscillator" && unit.Parameters["type"] == sointu.Sample {
|
||||
ret = append(ret, Parameter{m: m, unit: unit, vtable: &gmDlsEntryParameter{}})
|
||||
|
||||
Reference in New Issue
Block a user