@@ -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 ++ ) {
@@ -318,3 +323,45 @@ function getLightPresetDark(): CompanionButtonPresetDefinition {
318323 feedbacks : [ ] ,
319324 }
320325}
326+
327+ function getSofPresets ( base : string , val : number ) : CompanionButtonPresetDefinition {
328+ const path = `/${ base } /${ val } `
329+ const name = `${ base . toUpperCase ( ) } ${ val } `
330+ return {
331+ name : 'Sends on Fader' ,
332+ category : 'Sends on Fader' ,
333+ type : 'button' ,
334+ style : {
335+ text : `let name = 'SOF'const realName = $(wing:${ base } ${ val } _name)let hasNoName = realName === '' || isreturn hasNoName ? 'SOF ${ name } ' : \`SOF \${realName}\`` ,
336+ textExpression : true ,
337+ size : 'auto' ,
338+ color : combineRgb ( 255 , 255 , 255 ) ,
339+ bgcolor : combineRgb ( 0 , 0 , 0 ) ,
340+ } ,
341+ steps : [
342+ {
343+ down : [
344+ {
345+ actionId : OtherActionId . SetSOF ,
346+ options : {
347+ toggle : true ,
348+ channel : path ,
349+ } ,
350+ } ,
351+ ] ,
352+ up : [ ] ,
353+ } ,
354+ ] ,
355+ feedbacks : [
356+ {
357+ feedbackId : FeedbackId . SofActive ,
358+ options : {
359+ channel : path ,
360+ } ,
361+ style : {
362+ bgcolor : combineRgb ( 255 , 165 , 0 ) ,
363+ } ,
364+ } ,
365+ ] ,
366+ }
367+ }
0 commit comments