MCPcopy Create free account
hub / github.com/FedeDP/Clight / get_screen_brightness

Function get_screen_brightness

src/modules/screen.c:163–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161}
162
163static int get_screen_brightness(bool emit) {
164 if (paused_state) {
165 return 0;
166 }
167
168 double new_br = 0.0f;
169 SYSBUS_ARG_REPLY(args, parse_bus_reply, &new_br, CLIGHTD_SERVICE, "/org/clightd/clightd/Screen", "org.clightd.clightd.Screen", "GetEmittedBrightness");
170
171 screen_msg.bl.old = state.screen_br;
172 int ret = call(&args, "ss", fetch_display(), fetch_env());
173 if (ret == 0 && emit) {
174 state.screen_br = new_br;
175 screen_msg.bl.new = state.screen_br;
176 M_PUB(&screen_msg);
177 }
178 return ret;
179}
180
181static void timeout_callback(int old_val, bool reset) {
182 if (conf.screen_conf.timeout[state.ac_state] <= 0) {

Callers 2

initFunction · 0.85
receiveFunction · 0.85

Calls 3

callFunction · 0.85
fetch_displayFunction · 0.85
fetch_envFunction · 0.85

Tested by

no test coverage detected