Making an activity LED
-
Hi!
I'm quiet new to this HISE development and wondering if there is an efficient way to make an "activity led" (For example two image layered on eachother where true and false could control visibility of one layer.) on user interface that would light up in case of - for example - a limiter is starting to act. Making threshold of this activity is not a big deal I know, but I believe my approach is more than suboptimal in this case. (Added a limiter, controlling a switcher and logic operator to precisely tuning it to the required level.) But, this is a point where I got stuck. I don't know how efficiently make an event data or utilize any network device that can send event to the interface. Unfortunately, I get lost in the documentation at this point. Does anybody has any technique to this?
Many thanks in advance!
-
Use a panel with a paint routine or a button with two frames rather than hiding showing images. As to how you trigger the activity I don't know but possibly a global cable.
-
@d-healey Yeah, the hiding is just an example. I could even use paint events or change panel background color, whetever. The thing is that I don't know (yet) how to route out any events in a practical way to the gui.
-
@ThomAce said in Making an activity LED:
I don't know how efficiently make an event data or utilize any network device that can send event to the interface
I'm not sure what you mean by event data or network device, could you elaborate?
-
@d-healey I figured it out...
Just quickly made this together. Works as expected. Thanks for the direction.
const var GRM = Engine.getGlobalRoutingManager(); const var Cable = GRM.getCable("LimiterActive"); const var LimiterActiveLED = Content.getComponent("LimiterActiveButton"); Cable.registerCallback(function(value){ if (value == 1){ LimiterActiveLED.setValue(1); Console.print("high"); //for debugging } else{ Console.print("low"); //for debugging LimiterActiveLED.setValue(0); } }, AsyncNotification);
-
@ThomAce Nice! You can shorten your function to a single line.
Cable.registerCallback(function(value) { LimiterActiveLED.setValue(value); }, AsyncNotification);
-
@d-healey Thanks! Yeah, you are right. Just for debugging purposes I kept it simple as this to see what is going on, but you are absolutely right! I still need some "housekeeping" in code as I quickly dropped everything together and I'll do some optimizations. But, finally, everything works as I wanted.