mirror of
https://github.com/vsariola/sointu.git
synced 2026-08-16 22:56:58 -04:00
refactor: put all info about different unit types into UnitTypes map
This commit is contained in:
+2
-2
@@ -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