mirror of
https://github.com/vsariola/sointu.git
synced 2025-07-17 20:44:29 -04:00
refactor: move UnitNames to top level package
This commit is contained in:
parent
b6ec5d1a04
commit
beb06727b0
13
patch.go
13
patch.go
@ -4,6 +4,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"math"
|
||||
"sort"
|
||||
)
|
||||
|
||||
type (
|
||||
@ -178,6 +179,18 @@ const (
|
||||
Sample = iota
|
||||
)
|
||||
|
||||
// UnitNames is a list of all the names of units, sorted
|
||||
// alphabetically.
|
||||
var UnitNames []string
|
||||
|
||||
func init() {
|
||||
UnitNames = make([]string, 0, len(UnitTypes))
|
||||
for k := range UnitTypes {
|
||||
UnitNames = append(UnitNames, k)
|
||||
}
|
||||
sort.Strings(UnitNames)
|
||||
}
|
||||
|
||||
// Ports is static map allowing quickly finding the parameters of a unit that
|
||||
// can be modulated. This is populated based on the UnitTypes list during
|
||||
// init(). Thus, should be immutable, but Go not supporting that, then this will
|
||||
|
Reference in New Issue
Block a user