Skip to content

Commit

Permalink
Fix: v3.9.1 missing feedbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
thedist committed Jan 23, 2025
1 parent ae88a63 commit 1445c8f
Show file tree
Hide file tree
Showing 4 changed files with 172 additions and 6 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ This module now supports Companions HTTP API, providing endpoints that can be us


# Recent Patches
**v3.9.1**
- Fixed missing `General - Output Status` and `General - Output NDI/SRT Status` feedbacks

**v3.9.0**
- Added Mix support for `Transition - Auto/Stinger Transition` action when using a Stinger transition
- Added `Transition - Transition Effect / Duration` Feedback to check what effect (and optionally duration) is set to Transitions 1 to 4
Expand All @@ -57,8 +60,8 @@ This module now supports Companions HTTP API, providing endpoints that can be us
- `Title - Adjust title text visibility`
- `VideoCall - Connect / Reconnect`, `Zoom - Join Meeting`
- Added Feedbacks:
- `vMix - Output Status`
- `vMix - Output NDI/SRT Status`
- `General - Output Status`
- `General - Output NDI/SRT Status`
- Added Variables:
- `fullscreen_X_source` (X = 1 or 2)
- `output_X_source`, `output_X_ndi`, `output_X_srt` (X = 1 to 4)
Expand Down
7 changes: 5 additions & 2 deletions docs/PATCH_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Patch Notes

**v3.9.1**
- Fixed missing `General - Output Status` and `General - Output NDI/SRT Status` feedbacks

