Hello all,
I need to turn off the power to a big-ass amplifier if the user forgets to turn it off himself. I'm trying to find the best way to do this (*).
The way I've done it is put a timer with the required duration, and at the begining of the panel callback (before the switch) I do a SetCtrlAttribute(... ATTR_INTERVAL, Duration), this way the timer is continuously reset unless the user stops doing anything.
The drawback is that any action (including any mouse move) will call SetCtrlAttribute many many times, which is suboptimal.
Any other way to do this ?
(*) Oviously the correct (tm) way to do this is in hardware, as you never know if the program might crash, the PC power go off, etc. But it's not an amplifier that goes "KaBoom!" if left on, so a software solution is acceptable.