Skip to content

Commit 65e56e9

Browse files
committed
add: presets for sends on fade buttons
1 parent a4a9c0f commit 65e56e9

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

src/presets.ts

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,32 @@ export function GetPresets(_instance: InstanceBaseExt<WingConfig>): CompanionPre
1717
presets[`ch${i}-mute-button`] = getMutePreset('ch', i)
1818
presets[`ch${i}-solo-button`] = getSoloPreset('ch', i)
1919
presets[`ch${i}-boost-and-center-button`] = getBoostAndCenterPreset('ch', i)
20+
presets[`ch${i}-sof-button`] = getSofPresets('ch', i)
2021
}
2122

2223
for (let i = 1; i <= model.auxes; i++) {
2324
presets[`aux${i}-mute-button`] = getMutePreset('aux', i)
2425
presets[`aux${i}-solo-button`] = getSoloPreset('aux', i)
2526
presets[`aux${i}-boost-and-center-button`] = getBoostAndCenterPreset('aux', i)
27+
presets[`aux${i}-sof-button`] = getSofPresets('aux', i)
2628
}
2729

2830
for (let i = 1; i <= model.busses; i++) {
2931
presets[`bus${i}-mute-button`] = getMutePreset('bus', i)
3032
presets[`bus${i}-solo-button`] = getSoloPreset('bus', i)
33+
presets[`bus${i}-sof-button`] = getSofPresets('bus', i)
3134
}
3235

3336
for (let i = 1; i <= model.matrices; i++) {
3437
presets[`mtx${i}-mute-button`] = getMutePreset('mtx', i)
3538
presets[`mtx${i}-solo-button`] = getSoloPreset('mtx', i)
39+
presets[`mtx${i}-sof-button`] = getSofPresets('mtx', i)
3640
}
3741

3842
for (let i = 1; i <= model.mains; i++) {
3943
presets[`main${i}-mute-button`] = getMutePreset('main', i)
4044
presets[`main${i}-solo-button`] = getSoloPreset('main', i)
45+
presets[`main${i}-sof-button`] = getSofPresets('main', i)
4146
}
4247

4348
for (let i = 1; i <= model.dcas; i++) {
@@ -324,3 +329,45 @@ function getLightPresetDark(): CompanionButtonPresetDefinition {
324329
feedbacks: [],
325330
}
326331
}
332+
333+
function getSofPresets(base: string, val: number): CompanionButtonPresetDefinition {
334+
const path = `/${base}/${val}`
335+
const name = `${base.toUpperCase()}${val}`
336+
return {
337+
name: 'Sends on Fader',
338+
category: 'Sends on Fader',
339+
type: 'button',
340+
style: {
341+
text: `let name = 'SOF'const realName = $(wing:${base}${val}_name)let hasNoName = realName === '' || isreturn hasNoName ? 'SOF ${name}' : \`SOF \${realName}\``,
342+
textExpression: true,
343+
size: 'auto',
344+
color: combineRgb(255, 255, 255),
345+
bgcolor: combineRgb(0, 0, 0),
346+
},
347+
steps: [
348+
{
349+
down: [
350+
{
351+
actionId: OtherActionId.SetSOF,
352+
options: {
353+
toggle: true,
354+
channel: path,
355+
},
356+
},
357+
],
358+
up: [],
359+
},
360+
],
361+
feedbacks: [
362+
{
363+
feedbackId: FeedbackId.SofActive,
364+
options: {
365+
channel: path,
366+
},
367+
style: {
368+
bgcolor: combineRgb(255, 165, 0),
369+
},
370+
},
371+
],
372+
}
373+
}

0 commit comments

Comments
 (0)