Better and more events
dblume

dblume commited on 2023-02-22 22:49:23
Showing 3 changed files, with 24 additions and 6 deletions.

... ...
@@ -193,7 +193,7 @@ function onKeyEvent(key as String, press as Boolean) as Boolean
193 193
             if update_ui
194 194
                 doUpdateFocus()
195 195
             endif
196
-            dt = Mid(CreateObject("roDateTime").ToISOString(), 15, 5)
196
+            dt = Mid(CreateObject("roDateTime").ToISOString(), 12, 8)
197 197
             updateTextLower(dt + " " + key)
198 198
             handled = true
199 199
         end if
... ...
@@ -82,6 +82,8 @@ function executeTask() as void
82 82
     if not success then m.top.updateTextLower = "EnableAppFocusEvent failure"
83 83
     success = deviceInfo.EnableCodecCapChangedEvent(true)
84 84
     if not success then m.top.updateTextLower = "EnableCodecCapChangedEvent failure"
85
+    success = deviceInfo.EnableScreensaverExitedEvent(true)
86
+    if not success then m.top.updateTextLower = "EnableScreensaverExitedEvent failure"
85 87
 
86 88
     while(true)
87 89
         msg = wait(0, port)
... ...
@@ -91,8 +93,16 @@ function executeTask() as void
91 93
 
92 94
         if msgType = "roHdmiStatusEvent"
93 95
             aa = msg.GetInfo()
94
-            v = aa.LookupCI("Plugged")
95
-            if v <> invalid then m.top.updateTextLower = dt + " HDMI plugged " + v.toStr()
96
+            plugged = aa.LookupCI("Plugged")
97
+            portnum = aa.LookupCI("PortNumber")
98
+            porttype = aa.LookupCI("PortType")
99
+            s = dt + " HDMI "
100
+            if porttype <> invalid then s = s + porttype + " "
101
+            if portnum <> invalid then s = s + portnum.ToStr() + " "
102
+            if plugged <> invalid then
103
+                if plugged then s = s + "Plugged" else s = s + "Unplugged"
104
+            end if
105
+            m.top.updateTextLower = s
96 106
         elseif msgType = "roCECStatusEvent"
97 107
             aa = msg.GetInfo()
98 108
             v = aa.LookupCI("Active")
... ...
@@ -108,9 +118,17 @@ function executeTask() as void
108 118
             v = aa.LookupCI("audioGuideEnabled")
109 119
             if v <> invalid then m.top.updateTextLower = dt + " AudioGuide " + v.toStr()
110 120
             v = aa.LookupCI("appFocused")
111
-            if v <> invalid then m.top.updateTextLower = dt + " appFocused " + v.toStr()
121
+            if v <> invalid then m.top.updateTextLower = dt + " AppFocused " + v.toStr()
112 122
             v = aa.LookupCI("audioCodecCapabilityChanged")
113
-            if v <> invalid then m.top.updateTextLower = dt + " audioCodecCapabilityChanged " + v.toStr()
123
+            if v <> invalid then m.top.updateTextLower = dt + " AudioCodecCapabilityChanged " + v.toStr()
124
+            v = aa.LookupCI("videoCodecCapabilityChanged")
125
+            if v <> invalid then m.top.updateTextLower = dt + " VideoCodecCapabilityChanged " + v.toStr()
126
+            v = aa.LookupCI("exitedScreensaver")
127
+            if v <> invalid then  m.top.updateTextLower = dt + " ExitedScreensaver " + v.toStr()
128
+            v = aa.LookupCI("appFocus")  ' Need to verify it's actually appFocused above
129
+            if v <> invalid then m.top.updateTextLower = dt + " AppFocus " + v.toStr()
130
+            v = aa.LookupCI("generalMemoryLevel")
131
+            if v <> invalid then m.top.updateTextLower = dt + " GeneralMemoryLevel " + v.toStr()
114 132
         elseif msgType = "roInputEvent"
115 133
             info = msg.GetInfo()
116 134
             m.top.updateTextLower = dt + " Input " + FormatJSON(info)
... ...
@@ -1,7 +1,7 @@
1 1
 title=dxb
2 2
 major_version=0
3 3
 minor_version=4
4
-build_version=4
4
+build_version=5
5 5
 ui_resolutions=fhd
6 6
 mm_icon_focus_hd=pkg:/images/mm_icon_focus_hd.png
7 7
 mm_icon_focus_sd=pkg:/images/mm_icon_focus_sd.png
8 8