Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
malort
Visitor

query screensaver settings

Is there any way to know if the screensaver is enabled? If true, is there any way to query for the time set?
0 Kudos
15 REPLIES 15
TheEndless
Channel Surfer

Re: query screensaver settings

Nope. Nothing documented, at least. No idea if there's an undocumented way of getting that information.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
destruk
Binge Watcher

Re: query screensaver settings

hmm...perhaps you could manually test if there is a screensaver enabled -- ie - have a server send ecp control presses to the roku at a 6, 11+5, and 31+10 minute interval and have the roku reply with how many button presses it received.
If the screensaver is active it will eat one of the button presses. You would need to have your roku channel send a button press notification from the user to the remote server to have correct timing on the server query back to roku. During video playback the screensaver won't turn on (unless it's paused IIRC).
You could prompt the user to tell you if the screensaver is enabled and what the interval is - through a dialog box or something.
0 Kudos
malort
Visitor

Re: query screensaver settings

"TheEndless" wrote:
Nope. Nothing documented, at least. No idea if there's an undocumented way of getting that information.


Thanks for the quick response as always!

"destruk" wrote:
hmm...perhaps you could manually test if there is a screensaver enabled -- ie - have a server send ecp control presses to the roku at a 6, 11+5, and 31+10 minute interval and have the roku reply with how many button presses it received.
If the screensaver is active it will eat one of the button presses. You would need to have your roku channel send a button press notification from the user to the remote server to have correct timing on the server query back to roku. During video playback the screensaver won't turn on (unless it's paused IIRC).
You could prompt the user to tell you if the screensaver is enabled and what the interval is - through a dialog box or something.


I agree, one could try and find a way to determine it manually, but it would be far less than perfect. I can't find a way to query idle time, so basically we're also have the need to create our own roTimeSpan to determine idle time. The idea is to run some code when the screensaver kicks in, or at some arbitrary time if the screensaver is disabled. For now, I'd stay a bit more simplistic and just run the code ~31min (max screensaver time). Either it would have already ran with the screensaver (close enough) or manually after 31 minutes.
0 Kudos
RokuMarkn
Visitor

Re: query screensaver settings

You could add a private screensaver to your channel, and then you'd know exactly when the screensaver started.

--Mark
0 Kudos
malort
Visitor

Re: query screensaver settings

Thanks, however I was hoping to find out from the channel if a screensaver is enabled/disabled. I do already know when a screensaver is started, via the registry, but I'd like to know if the screensaver setting has been globally disabled.

"RokuMarkn" wrote:
You could add a private screensaver to your channel, and then you'd know exactly when the screensaver started.

--Mark
0 Kudos
RokuMarkn
Visitor

Re: query screensaver settings

Ok, if you insist... It's not documented yet but 5.6 and later has ifAppManager::GetScreensaverTimeout(). It returns the number of minutes the screensaver is set to, or zero if it is disabled.

--Mark
0 Kudos
malort
Visitor

Re: query screensaver settings

Thanks Mark!!

"RokuMarkn" wrote:
Ok, if you insist... It's not documented yet but 5.6 and later has ifAppManager::GetScreensaverTimeout(). It returns the number of minutes the screensaver is set to, or zero if it is disabled.

--Mark
0 Kudos
TheEndless
Channel Surfer

Re: query screensaver settings

"RokuMarkn" wrote:
Ok, if you insist... It's not documented yet but 5.6 and later has ifAppManager::GetScreensaverTimeout(). It returns the number of minutes the screensaver is set to, or zero if it is disabled.

--Mark

Nice one! I knew there had to be something undocumented.. 😉

"malort" wrote:
I can't find a way to query idle time

In theory, ifDeviceInfo.TimeSinceLastKeypress() should give you the user's idle time, but I've found that it resets randomly (probably not random) during video playback. If you're just using it to determine idle time for screensaver kick in, then that shouldn't be a problem, since the screensaver won't kick in during video playback anyway.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
malort
Visitor

Re: query screensaver settings

Yea, I had used that at first, but there are some drawbacks as the last keypress isn't a perfect representation of being idle. Unless there is a way to query "true" idle time, I'd think it's best to just create an roTimeSpan and reset it during non-idle events. Along the same lines, I believe there were some hacks I ended up adding to the roImageCanvas. i.e. send an unused keyboard event locally to keep the Roku from being idle (custom slideshow), otherwise the screen saver would start. I am assuming the same would have to be done in an roScreen.

"TheEndless" wrote:

In theory, ifDeviceInfo.TimeSinceLastKeypress() should give you the user's idle time, but I've found that it resets randomly (probably not random) during video playback. If you're just using it to determine idle time for screensaver kick in, then that shouldn't be a problem, since the screensaver won't kick in during video playback anyway.


"malort" wrote:
I can't find a way to query idle time
0 Kudos