Warning: session_start(): open(/var/lib/php/sessions/sess_vbkr4pqclivajfu214pthmamec, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!7
cmodule HeadphoneDetection > DynBigNumber {
Bool pluggedIn; // null if unknown
int minValue = 100, maxValue;
start {
setDescription("HEADPHONES");
if (isLinux()) ret with setValue("Linux only, sorry");
doEveryAndNow(3.0, r actualUpdate);
}
void actualUpdate enter {
int raw = linux_rawHeadphonesCount();
setField(minValue := min(minValue, raw));
setField(maxValue := max(maxValue, raw));
setField(pluggedIn := minValue == maxValue ? null : raw > minValue);
setValue(nullFalseTrue(pluggedIn, "?", "NO", "YES"));
setToolTip(pluggedIn == null ? "Please plug/unplug headphones once to enable detection" : null);
}
}