Skip to content

Commit

Permalink
Add default feedback for presentation_state preset with red background
Browse files Browse the repository at this point in the history
Fixes #67
  • Loading branch information
bensteUEM committed Sep 13, 2024
1 parent 0cd38da commit 079c9ba
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 4 deletions.
7 changes: 7 additions & 0 deletions src/feedbacks.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { presentation_states, video_states, livevideo_states, comparators } from './choices.js'
import { get_images } from './images.js'
import { combineRgb } from '@companion-module/base'

export function getFeedbackDefinitions(self, osc) {
const feedbacks = {
Expand Down Expand Up @@ -63,6 +64,12 @@ export function getFeedbackDefinitions(self, osc) {
type: 'boolean', // Feedbacks can either a simple boolean, or can be an 'advanced' style change (until recently, all feedbacks were 'advanced')
name: 'Presentation State',
description: 'custom feedback based on presentation state',
defaultStyle: {
// The default style change for a boolean feedback
// The user will be able to customise these values as well as the fields that will be changed
bgcolor: combineRgb(255, 0, 0),
color: combineRgb(255, 255, 255),
},
// options is how the user can choose the condition the feedback activates for
options: [
{
Expand Down
52 changes: 48 additions & 4 deletions src/presets.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,18 @@ export function getPresetDefinitions() {
up: [],
},
],
feedbacks: [],
feedbacks: [
{
feedbackId: 'presentation_state',
options: {
presentation_state: '0',
},
style: {
bgcolor: combineRgb(255, 0, 0),
color: combineRgb(255, 255, 255),
},
},
],
}

const state_background = {
Expand Down Expand Up @@ -420,7 +431,18 @@ export function getPresetDefinitions() {
up: [],
},
],
feedbacks: [],
feedbacks: [
{
feedbackId: 'presentation_state',
options: {
presentation_state: '1',
},
style: {
bgcolor: combineRgb(255, 0, 0),
color: combineRgb(255, 255, 255),
},
},
],
}

const state_page = {
Expand Down Expand Up @@ -450,7 +472,18 @@ export function getPresetDefinitions() {
up: [],
},
],
feedbacks: [],
feedbacks: [
{
feedbackId: 'presentation_state',
options: {
presentation_state: '2',
},
style: {
bgcolor: combineRgb(255, 0, 0),
color: combineRgb(255, 255, 255),
},
},
],
}

const state_logo = {
Expand Down Expand Up @@ -480,7 +513,18 @@ export function getPresetDefinitions() {
up: [],
},
],
feedbacks: [],
feedbacks: [
{
feedbackId: 'presentation_state',
options: {
presentation_state: '3',
},
style: {
bgcolor: combineRgb(255, 0, 0),
color: combineRgb(255, 255, 255),
},
},
],
}
result['state_current'] = state_current
result['state_black'] = state_black
Expand Down

0 comments on commit 079c9ba

Please sign in to comment.