(INSTANT $75 today for help) roImageCanvas & roSlideShow

Is it possible to over lay a transparent png on roImageCanvas over the roSlideShow component? I am trying to overlay a graphic on the DeviantArt example. The best I can get is that when I put the meta info in the Slideshow subs and call for the (roImage).Show() command, it locks up the slideshow. I am also stumped as how to randomize the slideshow… may have to rename the filenames each night… any ideas as how to make it work would be so appreciated - been working on it for a week now…

See code below… any help you can offer would be greatly appreciated.

Function CreateMediaRSSConnection()As Object
    rss = {
        port: CreateObject("roMessagePort"),
        http: CreateObject("roUrlTransfer"),

        DisplayAbigail: DisplayAbigail,
        DisplayAnimal: DisplayAnimal,
        DisplaySurfside: DisplaySurfside,
        DisplayiCountry: DisplayiCountry,
        DisplayA1R: DisplayA1R,
        DisplayA1A: DisplayA1A,        
        DisplaySlideShow: DisplaySlideShow,
        GetPhotoListFromFeed: GetPhotoListFromFeed,
        }

    return rss
End Function

Function DisplaySetup(port as object)
    slideshow = CreateObject("roSlideShow")
    slideshow.SetMessagePort(port)
    slideshow.SetUnderscan(5.0)      ' shrink pictures by 5% to show a little bit of border (no overscan)
    slideshow.SetBorderColor("#000000")
    slideshow.SetMaxUpscale(8.0)
    slideshow.SetDisplayMode("best-fit")
    slideshow.SetPeriod(8)
    slideshow.Show()
    return slideshow
End Function

Sub DisplayAbigail()
    blackCanvas = CreateObject( "roImageCanvas" )
    audio = CreateObject("roAudioPlayer")
    item = CreateObject("roAssociativeArray")
    item.Url = "[station stream address]"
    item.StreamFormat = "mp3"
    audio.AddContent(item)
    blackCanvas.SetLayer( 0, { Color: "#000000", TargetRect: { x: 0, y: 0, w: 1280, h: 720 } } )
    blackCanvas.Show()
    canvasItems = [{ url:"[pic address]"
TargetRect:{x:935,y:05,w:350,h:262}
},
{ url:"[pic address]"
TargetRect:{x:35,y:01,w:350,h:262}
},
{ Text:"[shoutcast XML song parse address]"
TextAttrs:{Color:"#FFCCCCCC", Font:"Large",
HAlign:"HCenter", VAlign:"VCenter",
Direction:"LeftToRight"}
TargetRect:{x:60,y:379,w:450,h:50}
},
]
logocanvas = CreateObject("roImageCanvas")
    slideshow = DisplaySetup(m.port)
logoport = CreateObject("roMessagePort")
logocanvas.SetMessagePort(m.logoport)
logocanvas.AllowUpdates(true)
'Set opaque background
logocanvas.SetLayer(5, {CompositionMode:"Source"})
logocanvas.SetRequireAllImagesToDraw(true)
logocanvas.SetLayer(6, canvasItems)
    audio.Play()
    photolist=m.GetPhotoListFromFeed("[pic XML address]")
    m.DisplaySlideShow(logocanvas, slideshow, photolist)
    End Sub
        

Sub DisplayAnimal()
    blackCanvas = CreateObject( "roImageCanvas" )
    audio = CreateObject("roAudioPlayer")
    item = CreateObject("roAssociativeArray")
    item.Url = "[station stream address]"
    item.StreamFormat = "mp3"
    audio.AddContent(item)
    blackCanvas.SetLayer( 0, { Color: "#000000", TargetRect: { x: 0, y: 0, w: 1280, h: 720 } } )
    blackCanvas.Show()
    audio.Play()
    slideshow = DisplaySetup(m.port)
    photolist=m.GetPhotoListFromFeed("[pic XML address]")
    m.DisplaySlideShow(slideshow, photolist)
    End Sub
    
Sub DisplaySurfside()
    blackCanvas = CreateObject( "roImageCanvas" )
    audio = CreateObject("roAudioPlayer")
    item = CreateObject("roAssociativeArray")
    item.Url = "[station stream address]"
    item.StreamFormat = "mp3"
    audio.AddContent(item)
    blackCanvas.SetLayer( 0, { Color: "#000000", TargetRect: { x: 0, y: 0, w: 1280, h: 720 } } )
    blackCanvas.Show()
    audio.Play()
    slideshow = DisplaySetup(m.port)
    photolist=m.GetPhotoListFromFeed("[pic XML address]")
    m.DisplaySlideShow(slideshow, photolist)
    End Sub
    