**v3.9.0**
- Added Mix support for `Transition - Auto/Stinger Transition` action when using a Stinger transition
- Added `Transition - Transition Effect / Duration` Feedback to check what effect (and optionally duration) is set to Transitions 1 to 4
Expand All @@ -23,8 +26,8 @@
- `Title - Adjust title text visibility`
- `VideoCall - Connect / Reconnect`, `Zoom - Join Meeting`
- Added Feedbacks:
- `vMix - Output Status`
- `vMix - Output NDI/SRT Status`
- `General - Output Status`
- `General - Output NDI/SRT Status`
- Added Variables:
- `fullscreen_X_source` (X = 1 or 2)
- `output_X_source`, `output_X_ndi`, `output_X_srt` (X = 1 to 4)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "studiocoast-vmix",
"version": "3.9.0",
"version": "3.9.1",
"main": "dist/index.js",
"scripts": {
"dev": "yarn build:watch",
Expand Down
162 changes: 161 additions & 1 deletion src/feedbacks/generalFeedbacks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,37 @@ type DynamicOptions = {
value: string
}

interface OutputStatusOptions {
output: 'Fullscreen 1' | 'FUllscreen 2' | 'Output 1' | 'Output 2' | 'Output 3' | 'Output 4' | 'Custom'
custom: string
type: 'Output' | 'Preview' | 'MultiView' | 'MultiView2' | 'Replay' | 'Mix' | 'Input'
mix: string
input: string
}
interface OutputNDISRTOptions {
output: 'Output 1' | 'Output 2' | 'Output 3' | 'Output 4' | 'Custom'
custom: string
type: 'ndi' | 'srt'
}

type StatusOptions = {
status: 'connection' | 'fadeToBlack' | 'recording' | 'external' | 'streaming' | 'multiCorder' | 'fullscreen' | 'playList'
value: '' | '0' | '1' | '2'
}

type DynamicCallback = FeedbackCallback<'dynamic', DynamicOptions>
type OutputStatusCallback = FeedbackCallback<'outputStatus', OutputStatusOptions>
type OutputNDISRTCallback = FeedbackCallback<'outputNDISRT', OutputNDISRTOptions>
type StatusCallback = FeedbackCallback<'status', StatusOptions>

export interface GeneralFeedbacks {
dynamic: VMixFeedback<DynamicCallback>
outputStatus: VMixFeedback<OutputStatusCallback>
outputNDISRT: VMixFeedback<OutputNDISRTCallback>
status: VMixFeedback<StatusCallback>
}

export type GeneralCallbacks = DynamicCallback | StatusCallback
export type GeneralCallbacks = DynamicCallback | OutputStatusCallback | OutputNDISRTCallback | StatusCallback

export const vMixGeneralFeedbacks = (instance: VMixInstance): GeneralFeedbacks => {
return {
Expand Down Expand Up @@ -71,6 +88,149 @@ export const vMixGeneralFeedbacks = (instance: VMixInstance): GeneralFeedbacks =
}
},

outputStatus: {
type: 'boolean',
name: 'General - Output Status',
description: 'Requires vMix 28+',
defaultStyle: {
color: combineRgb(0, 0, 0),
bgcolor: combineRgb(255, 0, 0)
},
options: [
{
type: 'dropdown',
label: 'Output',
id: 'output',
default: 'Fullscreen 1',
choices: [
{ id: 'Fullscreen 1', label: 'Fullscreen 1' },
{ id: 'Fullscreen 2', label: 'Fullscreen 2' },
{ id: 'Output 1', label: 'Output 1' },
{ id: 'Output 2', label: 'Output 2' },
{ id: 'Output 3', label: 'Output 3' },
{ id: 'Output 4', label: 'Output 4' },
{ id: 'Custom', label: 'Use Variable' }
]
},
{
type: 'textinput',
label: 'Output by Variable',
id: 'custom',
default: '',
useVariables: true,
isVisible: (options) => options.output === 'Custom'
},
{
type: 'dropdown',
label: 'Type',
id: 'type',
default: 'Output',
choices: [
{ id: 'Output', label: 'Output' },
{ id: 'Preview', label: 'Preview' },
{ id: 'MultiView', label: 'MultiView' },
{ id: 'MultiView2', label: 'MultiView2' },
{ id: 'Replay', label: 'Replay' },
{ id: 'Mix', label: 'Mix' },
{ id: 'Input', label: 'Input' }
]
},
{
type: 'textinput',
label: 'Mix (1 to 16)',
id: 'mix',
default: '',
useVariables: true,
isVisible: (options) => options.type === 'Mix'
},
{
type: 'textinput',
label: 'Input',
id: 'input',
default: '',
useVariables: true,
isVisible: (options) => options.type === 'Input'
}
],
callback: async (feedback, context) => {
const outputSelect: any =
feedback.options.output === 'Custom' ? (await instance.parseOption(feedback.options.custom, context))[instance.buttonShift.state] : feedback.options.output
if (!['Fullscreen 1', 'Fullscreen 2', 'Output 1', 'Output 2', 'Output 3', 'Output 4'].includes(outputSelect)) return false
const outputType = outputSelect.startsWith('Fullscreen') ? 'fullscreen' : 'output'
const outputNumber = parseInt(outputSelect[outputSelect.length - 1])
if (isNaN(outputNumber)) return false
const output = instance.data.outputs.find((x) => {
return x.type === outputType && x.number === outputNumber
})
if (!output) return false
if (feedback.options.type === 'Mix' && output.source === 'Mix') {
const mix = (await instance.parseOption(feedback.options.mix, context))[instance.buttonShift.state]
return output.mix + 1 === parseInt(mix, 10)
} else if (feedback.options.type === 'Input' && output.source === 'Input') {
const inputSelect = (await instance.parseOption(feedback.options.input, context))[instance.buttonShift.state]
const input = await instance.data.getInput(inputSelect)
return input ? input.number === output.input : false
} else {
return output.source === feedback.options.type
}
}
},

outputNDISRT: {
type: 'boolean',
name: 'General - Output NDI/SRT Status',
description: 'Requires vMix 28+',
defaultStyle: {
color: combineRgb(0, 0, 0),
bgcolor: combineRgb(255, 0, 0)
},
options: [
{
type: 'dropdown',
label: 'Output',
id: 'output',
default: 'Output 1',
choices: [
{ id: 'Output 1', label: 'Output 1' },
{ id: 'Output 2', label: 'Output 2' },
{ id: 'Output 3', label: 'Output 3' },
{ id: 'Output 4', label: 'Output 4' },
{ id: 'Custom', label: 'Use Variable' }
]
},
{
type: 'textinput',
label: 'Output by Variable',
id: 'custom',
default: '',
useVariables: true,
isVisible: (options) => options.output === 'Custom'
},
{
type: 'dropdown',
label: 'Type',
id: 'type',
default: 'ndi',
choices: [
{ id: 'ndi', label: 'NDI' },
{ id: 'srt', label: 'SRT' }
]
}
],
callback: async (feedback, context) => {
const outputSelect: any =
feedback.options.output === 'Custom' ? (await instance.parseOption(feedback.options.custom, context))[instance.buttonShift.state] : feedback.options.output
if (!['Output 1', 'Output 2', 'Output 3', 'Output 4'].includes(outputSelect)) return false
const outputNumber = parseInt(outputSelect[outputSelect.length - 1])
if (isNaN(outputNumber)) return false
const output = instance.data.outputs.find((x) => {
return x.type === 'output' && x.number === outputNumber
})
if (!output) return false
return output[feedback.options.type]
}
},

status: {
type: 'boolean',
name: 'General - vMix Status',
Expand Down

0 comments on commit 1445c8f

Please sign in to comment.