Skip to content

Commit 8551415

Browse files
committed
added EQ enable/disable command for channel, bus, aux, matrix and main
1 parent cda8135 commit 8551415

File tree

7 files changed

+75
-0
lines changed

7 files changed

+75
-0
lines changed

src/actions/common.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ export enum CommonActions {
5454
// Delay
5555
SetDelay = 'set-delay',
5656
SetDelayAmount = 'set-delay-amount',
57+
// EQ
58+
SetEqOn = 'set-eq-on',
5759

5860
//////////// SEND
5961
SetSendMute = 'set-send-mute',
@@ -640,6 +642,27 @@ export function createCommonActions(self: InstanceBaseExt<WingConfig>): Companio
640642
}
641643
},
642644
},
645+
[CommonActions.SetEqOn]: {
646+
name: 'Set EQ On',
647+
description: 'Enable, disable or toggle the on-state of an EQ on a channel, bus, aux, matrix or main.',
648+
options: [GetDropdown('Selection', 'sel', allChannels), GetOnOffToggleDropdown('enable', 'Enable')],
649+
callback: async (event) => {
650+
const sel = event.options.sel as string
651+
const cmd = ActionUtil.getEqEnableCommand(sel, getNodeNumber(event, 'sel'))
652+
const val = ActionUtil.getNumber(event, 'enable')
653+
const currentVal = StateUtil.getBooleanFromState(cmd, state)
654+
if (val < 2) {
655+
send(cmd, val)
656+
} else {
657+
send(cmd, Number(!currentVal))
658+
}
659+
},
660+
subscribe: (event) => {
661+
const sel = event.options.sel as string
662+
const cmd = ActionUtil.getSoloCommand(sel, getNodeNumber(event, 'sel'))
663+
ensureLoaded(cmd)
664+
},
665+
},
643666

644667
////////////////////////////////////////////////////////////////
645668
// Send Fader

src/actions/utils.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,3 +316,19 @@ export function getTalkbackAssignCommand(talkback: string, destination: string):
316316
}
317317
return cmd
318318
}
319+
320+
export function getEqEnableCommand(sel: string, val: number): string {
321+
let cmd = ''
322+
if (sel.startsWith('/ch')) {
323+
cmd = ChannelCommands.EqOn(val)
324+
} else if (sel.startsWith('/aux')) {
325+
cmd = AuxCommands.EqOn(val)
326+
} else if (sel.startsWith('/bus')) {
327+
cmd = BusCommands.EqOn(val)
328+
} else if (sel.startsWith('/mtx')) {
329+
cmd = MatrixCommands.EqOn(val)
330+
} else if (sel.startsWith('/main')) {
331+
cmd = MainCommands.EqOn(val)
332+
}
333+
return cmd
334+
}

src/commands/auxes.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,12 @@ export namespace AuxCommands {
143143
export function SendPan(aux: number, send: number): string {
144144
return `${SendNode(aux, send)}/pan`
145145
}
146+
147+
export function EqNode(aux: number): string {
148+
return `${Node(aux)}/eq`
149+
}
150+
151+
export function EqOn(aux: number): string {
152+
return `${EqNode(aux)}/on`
153+
}
146154
}

src/commands/bus.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,12 @@ export namespace BusCommands {
127127
export function DelayAmount(bus: number): string {
128128
return `${DelayNode(bus)}/dly`
129129
}
130+
131+
export function EqNode(bus: number): string {
132+
return `${Node(bus)}/eq`
133+
}
134+
135+
export function EqOn(bus: number): string {
136+
return `${EqNode(bus)}/on`
137+
}
130138
}

src/commands/channel.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,10 @@ export namespace ChannelCommands {
224224
return `${Node(channel)}/eq`
225225
}
226226

227+
export function EqOn(channel: number): string {
228+
return `${EqNode(channel)}/on`
229+
}
230+
227231
export function EqModel(channel: number): string {
228232
return `${EqNode(channel)}/mdl`
229233
}

src/commands/main.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,12 @@ export namespace MainCommands {
103103
export function DelayAmount(main: number): string {
104104
return `${DelayNode(main)}/dly`
105105
}
106+
107+
export function EqNode(main: number): string {
108+
return `${Node(main)}/eq`
109+
}
110+
111+
export function EqOn(main: number): string {
112+
return `${EqNode(main)}/on`
113+
}
106114
}

src/commands/matrix.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,12 @@ export namespace MatrixCommands {
115115
export function DelayAmount(matrix: number): string {
116116
return `${DelayNode(matrix)}/dly`
117117
}
118+
119+
export function EqNode(matrix: number): string {
120+
return `${Node(matrix)}/eq`
121+
}
122+
123+
export function EqOn(matrix: number): string {
124+
return `${EqNode(matrix)}/on`
125+
}
118126
}

0 commit comments

Comments
 (0)