Forum Discussion

EnTerr's avatar
EnTerr
Roku Guru
12 years ago

Bug? roCaptionRenderer has no ifGetMessagePort/ifSetMess...

Discrepancy - documentation http://sdkdocs.roku.com/display/sdkdoc/ ... onRenderer promices ifGetMessagePort/ifSetMessagePort interfaces, implementation does not deliver:
BrightScript Debugger> vp = createObject("roVideoPlayer")
BrightScript Debugger> cr = vp.getCaptionRenderer()
BrightScript Debugger> ? cr
<Component: roCaptionRenderer>
BrightScript Debugger> ? getInterface(cr, "ifCaptionRenderer")
<Interface: ifCaptionRenderer>
BrightScript Debugger> ? getInterface(cr, "ifGetMessagePort")
invalid
BrightScript Debugger> ? getInterface(cr, "ifSetMessagePort")
invalid
BrightScript Debugger> ? cr.getMessagePort()
Member function not found in BrightScript Component or interface. (runtime error &hf4) in $LIVECOMPILE(156)

2 Replies

  • You can use SetMessagePort(port), but from my testing, it appears that GetMessagePort is not implemented, even though it is documented as being a valid method.

    BrightScript Debugger> cr=createobject("rocaptionrenderer")
    BrightScript Debugger> ?cr
    <Component: roCaptionRenderer>
    BrightScript Debugger> ?cr.getmessageport()
    Member function not found in BrightScript Component or interface. (runtime error &hf4) in $LIVECOMPILE(13)
    BrightScript Debugger> port=createobject("romessageport")
    BrightScript Debugger> cr.setmessageport(port)
    BrightScript Debugger> ?cr.getmessageport()
    Member function not found in BrightScript Component or interface. (runtime error &hf4) in $LIVECOMPILE(16)


    - Joel
  • "RokuJoel" wrote:
    You can use SetMessagePort(port), but from my testing, it appears that GetMessagePort is not implemented, even though it is documented as being a valid method.

    Indeed. And as you see from my example above, it does not return ifGetMessagePort/ifSetMessagePort interfaces - which documentations says it supports and therefore should have. In case you have not used getInterface() before, it returns something non-invalid for objects that support particular interfaces. I have used it on many objects and roCaptionRenderer is the only exception i have seen.

    So it is either a bug to file or documentation to fix (which will be interesting to see, documenting getMessagePort() without ifGetMessagePort )