Forum Discussion

Denis_Ukraine's avatar
14 years ago

Question about screensaver

Hello.

In my BrightScript application after required time I have to do some operations and then run screensaver. I found in SDK project named "clock" and add libScreensaver.brs to my project. Now I can create screensaver in required time, but if box screensaver is enabled it openes after specified time and cover my screensaver. Tell me, please, how could I disable default box screensaver in my application, or how could I run default box screensaver in my application after time which was specified in my application?

Thanks!

7 Replies

  • renojim's avatar
    renojim
    Community Streaming Expert
    Do you have screensaver_private=1 in your manifest?

    -JT
  • "renojim" wrote:
    Do you have screensaver_private=1 in your manifest?
    -JT


    No, but I've just added this string and nothing changed.
  • renojim's avatar
    renojim
    Community Streaming Expert
    In order to have a private screen saver within your channel, you need to have screensaver_private=1 in your manifest (make sure that the last line of your manifest ends with a new line and you have to have a routine in your channel named RunScreenSaver() that never returns (the user pressing a button on the remote will kill the routine).

    -JT
  • "renojim" wrote:
    In order to have a private screen saver within your channel, you need to have screensaver_private=1 in your manifest (make sure that the last line of your manifest ends with a new line
    -JT


    My manifest file has next content:


    title=Name
    subtitle=About
    screensaver_title=Roku Analog Clock
    screensaver_private=1
    mm_icon_focus_hd=pkg:/images/mm_icon_focus_hd.png
    mm_icon_focus_sd=pkg:/images/mm_icon_focus_sd.png
    major_version=1
    minor_version=0
    build_version=00000


    Is it right?

    "renojim" wrote:
    you have to have a routine in your channel named RunScreenSaver() that never returns (the user pressing a button on the remote will kill the routine).
    -JT


    I don't use RunScreenSaver(). For starting ScreenSaver I use 2 files: analogclock.brs and libScreensaver.brs and create ScreenSaver by next metod:


    Function RunScreenSaverStart()
    canvas = CreateScreensaverCanvas("#000000")
    index = Rnd(2)
    if index = 1
    canvas.SetImageFunc(CreateRokuAnalogClock) '(GetClockImage)
    else if index = 2
    canvas.SetImageFunc(CreateWhiteAnalogClock) '(GetClockImage)
    end if
    canvas.SetLocFunc(screensaverLib_RandomLocation)
    canvas.SetLocUpdatePeriodInMS(6000)
    canvas.SetUpdatePeriodInMS(1000)
    canvas.SetUnderscan(.09)
    return canvas
    End Function


    Does it mean that I use wrong way and for using ScreenSaver I have use only RunScreenSaver()?
  • Yes, you need RunScreenSaver(), it works just like sub main(), it is effectively the main() for your screensaver. Don't include a main() or a runUserInterface() function if you want it to only function as a screensaver.

    - Joel
  • "RokuJoel" wrote:
    Yes, you need RunScreenSaver(), it works just like sub main(), it is effectively the main() for your screensaver.
    - Joel


    Ok, I got it. So I've changed my metod RunScreenSaverStart() and now ScreenSaver workes fine.
    Thanks a lot.