-
Notifications
You must be signed in to change notification settings - Fork 9
/
pcp-JiveMain-GenericBrightness.patch
61 lines (55 loc) · 2.57 KB
/
pcp-JiveMain-GenericBrightness.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
--- share/jive/jive/JiveMain.lua.orig 2024-02-03 16:10:59.930082350 -0500
+++ share/jive/jive/JiveMain.lua 2024-02-03 16:25:40.492230796 -0500
@@ -47,6 +47,9 @@
local log = require("jive.utils.log").logger("jivelite")
local logheap = require("jive.utils.log").logger("jivelite.heap")
+--start pCP patch------------------------------------------------------------------------
+local rpi = require("jive.utils.rpi_bl")
+--end pCP patch--------------------------------------------------------------------------
--require("profiler")
@@ -196,6 +199,19 @@
return
end
+--start pCP patch------------------------------------------------------------------------
+ -- set default values
+ local backlightBrightness = appletManager:callService("getBacklightBrightnessWhenOn")
+ if backlightBrightness == nil then
+ backlightBrightness = "255"
+ end
+
+ local reducedBacklightBrightness = appletManager:callService("getBacklightBrightnessWhenOff")
+ if reducedBacklightBrightness == nil then
+ reducedBacklightBrightness = "130"
+ end
+--end pCP patch--------------------------------------------------------------------------
+
_softPowerState = softPowerState
local currentPlayer = appletManager:callService("getCurrentPlayer")
if _softPowerState == "off" then
@@ -203,6 +219,9 @@
if currentPlayer and (currentPlayer:isConnected() or currentPlayer:isLocal()) then
currentPlayer:setPower(false, nil, isServerRequest)
end
+--start pCP patch------------------------------------------------------------------------
+ rpi.set_pCP_display_current_brightness(reducedBacklightBrightness)
+--end pCP patch--------------------------------------------------------------------------
--todo: also pause/power off local player since local player might be playing and not be the current player
appletManager:callService("activateScreensaver", isServerRequest)
elseif _softPowerState == "on" then
@@ -215,7 +234,9 @@
end
currentPlayer:setPower(true, nil, isServerRequest)
end
-
+--start pCP patch------------------------------------------------------------------------
+ rpi.set_pCP_display_current_brightness(backlightBrightness)
+--end pCP patch--------------------------------------------------------------------------
appletManager:callService("deactivateScreensaver")
appletManager:callService("restartScreenSaverTimer")
@@ -655,7 +676,6 @@
return _defaultSkin or "QVGAportraitSkin"
end
-
-----------------------------------------------------------------------------
-- main()
-----------------------------------------------------------------------------