Fixing ziffers default sync

This commit is contained in:
2023-12-18 23:03:15 +02:00
parent 331ddab544
commit e557e5565b

View File

@ -408,8 +408,7 @@ export class Player extends AbstractEvent {
} }
sync(value: string | Function, manualSync: boolean = true) { sync(value: string | Function, manualSync: boolean = true) {
if(typeof value === "string" && manualSync) {
if(typeof value === "string") {
if(manualSync) { if(manualSync) {
const cueTime = this.app.api.cueTimes[value]; const cueTime = this.app.api.cueTimes[value];
if(cueTime) { if(cueTime) {
@ -420,11 +419,11 @@ export class Player extends AbstractEvent {
} }
return this; return this;
} }
if (this.atTheBeginning() && this.notStarted()) { if (this.atTheBeginning() && this.notStarted()) {
const origin = this.app.clock.pulses_since_origin; const origin = this.app.clock.pulses_since_origin;
if (origin > 0) { if (origin > 0) {
const syncPattern = this.app.api.patternCache.get(value.name) as Player; const syncName = typeof value === "function" ? value.name : value;
const syncPattern = this.app.api.patternCache.get(syncName) as Player;
if (syncPattern) { if (syncPattern) {
const syncPatternDuration = syncPattern.ziffers.duration; const syncPatternDuration = syncPattern.ziffers.duration;
const syncPatternStart = syncPattern.startCallTime; const syncPatternStart = syncPattern.startCallTime;