@@ -14,7 +14,7 @@ import {
1414 GetPanoramaDeltaSlider ,
1515 GetColorDropdown ,
1616 GetNumberField ,
17- GetSoloDropdown ,
17+ GetOnOffToggleDropdown ,
1818 getDelayModes ,
1919} from '../choices/common.js'
2020import { getNodeNumber , getNumber , runTransition } from './utils.js'
@@ -470,7 +470,7 @@ export function createCommonActions(self: InstanceBaseExt<WingConfig>): Companio
470470 [ CommonActions . SetSolo ] : {
471471 name : 'Set Solo' ,
472472 description : 'Set the solo state for a channel, aux, bux, matrix or main' ,
473- options : [ GetDropdown ( 'Selection' , 'sel' , allChannels ) , GetSoloDropdown ( 'solo' ) ] ,
473+ options : [ GetDropdown ( 'Selection' , 'sel' , allChannels ) , GetOnOffToggleDropdown ( 'solo' , 'Solo ') ] ,
474474 callback : async ( event ) => {
475475 const sel = event . options . sel as string
476476 const cmd = ActionUtil . getSoloCommand ( sel , getNodeNumber ( event , 'sel' ) )
@@ -520,17 +520,23 @@ export function createCommonActions(self: InstanceBaseExt<WingConfig>): Companio
520520 ...state . namedChoices . matrices ,
521521 ...state . namedChoices . busses ,
522522 ] ) ,
523- {
524- type : 'checkbox' ,
525- label : 'Delay On/Off' ,
526- id : 'delay' ,
527- default : false ,
528- } ,
523+ GetOnOffToggleDropdown ( 'delay' , 'Delay' ) ,
529524 ] ,
530525 callback : async ( event ) => {
531526 const sel = event . options . sel as string
532527 const cmd = ActionUtil . getDelayOnCommand ( sel , getNodeNumber ( event , 'sel' ) )
533- send ( cmd , event . options . delay ? 1 : 0 )
528+ const val = ActionUtil . getNumber ( event , 'delay' )
529+ if ( val < 2 ) {
530+ send ( cmd , val )
531+ } else {
532+ const currentVal = StateUtil . getBooleanFromState ( cmd , state )
533+ send ( cmd , Number ( ! currentVal ) )
534+ }
535+ } ,
536+ subscribe : ( event ) => {
537+ const sel = event . options . sel as string
538+ const cmd = ActionUtil . getDelayOnCommand ( sel , getNodeNumber ( event , 'sel' ) )
539+ ensureLoaded ( cmd )
534540 } ,
535541 } ,
536542
0 commit comments