Sub DisplayiCountry()
    blackCanvas = CreateObject( "roImageCanvas" )
    audio = CreateObject("roAudioPlayer")
    item = CreateObject("roAssociativeArray")
    item.Url = "[station stream address]"
    item.StreamFormat = "mp3"
    audio.AddContent(item)
    blackCanvas.SetLayer( 0, { Color: "#000000", TargetRect: { x: 0, y: 0, w: 1280, h: 720 } } )
    blackCanvas.Show()
    audio.Play()
    slideshow = DisplaySetup(m.port)
    photolist=m.GetPhotoListFromFeed("[pic XML address]")
    m.DisplaySlideShow(slideshow, photolist)
    End Sub
    
 Sub DisplayA1R()
    blackCanvas = CreateObject( "roImageCanvas" )
    audio = CreateObject("roAudioPlayer")
    item = CreateObject("roAssociativeArray")
    item.Url = "[station stream address]"
    item.StreamFormat = "mp3"
    audio.AddContent(item)
    blackCanvas.SetLayer( 0, { Color: "#000000", TargetRect: { x: 0, y: 0, w: 1280, h: 720 } } )
    blackCanvas.Show()
    audio.Play()
    slideshow = DisplaySetup(m.port)
    photolist=m.GetPhotoListFromFeed("[pic XML address]")
    m.DisplaySlideShow(slideshow, photolist)
    End Sub
    
 Sub DisplayA1A()
    blackCanvas = CreateObject( "roImageCanvas" )
    audio = CreateObject("roAudioPlayer")
    item = CreateObject("roAssociativeArray")
    item.Url = "[station stream address]"
    item.StreamFormat = "mp3"
    audio.AddContent(item)
    blackCanvas.SetLayer( 0, { Color: "#000000", TargetRect: { x: 0, y: 0, w: 1280, h: 720 } } )
    blackCanvas.Show()
    audio.Play()
    slideshow = DisplaySetup(m.port)
    photolist=m.GetPhotoListFromFeed("[pic XML address]")
    m.DisplaySlideShow(slideshow, photolist)
    End Sub

Function GetPhotoListFromFeed(feed_url) As Object
    print "GetPhotoListFromFeed: ";feed_url
    m.http.SetUrl(feed_url)
    xml=m.http.GetToString()
    rss=CreateObject("roXMLElement")
    if not rss.Parse(xml) then stop
    print "rss@version=";rss@version

    pl=CreateObject("roList")
    for each item in rss.channel.item
        pl.Push(newPhotoFromXML(m.http, item))
        print "photo title=";pl.Peek().GetTitle()
    next
    return pl

End Function

Function newPhotoFromXML(http As Object, xml As Object) As Object
  photo = {http:http, xml:xml, GetURL:pGetURL}
  photo.GetTitle=function():return m.xml.title.GetText():end function
  return photo
End Function

Function pGetURL()
    for each c in m.xml.GetNamedElements("mediacontent")
        if c@medium="image" then return c@url
        next

    return invalid
End Function

Sub DisplaySlideShow(logocanvas, slideshow, photolist)
    print "in DisplaySlideShow"
        'using SetContentList()
    contentArray = CreateObject("roArray", photolist.Count(), true)
    for each photo in photolist
        print "---- new DisplaySlideShow photolist loop ----"
        url = photo.GetURL()
            if url<>invalid then
            aa = CreateObject("roAssociativeArray")
            aa.Url = url
            contentArray.Push(aa)
            print "PRELOAD TITLE: ";photo.GetTitle()
        end if
    next
    
           
            slideshow.SetContentList(contentArray)
            
                    'this is an alternate technique for adding content using AddContent():
    'aa = CreateObject("roAssociativeArray")
    'for each photo in photolist
    '   print "---- new DisplaySlideShow photolist loop ----"
    '   url = photo.GetURL()
    '   if url<>invalid then
    '       aa.Url = url
    '       slideshow.AddContent(aa)
    '       print "PRELOAD TITLE: ";photo.GetTitle()
    '   end if
    'next

    btn_more_from_author = 0
    btn_similar          = 1
    btn_bookmark         = 2
    btn_hide             = 3
    waitformsg:
    msg = wait(0, m.port)
            print "DisplaySlideShow: class of msg: ";type(msg); " type:";msg.gettype()
    'for each x in msg:print x;"=";msg[x]:next
    if msg <> invalid then                          'invalid is timed-out
        if type(msg) = "roSlideShowEvent" then
            if msg.isScreenClosed() then
                return
            else if msg.isButtonPressed() then
                print "Menu button pressed: " + Stri(msg.GetIndex())
                'example button usage during pause:
                'if msg.GetIndex() = btn_hide slideshow.ClearButtons()
            else if msg.isPlaybackPosition() then
                onscreenphoto = msg.GetIndex()
                print "slideshow display: " + Stri(msg.GetIndex())
                    else if msg.isRemoteKeyPressed() then
                print "Button pressed: " + Stri(msg.GetIndex())
            else if msg.isRequestSucceeded() then
                print "preload succeeded: " + Stri(msg.GetIndex())
            elseif msg.isRequestFailed() then
                print "preload failed: " + Stri(msg.GetIndex())
            elseif msg.isRequestInterrupted() then
                print "preload interrupted" + Stri(msg.GetIndex())
            elseif msg.isPaused() then
                print "paused"
                'example button usage during pause:
                'buttons will only be shown in when the slideshow is paused
                'slideshow.AddButton(btn_more_from_author, "more photos from this author")
                'slideshow.AddButton(btn_similar, "similar images")
                'slideshow.AddButton(btn_bookmark, "mark as favorite")
                'slideshow.AddButton(btn_hide, "hide buttons")
            elseif msg.isResumed() then
                print "resumed"
                'example button usage during pause:
                'slideshow.ClearButtons()
            end if
        end if
    end if
       goto waitformsg
    End Sub

