mirror of
https://github.com/vsariola/sointu.git
synced 2025-05-27 10:50:23 -04:00
refactor(sointu): move engineeringTime helper function to the file where it is actually used
This commit is contained in:
parent
a8f8911f03
commit
eda48491e2
9
patch.go
9
patch.go
@ -195,3 +195,12 @@ func (p Patch) ParamHintString(instrIndex, unitIndex int, param string) string {
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func engineeringTime(sec float64) string {
|
||||
if sec < 1e-3 {
|
||||
return fmt.Sprintf("%.2f us", sec*1e6)
|
||||
} else if sec < 1 {
|
||||
return fmt.Sprintf("%.2f ms", sec*1e3)
|
||||
}
|
||||
return fmt.Sprintf("%.2f s", sec)
|
||||
}
|
||||
|
10
unittype.go
10
unittype.go
@ -1,7 +1,6 @@
|
||||
package sointu
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math"
|
||||
)
|
||||
|
||||
@ -14,15 +13,6 @@ type UnitParameter struct {
|
||||
CanModulate bool // if this parameter can be modulated i.e. has a port number in "send" unit
|
||||
}
|
||||
|
||||
func engineeringTime(sec float64) string {
|
||||
if sec < 1e-3 {
|
||||
return fmt.Sprintf("%.2f us", sec*1e6)
|
||||
} else if sec < 1 {
|
||||
return fmt.Sprintf("%.2f ms", sec*1e3)
|
||||
}
|
||||
return fmt.Sprintf("%.2f s", sec)
|
||||
}
|
||||
|
||||
// UnitTypes documents all the available unit types and if they support stereo variant
|
||||
// and what parameters they take.
|
||||
var UnitTypes = map[string]([]UnitParameter){
|
||||
|
Loading…
Reference in New Issue
Block a user