Skip to content

Commit 0a192c3

Browse files
authored
Merge pull request #35 from Sofie-Automation/feat/tally
2 parents 61b1571 + 6f693b0 commit 0a192c3

File tree

4 files changed

+349
-57
lines changed

4 files changed

+349
-57
lines changed

packages/input-gateway/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@
7474
"dependencies": {
7575
"@esm2cjs/p-queue": "7.3.0",
7676
"@sofie-automation/input-manager": "0.4.0",
77-
"@sofie-automation/server-core-integration": "1.53.0-nightly-release53-20250702-092104-8eba5bc.0",
78-
"@sofie-automation/shared-lib": "1.53.0-nightly-release53-20250702-092104-8eba5bc.0",
77+
"@sofie-automation/server-core-integration": "1.53.0-nightly-release53-20251022-140953-e123abc.0",
78+
"@sofie-automation/shared-lib": "1.53.0-nightly-release53-20251022-140953-e123abc.0",
7979
"debug": "^4.3.4",
8080
"eventemitter3": "5.0.1",
8181
"p-all": "5.0.0",

packages/input-gateway/src/inputManagerHandler.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -647,8 +647,7 @@ export class InputManagerHandler {
647647
Tally.PRESENT |
648648
previewedAdlibs.reduce(
649649
(acc, adlib) =>
650-
// @ts-expect-error: needs new build of core-integration, but we're on release50, which causes some incompatibilities, even though things just work...
651-
acc | (adlib.isCurrent ? Tally.ACTIVE : Tally.NONE) | (adlib.isNext ? Tally.NEXT : Tally.NONE),
650+
acc | (adlib.isActive ? Tally.ACTIVE : Tally.NONE) | (adlib.isNext ? Tally.NEXT : Tally.NONE),
652651
Tally.NONE
653652
)
654653
contentLayerLongName = previewedAdlibs[0].sourceLayerName?.name

packages/input-manager/src/integrations/streamdeck/device.ts

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -272,35 +272,33 @@ export class StreamDeckDeviceHandler {
272272

273273
// Find the first match
274274
for (const name of styleClassNames) {
275-
let stylePreset = Object.values<StreamdeckStylePreset>(this.config.stylePresets).find(
276-
(preset) => preset.id === name
277-
)
275+
let stylePreset: StreamdeckStylePreset | undefined
278276
if (feedback.tally) {
279277
if (feedback.tally & Tally.ACTIVE) {
280-
stylePreset =
281-
stylePreset ||
282-
Object.values<StreamdeckStylePreset>(this.config.stylePresets).find(
283-
(preset) => preset.id === `${name}:active`
284-
)
285-
} else if (feedback.tally & Tally.NEXT) {
286-
stylePreset =
287-
stylePreset ||
288-
Object.values<StreamdeckStylePreset>(this.config.stylePresets).find(
289-
(preset) => preset.id === `${name}:next`
290-
)
291-
} else if (feedback.tally & Tally.OTHER) {
292-
stylePreset =
293-
stylePreset ||
294-
Object.values<StreamdeckStylePreset>(this.config.stylePresets).find(
295-
(preset) => preset.id === `${name}:other`
296-
)
297-
} else if (feedback.tally & Tally.PRESENT) {
298-
stylePreset =
299-
stylePreset ||
300-
Object.values<StreamdeckStylePreset>(this.config.stylePresets).find(
301-
(preset) => preset.id === `${name}:present`
302-
)
278+
stylePreset = Object.values<StreamdeckStylePreset>(this.config.stylePresets).find(
279+
(preset) => preset.id === `${name}:active`
280+
)
281+
}
282+
if (feedback.tally & Tally.NEXT && !stylePreset) {
283+
stylePreset = Object.values<StreamdeckStylePreset>(this.config.stylePresets).find(
284+
(preset) => preset.id === `${name}:next`
285+
)
286+
}
287+
if (feedback.tally & Tally.OTHER && !stylePreset) {
288+
stylePreset = Object.values<StreamdeckStylePreset>(this.config.stylePresets).find(
289+
(preset) => preset.id === `${name}:other`
290+
)
303291
}
292+
if (feedback.tally & Tally.PRESENT && !stylePreset) {
293+
stylePreset = Object.values<StreamdeckStylePreset>(this.config.stylePresets).find(
294+
(preset) => preset.id === `${name}:present`
295+
)
296+
}
297+
}
298+
if (!stylePreset) {
299+
stylePreset = Object.values<StreamdeckStylePreset>(this.config.stylePresets).find(
300+
(preset) => preset.id === name
301+
)
304302
}
305303

306304
if (stylePreset) {

0 commit comments

Comments
 (0)