You mind going back and throwing a [ code ] block around that? Makes it SO much easier to read with indentation, especially in a language without braces…

I could just quote it and code block it myself, but then this thread would start with two giant posts of the same data.

Sure- sorry about that.

PS- sorry about the lack of indents in some of the code as well.. thank you so much for taking a look at this. Any help that you could provide would finally let us have a weekend off…

parse

If anyone has PayPal, I would send you a quick $50 bucks for a solution to this today. Please PM me the fixed code and your paypal email address & I will immediately send you the money.

No takers, huh. lol - well, don’t make me break the bank and offer $60…

A quick solution is worth much more - we know. $75 hopefully will do it… if it is just a simple code rearrange. We hope so, we are avid students of the Roku but are hitting a brick wall on this one.

Notify us you can help and we’ll notify this thread immediately as to not have anyone overlap or work for free.

Thank you for understanding and a solution toward making our channel better.

still open

I haven’t really looked at your code, but why don’t you just use an image canvas for the whole thing and forget the slide show component? Yes, it takes more work, but I think it will give you better results.

-JT

jim-

I would love to know how to do that. Do I just change the roSlideShow components to roImageCanvas?

dave

offer is still open…

Hi , I’ll try to help.

Give me a few minutes and I’ll try to code something up for you.

  • Joel

AWESOME Joel… be sure to include your paypal address…

Thank you!

Dave

Just at a glance at your code, looks like you are drawing an opaque background for the image canvas. Don’t draw a background. Then anything you draw should be an overlay.

back in a few. I could use the $75. :slightly_smiling_face:

we tried to make the image go black at first… i think that is our feeble attempt…

if you add the ability to parse the title & artist of a shoutcast stream in each one, I’ll make it an even $100…

Thank you so much, knowing you are fixing it is dramatically reducing our stress level over here…

dave

looks like you replaced all the code in mediarsstoolkit with your own. did you make any other changes anywhere else in the app? if so, can you post them or pm them? tried running your code as is after replacing all the duplicate functions in mediarsstoolkit but it crashes at

085:                                            this[onselect_callback[msg.GetIndex()+2]]()

if I click on user favories poster item.

  • Joel

check your PM for all the code…

For what it’s worth.. using the stock deviantart example, while crude, adding the following code to the isPlaybackPosition() block of the wait loop in DisplaySlideShow() in mediarsstoolkit.brs, may serve as a decent proof of concept… (i.e., to answer the original question, yes you can do an overlay on a slideshow)

else if msg.isPlaybackPosition() then
    onscreenphoto = msg.GetIndex()
    print "slideshow display: " + Stri(msg.GetIndex())
    
    canvas = CreateObject( "roImageCanvas" )
    bgRect = {
        Color: "#66000000",
        TargetRect: { x: 250, y: 250, w: 250, h: 250 }
    }
    text = {
        Text: "Hello World: " + msg.GetIndex().ToStr(),
        TargetRect: bgRect.TargetRect
    }
    canvas.SetLayer( 0, [ bgRect, text ] )
    canvas.Show()
    Sleep( 2000 )
    canvas.Close()
else if msg.isRemoteKeyPressed() then

thank you so much for chiming in Endless… works good but wont cycle the slideshow while it is active… would like to keep an active graphic and display the artist & title of a shoutcast stream.

“PositivePeak” wrote:
thank you so much for chiming in Endless… works good but wont cycle the slideshow while it is active… would like to keep an active graphic and display the artist & title of a shoutcast stream.
Again, it was just meant as a proof of concept, to show that you can do a custom overlay. You’d definitely need to do some additional legwork to get it to work the way you want it to. Sounds like jbrave may be on his way to getting you something that’ll work…

Do you already have the artist & title information data from the stream? I thought I had read somewhere that you already had that worked out. If not, are you streaming through shoutcast.com, or are you running your own shoutcast sever?