itrailblaz
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2012
11:58 AM
Help with 2 streams shoutcast npr.brs
I used the sample audioplayer and it work fine. How do I add a second stream to the code? 😞
5 REPLIES 5
itrailblaz
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2012
12:23 PM
Re: Help with 2 streams shoutcast npr.brs
bump
bandal
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2012
02:50 PM
Re: Help with 2 streams shoutcast npr.brs
A code snippet would be great if anyone has it.
DA
DA

RokuJoel
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2012
04:10 PM
Re: Help with 2 streams shoutcast npr.brs
Here's a little one I threw together just for you:
In this case I made a copy of the simpleposter example, renamed it "simpleaudioplayer", opened the .brs file in the source folder and replaced it's contents with the above, and tested it (with some real radio stations).
- Joel
sub main()
poster=createobject("roposterscreen")
content=stationlist()
poster.setcontentlist(content)
port=createobject("romessageport")
poster.setmessageport(port)
audioplayer=createobject("roaudioplayer")
audioplayer.setmessageport(port)
poster.show()
while true
msg=wait(0,port)
if lcase(type(msg))=lcase("roposterscreenevent") then
print "poster screen event"
if msg.islistitemselected() then
ndx=msg.getindex()
audioplayer.stop()
audioplayer.clearcontent()
sleep(500)
audioplayer.addcontent(content[ndx])
audioplayer.play()
end if
else if type(msg)="roAudioPlayerEvent"
if msg.isstatusmessage() then
print msg.getmessage()
end if
end if
end while
end sub
function stationlist() as object
list=[{ShortDescriptionLine1:"Station1"
ShortDescriptionLine2:"My first radio station"
url:"myradiostation.com:8010/"
SDPosterURL:"pkg:/images/mm_icon_focus_sd.png"
HDPosterURL:"pkg:/images/mm_icon_focus_hd.png"
streamformat:"mp3"}
{ShortDescriptionLine1:"Station2"
ShortDescriptionLine2:"My second radio station"
url:"http://myradiostation2.com:15476/"
SDPosterURL:"pkg:/images/mm_icon_focus_sd.png"
HDPosterURL:"pkg:/images/mm_icon_focus_hd.png"
streamformat:"mp3"}]
return list
end function
In this case I made a copy of the simpleposter example, renamed it "simpleaudioplayer", opened the .brs file in the source folder and replaced it's contents with the above, and tested it (with some real radio stations).
- Joel
itrailblaz
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2012
09:45 AM
Re: Help with 2 streams shoutcast npr.brs
Thank you very much, its working. One more question: Since doing that my theme is not working, how do I implement that? (Overhang png files)

RokuJoel
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2012
01:53 PM
Re: Help with 2 streams shoutcast npr.brs
you would put your theme in a "theme function" and call that when the channel first loads:
sub main()
settheme()
'do stuff
end sub