I want to be able to set the stats and colour of a button based on a condition in my custom module.
I have successfully coded the custom module to listen to my expression maps and respond if they change or are updated from cubase. What I can't work out how to do is "prime" a button in my panel, for example change it to red so that when it is then pressed it will get teh custom module to call an expression to update the maps in OSC.
It's the middle bit I can't do - I have created a button with an address that is read in OSC to call the update function and I can warn on the console that the files have been updated - all I want to do is change the status of the button to prompt the user to press to update the maps.
If you're interested, here is the watcher code that prompts on expression map change.
const mapFiles = glob.sync('E:/01 - Composing Data Drive/01 - Music Files/01 - Patches and Maps/01 - Cubase Mapings/01 - Expression Maps/Rebuilt Set 12-11-21/final patch numbers/*.expressionmap')
// Initialize watcher to monitor for changes to the expression maps
const watcher = chokidar.watch(mapFiles, {
ignored: /(^|[\/\\])\../, // ignore dotfiles
persistent: true
});
// Something to use when events are received.
const log = console.log.bind(console);
// Add event listeners.
watcher
.on('change', primeUpdateBtn);
function primeUpdateBtn(){
console.log("EXPRESSION MAP UPDATED - CHANGE STATUS OF BUTTON IN OSC TO PROMPT A REBUILD OF OSC BUTTONS")
}