Forum Discussion

gboudreau's avatar
gboudreau
Channel Surfer
9 years ago

roRegistrySection: class PLUGIN|MARKUP on thread RENDER

My code fails to create a roRegistrySection object. I tried on the debug console too, and it fails with the same error:
BrightScript Debugger> sec = CreateObject("roRegistrySection", "Authentication")
BRIGHTSCRIPT: ERROR: roRegistrySection: class PLUGIN|MARKUP on thread RENDER

Do I need to create roRegistrySection objects somehow differently?

10 Replies

  • Where are you doing that? If it's in a Scene Graph script, then it can only be used in a Task node.
  • gboudreau's avatar
    gboudreau
    Channel Surfer
    It's called from within the Init() function of a Graph XML component, so I guess that is what you meant.
    I'll check what Task nodes are.

    Thanks.
  • gboudreau's avatar
    gboudreau
    Channel Surfer
    Thanks.
    I was able to create a custom Task XML that allowed me to read the registry from my scene, but later moved most of that code into the main.brs, so I didn't need it anymore!
    I hit a similar problem with the roCodeRegistrationScreen; I was trying to use it in my scene too, but I guess you can't do that, so I moved that code into main.brs, and it worked.

    Thanks again for the Task pointer.
  • "gboudreau" wrote:
    I hit a similar problem with the roCodeRegistrationScreen; I was trying to use it in my scene too, but I guess you can't do that, so I moved that code into main.brs, and it worked.

    roCodeRegistrationScreen is a non-(ob)scene component.
    Do read the page theEndless linked to above, it says it.

    Suppose we can come with some heuristic, like: if it's UI component and starts with "ro" (but not "roSG") - it can't be used in the render/SG UI thread.
  • gboudreau's avatar
    gboudreau
    Channel Surfer
    Yeah, I had read it, but I was confused... How can I show a screen from a scene..?
    For example, my scene shows a grid, and the user selects one of the content node in the grid, and I want to start a slideshow (which is a screen, same as roCodeRegistrationScreen). How can my scene, which has the observer on PosterGrid.itemSelected, start the slideshow screen ?
  • Can't.
    You are not supposed to use roSlideShow (et al "ro" components) once seduced by the darker xml side.

    By using roSGScreen
    "Morpheus" wrote:
    You take the red pill - you stay in Wonderland, and I show you how deep the rabbit hole goes.
    Remember: all I'm offering is the truth. Nothing more.

    sdkdocs.roku.com describes two different SDKs, which are immiscible like oil and water. Generally speaking. There might be exceptions - just like emulsion can be whipped between oil and water and get good things out of it, like mayo, hollandaise sauce or body lotion. But as a rule they separate.
  • gboudreau's avatar
    gboudreau
    Channel Surfer
    "EnTerr" wrote:
    sdkdocs.roku.com describes two different SDKs, which are immiscible like oil and water.

    What would those be? BrightScript Components and Scene Graph?

    So you mean that since I'm using SG, I should NOT use roSlideShow, roCodeRegistrationScreen and other components defined as a "Brightscript Components"
    https://sdkdocs.roku.com/display/sdkdoc/Components ? I need to re-write those components myself?

    Did I somehow skip an important page to read, regarding development on Roku? I seem to be missing basic concepts...
  • "gboudreau" wrote:
    Did I somehow skip an important page to read, regarding development on Roku? I seem to be missing basic concepts...

    Ha! I wish it was as simple. And your humility is appreciated 8-)

    No, it's just you have to acquire that knowledge face-planting a few times in Roku world. I have been around things-Roku for like what, 5 years? So i was reading the APIs since the time they were bound in PDF files and have long-term observations over their evolution.

    The SG was newly hatched to the public last year and an attempt at "SDK 2.0" pivot - but the documentation was edited in place as if SG is coherent with everything else existing before, which it isn't. Whoever is writing that "couldn't see the forest for the trees" - likely for being too close so unable to see the big picture.
  • gboudreau's avatar
    gboudreau
    Channel Surfer
    OK, thanks.

    I was able to "complete" my channel project: a Google Photos viewer, allowing me to browse & view the photos & videos uploaded automatically by my phone to Google Photos. Basically, it's just a registration screen, a posterGrid scene to browse albums, another posterGrid to browse photos & videos thumbs, and a videoPlayer for videos, or a Poster for photos.
    There's a lot of things I do server-side, like rotating the images based on their EXIF orientation data, because I couldn't find how to do that in the Roku SDK, or I thought it was just easier to do server-side. But otherwise, I think it works good enough.
    I'll probably publish it on Github after playing with it for a while.

    Thanks again for the pointers.