-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #57 from istnv/V3.0
- Loading branch information
Showing
25 changed files
with
5,177 additions
and
2,943 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 +1,8 @@ | ||
node_modules/ | ||
.eslintrc | ||
/pkg | ||
/pkg.tgz | ||
DEBUG-INSPECT | ||
DEBUG-INSPECTx | ||
DEBUG-PACKAGE | ||
DEBUG-PACKAGED |
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,218 @@ | ||
import { Regex } from '@companion-module/base' | ||
import { pad0 } from './helpers.js' | ||
|
||
export function buildStaticActions(self) { | ||
const sendOSCCmd = async(cmd, arg) => ( | ||
await self.sendOSC(cmd, arg) | ||
) | ||
|
||
let actions = { | ||
label: { | ||
name: 'Set label', | ||
options: [ | ||
{ | ||
type: 'dropdown', | ||
label: 'Type', | ||
id: 'type', | ||
choices: [ | ||
{ id: '/ch/', label: 'Channel 1-16' }, | ||
{ id: '/rtn/', label: 'Fx Return 1-4' }, | ||
{ id: '/fxsend/', label: 'Fx Send 1-4' }, | ||
{ id: '/bus/', label: 'Bus 1-6' }, | ||
], | ||
default: '/ch/', | ||
}, | ||
{ | ||
type: 'textinput', | ||
label: 'Channel, Fx Return, Fx Send or Bus Number', | ||
id: 'num', | ||
default: '1', | ||
regex: Regex.NUMBER, | ||
}, | ||
{ | ||
type: 'textinput', | ||
label: 'Label', | ||
id: 'lab', | ||
default: '', | ||
}, | ||
], | ||
callback: async (action, context) => { | ||
const opt = action.options | ||
const arg = { | ||
type: 's', | ||
value: '' + opt.lab, | ||
} | ||
nVal = opt.type == '/ch/' ? pad0(opt.num) : opt.num | ||
await sendOSCCmd(opt.type + nVal + '/config/name', arg) | ||
}, | ||
}, | ||
|
||
mLabel: { | ||
name: 'Set Main label', | ||
options: [ | ||
{ | ||
type: 'textinput', | ||
label: 'Label', | ||
id: 'lab', | ||
default: '', | ||
}, | ||
], | ||
callback: async (action, context) => { | ||
const opt = action.options | ||
await sendOSCCmd('/lr/config/name', { type: 's', value: '' + opt.lab }) | ||
}, | ||
}, | ||
|
||
usbLabel: { | ||
name: 'Set USB/Aux label', | ||
options: [ | ||
{ | ||
type: 'textinput', | ||
label: 'Label', | ||
id: 'lab', | ||
default: 'USB', | ||
}, | ||
], | ||
callback: async (action, context) => { | ||
const opt = action.options | ||
await sendOSCCmd('/rtn/aux/config/name', { type: 's', value: '' + opt.lab }) | ||
}, | ||
}, | ||
|
||
color: { | ||
name: 'Set color', | ||
options: [ | ||
{ | ||
type: 'dropdown', | ||
label: 'Type', | ||
id: 'type', | ||
choices: [ | ||
{ id: '/ch/', label: 'Channel 1-16' }, | ||
{ id: '/rtn/', label: 'Fx Return 1-4' }, | ||
{ id: '/fxsend/', label: 'Fx Send 1-4' }, | ||
{ id: '/bus/', label: 'Bus 1-6' }, | ||
], | ||
default: '/ch/', | ||
}, | ||
{ | ||
type: 'textinput', | ||
label: 'Channel, Fx Return, Fx Send or Bus Number', | ||
id: 'num', | ||
default: '1', | ||
regex: Regex.NUMBER, | ||
}, | ||
{ | ||
type: 'dropdown', | ||
label: 'color', | ||
id: 'col', | ||
choices: self.COLOR_VALUES, | ||
}, | ||
], | ||
callback: async (action, context) => { | ||
const opt = action.options | ||
const arg = { | ||
type: 'i', | ||
value: parseInt(opt.col), | ||
} | ||
nVal = opt.type == '/ch/' ? pad0(opt.num) : opt.num | ||
await sendOSCCmd(opt.type + nval + '/config/color', arg) | ||
}, | ||
}, | ||
|
||
mColor: { | ||
name: 'Set Main color', | ||
options: [ | ||
{ | ||
type: 'dropdown', | ||
label: 'color', | ||
id: 'col', | ||
choices: self.COLOR_VALUES, | ||
}, | ||
], | ||
callback: async (action, context) => { | ||
const opt = action.options | ||
await sendOSCCmd('/lr/config/color', { type: 'i', value: parseInt(opt.col) }) | ||
}, | ||
}, | ||
|
||
usbColor: { | ||
name: 'Set USB color', | ||
options: [ | ||
{ | ||
type: 'dropdown', | ||
label: 'color', | ||
id: 'col', | ||
choices: self.COLOR_VALUES, | ||
}, | ||
], | ||
callback: async (action, context) => { | ||
const opt = action.options | ||
await sendOSCCmd('/rtn/aux/config/color', { type: 'i', value: parseInt(opt.col) }) | ||
}, | ||
}, | ||
|
||
load_snap: { | ||
name: 'Load Console Snapshot', | ||
options: [ | ||
{ | ||
type: 'textinput', | ||
label: 'Snapshot Number 1-64', | ||
id: 'snap', | ||
default: 1, | ||
min: 1, | ||
max: 64, | ||
regex: Regex.NUMBER, | ||
}, | ||
], | ||
callback: async (action, context) => { | ||
const opt = action.options | ||
await sendOSCCmd('/-snap/load', { type: 'i', value: parseInt(opt.snap) }) | ||
}, | ||
}, | ||
|
||
next_snap: { | ||
name: 'Load Next Console Snapshot', | ||
options: [], | ||
callback: async (action, context) => { | ||
const opt = action.options | ||
await sendOSCCmd('/-snap/load', { type: 'i', value: parseInt(opt.snap) }) | ||
}, | ||
}, | ||
|
||
prev_snap: { | ||
name: 'Load Prior Console Snapshot', | ||
options: [], | ||
callback: async (action, context) => { | ||
const snap = Math.max(--self.currentSnapshot,1) | ||
await sendOSCCmd('/-snap/load', { type: 'i', value: snap }) | ||
}, | ||
}, | ||
|
||
save_snap: { | ||
name: 'Save Current Console Snapshot', | ||
options: [], | ||
callback: async (action, context) => { | ||
const snap = Math.min(--self.currentSnapshot,1) | ||
await sendOSCCmd('/-snap/save', { type: 'i', value: snap } ) | ||
}, | ||
}, | ||
|
||
tape: { | ||
name: 'Tape Operation', | ||
options: [ | ||
{ | ||
type: 'dropdown', | ||
label: 'Function', | ||
id: 'tFunc', | ||
choices: self.TAPE_FUNCTIONS, | ||
}, | ||
], | ||
callback: async (action, context) => { | ||
const opt = action.options | ||
await sendOSCCmd('/-stat/tape/state', { type: 'i', value: parseInt(opt.tFunc) }) | ||
}, | ||
|
||
}, | ||
} | ||
Object.assign(self.actionDefs, actions) | ||
} |
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,25 @@ | ||
import { pad0 } from './helpers.js' | ||
|
||
export function buildSnapshotDefs(self) { | ||
let snapVars = [] | ||
|
||
for (let s = 1; s <= 64; s++) { | ||
let c = pad0(s) | ||
let theID = `/-snap/${c}/name` | ||
let fID = 's_name_' + c | ||
self.fbToStat[fID] = theID | ||
self.xStat[theID] = { | ||
name: '#' + c, | ||
defaultName: '#' + c, | ||
valid: false, | ||
fbID: fID, | ||
polled: 0, | ||
} | ||
snapVars.push({ | ||
name: 'Snapshot ' + c + ' Name', | ||
variableId: fID, | ||
}) | ||
self.snapshot[s] = theID | ||
} | ||
self.variableDefs.push(...snapVars) | ||
} |
Oops, something went wrong.