-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Major: Update for Companion v3 (#12)
* Rewrite for Companion v3 * wip: upgrades * Fix: Upgrades now functional * Fix: proper operation mode handling * Update README.md
- Loading branch information
1 parent
8c9db4d
commit 14071ad
Showing
15 changed files
with
2,938 additions
and
322 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
node_modules/ | ||
package-lock.json | ||
.DS_Store | ||
/pkg | ||
/pkg.tgz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,80 +1,75 @@ | ||
exports.getActions = function () { | ||
export function getActions() { | ||
return { | ||
changeNDISource: { | ||
label: 'Change Decode Source', | ||
changeDecodeSource: { | ||
name: 'Change Decode Source', | ||
options: [ | ||
{ | ||
type: 'dropdown', | ||
label: 'Source', | ||
id: 'source', | ||
choices: | ||
this.api.sourceList?.length > 1 | ||
? this.api.sourceList | ||
: [{ id: 'No sources found', label: 'No sources found' }], | ||
default: this.api.sourceList?.length > 1 ? this.api.sourceList[0].id : 'No sources found', | ||
choices: this.device.list, | ||
default: 'None', | ||
allowCustom: true, | ||
}, | ||
], | ||
callback: (action) => { | ||
this.sendCommand('connectTo', 'POST', { sourceName: action.options.source }) | ||
}, | ||
}, | ||
changeNDISourceIP: { | ||
label: 'Change Decode Source by IP', | ||
cycleSource: { | ||
name: 'Jump to Next/Previous Decode Source', | ||
description: 'Moves between available NDI decode sources', | ||
options: [ | ||
{ | ||
type: 'textinput', | ||
label: 'NDI Source Name', | ||
id: 'ndiSource', | ||
width: 12, | ||
regex: this.REGEX_TEXT, | ||
}, | ||
{ | ||
type: 'textinput', | ||
label: 'NDI Source IP', | ||
id: 'ndiSourceIp', | ||
width: 8, | ||
default: '127.0.0.1', | ||
regex: this.REGEX_IP, | ||
}, | ||
{ | ||
type: 'number', | ||
label: 'NDI Source Port', | ||
id: 'ndiSourcePort', | ||
width: 3, | ||
regex: this.REGEX_PORT, | ||
min: 1, | ||
max: 65535, | ||
default: 5961, | ||
type: 'dropdown', | ||
label: 'Action', | ||
id: 'jump', | ||
choices: [ | ||
{ id: 'next', label: 'Next' }, | ||
{ id: 'previous', label: 'Previous' }, | ||
], | ||
default: 'next', | ||
}, | ||
], | ||
callback: async (action) => { | ||
let modifier = action.options.jump === 'next' ? 1 : -1 | ||
let current = this.device.decodeSource | ||
let newIndex = 0 | ||
if (current) { | ||
let currentIndex = await this.device.list.findIndex((x) => x.id === current) | ||
if (currentIndex > -1) { | ||
newIndex = currentIndex + modifier | ||
if (newIndex > -1) { | ||
let source = this.device.list[newIndex] | ||
if (source) { | ||
this.sendCommand('connectTo', 'POST', { sourceName: this.device.list[newIndex].id }) | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
}, | ||
refreshNDISourceList: { | ||
label: 'Refresh NDI Source List', | ||
refreshSourceList: { | ||
name: 'Refresh NDI Source List', | ||
options: [], | ||
callback: () => { | ||
this.sendCommand('refresh', 'GET') | ||
this.sendCommand('List', 'GET') | ||
}, | ||
}, | ||
reboot: { | ||
name: 'Reboot Device', | ||
options: [], | ||
callback: () => { | ||
this.sendCommand('reboot', 'GET') | ||
}, | ||
}, | ||
restart: { | ||
name: 'Restart Video', | ||
options: [], | ||
callback: () => { | ||
this.sendCommand('restart', 'GET') | ||
}, | ||
}, | ||
} | ||
} | ||
|
||
exports.executeAction = function (action) { | ||
if (action.action === 'changeNDISource') { | ||
if (action.options.source != undefined && action.options.source != 'No sources found') { | ||
let urlSplit = this.api.sourceList[action.options.source].split(':') | ||
let ip = urlSplit[0] | ||
let port = urlSplit[1] | ||
let name = action.options.source | ||
this.api.setNDIDecodeSource(ip, port, name) | ||
} else { | ||
this.log( | ||
'error', | ||
'Unable to find the configured NDI source. Please check the NDI source info in the action configuration' | ||
) | ||
} | ||
} else if (action.action === 'changeNDISourceIP') { | ||
if (action.options.ndiSource && action.options.ndiSourceIp && action.options.ndiSourcePort) { | ||
this.api.setNDIDecodeSource(action.options.ndiSourceIp, action.options.ndiSourcePort, action.options.ndiSource) | ||
} else { | ||
this.log( | ||
'error', | ||
'Unable to find the configured NDI source. Please check the NDI source info in the action configuration' | ||
) | ||
} | ||
} else if (action.action === 'refreshNDISourceList') { | ||
this.api.getSourceList() | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
## BirdDog Converters | ||
|
||
This module allows you to control BirdDog NDI encoders and decoders. | ||
|
||
### Requirements | ||
|
||
- BirdDog converter running the latest NDI 5 firmware version | ||
|
||
### Configuration | ||
|
||
- Enter the IP address or hostname of the BirdDog device in the module settings | ||
|
||
### Available actions | ||
|
||
- Change Decode Source | ||
- _Note: when using custom sources, you must include the full name (ex. `PTZ-1 (CAM)` instead of `PTZ-1`)_ | ||
- Refresh NDI Source List | ||
- Jump to Next/Previous Decode Source | ||
- Reboot Device | ||
- Restart Video System | ||
|
||
### Available variables | ||
|
||
- decode_source | ||
- current_mode | ||
- video_format | ||
- video_resolution | ||
- video_framerate | ||
- source_status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"id": "birddog-converters", | ||
"name": "birddog-converters", | ||
"shortname": "BirdDog NDI", | ||
"description": "BirdDog Converters module for Companion", | ||
"version": "2.0.0", | ||
"license": "MIT", | ||
"repository": "git+https://github.com/bitfocus/companion-module-birddog-studio.git", | ||
"bugs": "https://github.com/bitfocus/companion-module-birddog-studio/issues", | ||
"maintainers": [ | ||
{ | ||
"name": "Bryce Seifert", | ||
"email": "bryceapps@icloud.com" | ||
} | ||
], | ||
"legacyIds": ["birddog-studio"], | ||
"runtime": { | ||
"type": "node18", | ||
"api": "nodejs-ipc", | ||
"apiVersion": "0.0.0", | ||
"entrypoint": "../index.js" | ||
}, | ||
"manufacturer": "BirdDog", | ||
"products": ["Converters"], | ||
"keywords": ["NDI", "Video"] | ||
} |
Oops, something went wrong.