From 3f6a46ae7eece00e5021869be5b05ba82a11188e Mon Sep 17 00:00:00 2001 From: Johan Nyman Date: Wed, 25 Mar 2020 08:53:08 +0100 Subject: [PATCH] fix: put clear-on-startup behind a flag in config --- src/config.ts | 3 +++ src/imageProvider.ts | 14 ++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/config.ts b/src/config.ts index 09057a0..ba1bd48 100644 --- a/src/config.ts +++ b/src/config.ts @@ -21,6 +21,9 @@ export interface IConfig { /** Which channels/layers to put on the grid by default */ defaultRegions?: DefaultRegion[] + + /** If true, sends clear commands on startup */ + clearOnStartup?: boolean } export interface ChannelSetup { /** CasparCG channel number (starting on 1) */ diff --git a/src/imageProvider.ts b/src/imageProvider.ts index 02d4acf..44e93b5 100644 --- a/src/imageProvider.ts +++ b/src/imageProvider.ts @@ -101,12 +101,14 @@ export class ImageProvider { } } - // Reset casparCG channels on startup: - await Promise.all( - _.map(this.channelSetup, channel => { - return this.casparcg.clear(channel.channel) - }) - ) + if (config.clearOnStartup) { + // Reset casparCG channels on startup: + await Promise.all( + _.map(this.channelSetup, channel => { + return this.casparcg.clear(channel.channel) + }) + ) + } await this.initStreamsFromConfig() } reset () {