mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-22 19:18:31 +00:00
helper functions
This commit is contained in:
parent
47717e872b
commit
c38e4f7206
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
export class Hap {
|
export class Hap {
|
||||||
/*
|
/*
|
||||||
Event class, representing a value active during the timespan
|
Event class, representing a value active during the timespan
|
||||||
@ -77,6 +76,10 @@ export class Hap {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
showWhole() {
|
||||||
|
return `${this.whole == undefined ? '~' : this.whole.show()}: ${this.value}`;
|
||||||
|
}
|
||||||
|
|
||||||
combineContext(b) {
|
combineContext(b) {
|
||||||
const a = this;
|
const a = this;
|
||||||
return { ...a.context, ...b.context, locations: (a.context.locations || []).concat(b.context.locations || []) };
|
return { ...a.context, ...b.context, locations: (a.context.locations || []).concat(b.context.locations || []) };
|
||||||
|
|||||||
@ -28,6 +28,10 @@ export class TimeSpan {
|
|||||||
return spans;
|
return spans;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get duration() {
|
||||||
|
return this.end.sub(this.begin);
|
||||||
|
}
|
||||||
|
|
||||||
cycleArc() {
|
cycleArc() {
|
||||||
// Shifts a timespan to one of equal duration that starts within cycle zero.
|
// Shifts a timespan to one of equal duration that starts within cycle zero.
|
||||||
// (Note that the output timespan probably does not start *at* Time 0 --
|
// (Note that the output timespan probably does not start *at* Time 0 --
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user