Rest of the uint64 stuff
Signed-off-by: Martyn Ranyard <m@rtyn.berlin>
This commit is contained in:
parent
4d72b04cc1
commit
ffec6c8260
|
@ -149,10 +149,10 @@ func main() {
|
||||||
}
|
}
|
||||||
if overrideEffect.Effect == "queue" {
|
if overrideEffect.Effect == "queue" {
|
||||||
if currentEffect.Duration > 0 {
|
if currentEffect.Duration > 0 {
|
||||||
if currentEffect.Duration%uint16(msDelay) != 0 {
|
if currentEffect.Duration%uint64(msDelay) != 0 {
|
||||||
currentEffect.Duration = uint16(currentEffect.Duration/uint16(msDelay)) * uint16(msDelay)
|
currentEffect.Duration = uint64(currentEffect.Duration/uint64(msDelay)) * uint64(msDelay)
|
||||||
}
|
}
|
||||||
currentEffect.Duration -= uint16(msDelay)
|
currentEffect.Duration -= uint64(msDelay)
|
||||||
} else {
|
} else {
|
||||||
if len(globalEffectChannel) > 0 {
|
if len(globalEffectChannel) > 0 {
|
||||||
previousEffect.Effect = "queue"
|
previousEffect.Effect = "queue"
|
||||||
|
|
|
@ -40,7 +40,7 @@ func PatternHandler(response http.ResponseWriter, request *http.Request) {
|
||||||
_, found := vars["duration"]
|
_, found := vars["duration"]
|
||||||
if found {
|
if found {
|
||||||
i, _ := strconv.ParseUint(vars["duration"], 10, 64)
|
i, _ := strconv.ParseUint(vars["duration"], 10, 64)
|
||||||
e.Duration = uint16(i)
|
e.Duration = i
|
||||||
} else {
|
} else {
|
||||||
e.Duration = 5000
|
e.Duration = 5000
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ func ColourHandler(response http.ResponseWriter, request *http.Request) {
|
||||||
_, found := vars["duration"]
|
_, found := vars["duration"]
|
||||||
if found {
|
if found {
|
||||||
i, _ := strconv.ParseUint(vars["duration"], 10, 64)
|
i, _ := strconv.ParseUint(vars["duration"], 10, 64)
|
||||||
e.Duration = uint16(i)
|
e.Duration = i
|
||||||
} else {
|
} else {
|
||||||
e.Duration = 5000
|
e.Duration = 5000
|
||||||
}
|
}
|
||||||
|
@ -97,8 +97,8 @@ func FadeHandler(response http.ResponseWriter, request *http.Request) {
|
||||||
e.Effect = "fade"
|
e.Effect = "fade"
|
||||||
_, found := vars["duration"]
|
_, found := vars["duration"]
|
||||||
if found {
|
if found {
|
||||||
i, _ := strconv.Atoi(vars["duration"])
|
i, _ := strconv.ParseUint(vars["duration"], 10, 64)
|
||||||
e.Duration = uint16(i)
|
e.Duration = i
|
||||||
} else {
|
} else {
|
||||||
e.Duration = 5000
|
e.Duration = 5000
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue