mirror of
https://github.com/vsariola/sointu.git
synced 2025-06-04 01:28:45 -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 ""
|
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
|
package sointu
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"math"
|
"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
|
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
|
// UnitTypes documents all the available unit types and if they support stereo variant
|
||||||
// and what parameters they take.
|
// and what parameters they take.
|
||||||
var UnitTypes = map[string]([]UnitParameter){
|
var UnitTypes = map[string]([]UnitParameter){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user