mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-27 13:38:40 +00:00
add scheduler.now to get phase starting from 0
This commit is contained in:
parent
8c6da1a658
commit
0792d0d59d
@ -49,6 +49,9 @@ export class Cyclist {
|
|||||||
getPhase() {
|
getPhase() {
|
||||||
return this.getTime() - this.origin - this.latency;
|
return this.getTime() - this.origin - this.latency;
|
||||||
}
|
}
|
||||||
|
now() {
|
||||||
|
return this.getTime() - this.origin + this.clock.minLatency;
|
||||||
|
}
|
||||||
setStarted(v) {
|
setStarted(v) {
|
||||||
this.started = v;
|
this.started = v;
|
||||||
this.onToggle?.(v);
|
this.onToggle?.(v);
|
||||||
|
|||||||
@ -44,6 +44,6 @@ function createClock(
|
|||||||
};
|
};
|
||||||
const getPhase = () => phase;
|
const getPhase = () => phase;
|
||||||
// setCallback
|
// setCallback
|
||||||
return { setDuration, start, stop, pause, duration, getPhase };
|
return { setDuration, start, stop, pause, duration, getPhase, minLatency };
|
||||||
}
|
}
|
||||||
export default createClock;
|
export default createClock;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user