@@ -41,52 +41,53 @@ module.exports = [
4141 }
4242
4343 console . log ( 'Yamaha-RCP Upgrade: Config Ok, Getting Parameters...' )
44-
4544 var rcpCommands = paramFuncs . getParams ( { config : context . currentConfig } )
46-
4745 console . log ( '\n' )
4846
4947 let checkUpgrade = ( action , isAction ) => {
50- // console.log('Yamaha-RCP Upgrade: Checking action/feedback: ', action)
48+ console . log ( 'Yamaha-RCP Upgrade: Checking action/feedback: ' , action )
5149
50+ let changed = false
5251 let rcpCmd = undefined
52+ let newAction = JSON . parse ( JSON . stringify ( action ) )
5353 let actionAddress = isAction ? action . actionId : action . feedbackId
5454
55+ if ( actionAddress . startsWith ( 'MIXER_Lib' ) ) {
56+ actionAddress = 'MIXER_Lib/Scene/Recall'
57+ newAction . options . Val = action . options . X
58+ newAction . options . X = 0
59+ changed = true
60+ }
61+
62+ if ( actionAddress . startsWith ( 'scene' ) ) {
63+ actionAddress = 'MIXER_Lib/Bank/Scene/Recall'
64+ newAction . options . Val = action . options . X
65+ newAction . options . X = 0
66+ newAction . options . Y = action . options . Y == 'a' ? 1 : 2
67+ }
68+
5569 rcpCmd = rcpCommands . find ( ( i ) => i . Address . replace ( / : / g, '_' ) == actionAddress )
5670//console.log('Yamaha-RCP Upgrade: rcpCmd:', rcpCmd)
5771
5872 if ( rcpCmd !== undefined ) {
59- let newAction = JSON . parse ( JSON . stringify ( action ) )
60- let changed = false
61-
62- switch ( actionAddress ) {
63- case 'MIXER_Lib/Scene' : {
64- if ( isAction ) {
65- newAction . actionId = 'MIXER_Lib/Scene/Recall'
66- } else {
67- newAction . feedbackId = 'MIXER_Lib/Scene/Recall'
68- }
69- newAction . options . Val = action . options . X
70- newAction . options . X = 0
71- changed = true
72- }
73- }
7473
7574 if ( rcpCmd . Type == 'integer' || rcpCmd . Type == 'binary' ) {
76- newAction . options . Val = action . options . Val == rcpCmd . Min ? '-Inf' : action . options . Val / rcpCmd . Scale
75+ newAction . options . Val = newAction . options . Val == rcpCmd . Min ? '-Inf' : newAction . options . Val / rcpCmd . Scale
7776 changed = true
7877 }
7978
8079 if ( changed ) {
81- console . log ( `Yamaha-RCP Upgrade: Updating ${ isAction ? "Action '" + actionAddress + "' -> '" + newAction . actionId : "Feedback '" + actionAddress + "' -> '" + newAction . feedbackId } ' ...` )
80+ console . log ( `Yamaha-RCP Upgrade: Updating ${ isAction ? "Action '" + newAction . actionId + "' -> '" + actionAddress : "Feedback '" + newAction . feedbackId + "' -> '" + actionAddress } ' ...` )
8281 console . log ( `X: ${ action . options . X } -> ${ newAction . options . X } , Y: ${ action . options . Y } -> ${ newAction . options . Y } , Val: ${ action . options . Val } -> ${ newAction . options . Val } \n` )
8382
84- /* if (isAction) {
83+ if ( isAction ) {
84+ newAction . actionId = actionAddress
8585 updates . updatedActions . push ( newAction )
8686 } else {
87+ newAction . feedbackId = actionAddress
8788 updates . updatedFeedbacks . push ( newAction )
8889 }
89- */ }
90+ }
9091
9192 return
9293 }
0 commit comments