Your Digital Media Has Never Looked So Good

 
renojim
** Valued Community Member **
Posts: 3490
Joined: Mon Feb 15, 2010 1:35 pm

Re: XML - Categories/Levels Question

Sat Oct 29, 2011 6:24 pm

The example code assumes your XML is hosted somewhere, not part of the package, and you really do want your XML to be retrieved from someplace unless you know your content will never change. If your XML is part of the package, you'd have to submit an updated channel every time you want to update your content.

The hack makes it so that only XML that is part of the package can be used and even if that's ok, you'd really want to rearrange/rewrite the code rather than have an object that appears to do an HTTP transfer, but really just reads from a local file.

I don't believe they analyze your code when you submit a channel. They just make sure it doesn't crash and follows the guidelines, so you're free to write code as ugly as you like.

-JT
 
koshermetal
Posts: 18
Joined: Sat Oct 29, 2011 1:13 am
Location: United States
Contact:

Re: XML - Categories/Levels Question

Tue Nov 01, 2011 5:01 am

Ok...so I seem to be running into another syntax error issue and now the channel doesn't show when I install on the Roku Plugin Installation page. Any help would be greatly appreciated! I'm using SDK v29


Debug info (edit):
*** ERROR compiling /pkg:/source/appMain.brs:
Syntax Error. (compile error &h02) in ...SAOhC/pkg:/source/appMain.brs(41)
Syntax Error. (compile error &h02) in ...SAOhC/pkg:/source/appMain.brs(46)
*** ERROR compiling /pkg:/source/appMain.brs:
Syntax Error. (compile error &h02) in ...sQUZM/pkg:/source/appMain.brs(41)
Syntax Error. (compile error &h02) in ...sQUZM/pkg:/source/appMain.brs(46)


appMain.brs
'********************************************************************
'**  Video Player Example Application - Main
'**  November 2009
'**  Copyright (c) 2009 Roku Inc. All Rights Reserved.
'********************************************************************

Sub Main()

    'initialize theme attributes like titles, logos and overhang color
    initTheme()

    'prepare the screen for display and get ready to begin
    screen=preShowHomeScreen("", "")
    if screen=invalid then
        print "unexpected error in preShowHomeScreen"
        return
    end if

    'set to go, time to get started
    showHomeScreen(screen)

End Sub


'*************************************************************
'** Set the configurable theme attributes for the application
'**
'** Configure the custom overhang and Logo attributes
'** Theme attributes affect the branding of the application
'** and are artwork, colors and offsets specific to the app
'*************************************************************

Sub initTheme()

    app = CreateObject("roAppManager")
    theme = CreateObject("roAssociativeArray")
    theme.BackgroundColor = "#000000"
    theme.OverhangOffsetSD_X = "72"
    theme.OverhangOffsetSD_Y = "31"
    theme.OverhangSliceSD = "pkg:/images/Overhang_KMBackground_SD.png"
    theme.OverhangLogoSD  =

    theme.OverhangOffsetHD_X = "125"
    theme.OverhangOffsetHD_Y = "35"
    theme.OverhangSliceHD = "pkg:/images/Overhang_KMBackground_HD.png"
    theme.OverhangLogoHD  =

    app.SetTheme(theme)

End Sub
Free 24/7 Metal radio via web or smartphone
www.koshermetal.com
 
User avatar
RokuMarkn
Roku Engineering
Posts: 1581
Joined: Mon Jun 09, 2008 9:20 am

Re: XML - Categories/Levels Question

Tue Nov 01, 2011 8:37 am

When you see "syntax error" with a specific line number, you should go look at that line in your code. In your case, look at lines 41 and 46 and you'll see the problem.

--Mark
 
koshermetal
Posts: 18
Joined: Sat Oct 29, 2011 1:13 am
Location: United States
Contact:

Re: XML - Categories/Levels Question

Tue Nov 01, 2011 9:12 am

Forgive me, Mark. I'm on a PC using Windows and I see no lines in my code. All of the xml and brs files open in Notepad/Wordpad and I see no line numbers. Can you suggest an alternative method?

Thanks!
Free 24/7 Metal radio via web or smartphone
www.koshermetal.com
 
User avatar
gonzotek
** Valued Community Member **
Posts: 2206
Joined: Thu May 06, 2010 12:40 pm
Contact:

Re: XML - Categories/Levels Question

Tue Nov 01, 2011 9:19 am

koshermetal wrote:
Forgive me, Mark. I'm on a PC using Windows and I see no lines in my code. All of the xml and brs files open in Notepad/Wordpad and I see no line numbers. Can you suggest an alternative method?

Thanks!
Use a code editor, rather than a text editor. I've used Notepad++ and Crimson Editor (a personal favorite, although it hasn't had a new release in ages and may be considered outdated). Eclipse is also an option (it's much more than a simple editor, and might be intimidating to get started with, but also offers many more features). There's an official plugin for Brightscript in Eclipse, linked at the top of the forum. Someone else has posted the code for syntax highlighting in Notepad++. I've also set up Crimson Editor to syntax highlight(I still need to clean it up a little before I can post the files).
Remoku.tv - A free web app for Roku Remote Control!
Want to control your Roku from nearly any phone, computer or tablet? Get started at http://help.remoku.tv
by Apps4TV - Applications for television and beyond: http://www.apps4tv.com
 
User avatar
RokuMarkn
Roku Engineering
Posts: 1581
Joined: Mon Jun 09, 2008 9:20 am

Re: XML - Categories/Levels Question

Tue Nov 01, 2011 9:27 am

Agreed that there are better editors available. But if you really want to continue to use Notepad, you can go to a line number by Edit -> Go To. You must have Format -> Word Wrap disabled for this to work. You can also enable View -> Status Bar to display the line number at the bottom of the window.

--Mark
 
belltown
Posts: 1465
Joined: Thu Dec 09, 2010 1:43 pm
Contact:

Re: XML - Categories/Levels Question

Tue Nov 01, 2011 6:06 pm

Notepad++ is definitely a very good editor for BrightScript files. I just have the editor treat it like a Visual Basic file (go to the Languages menu and select "VB").
https://github.com/belltown/
 
koshermetal
Posts: 18
Joined: Sat Oct 29, 2011 1:13 am
Location: United States
Contact:

Re: XML - Categories/Levels Question

Wed Nov 02, 2011 7:18 pm

So my channel has been submitted and I'm stoked with how it came out. However, when I select the Channel on the Roku it displays the icons from right to left, instead of from left to right.

I know it's a minor issue, but does anyone know how to fix it?
Free 24/7 Metal radio via web or smartphone
www.koshermetal.com
 
edunn@lifeminute.tv
Posts: 17
Joined: Tue Oct 25, 2011 1:44 pm

Re: XML - Categories/Levels Question

Mon Nov 07, 2011 2:11 pm

So have these modifications been successful for anyone? I tried applying them to my app, and it came up with a number of syntax errors in appHomeScreen.brs

I'd really like to get those subcategories out of there. I'm wondering if I made a mistake of my own somewhere...

Thanks so much everyone.
 
bandal
Posts: 260
Joined: Sat Oct 15, 2011 2:17 pm

Re: XML - Categories/Levels Question

Thu Nov 10, 2011 8:35 am

While on the topic of Category Leaf, how to change the Graphic image size next to Resume Playing and Start from Beginning in the videoplayer example? All Graphics are OK in arced-portrait until I drill down to the show itself. Using the xml to make my changes or additions.

DA.
 
joetesta
Posts: 790
Joined: Wed Apr 20, 2011 11:48 am

Re: XML - Categories/Levels Question

Thu Nov 10, 2011 4:52 pm

edunn@lifeminute.tv wrote:
So have these modifications been successful for anyone? I tried applying them to my app, and it came up with a number of syntax errors in appHomeScreen.brs

I'd really like to get those subcategories out of there. I'm wondering if I made a mistake of my own somewhere...

Thanks so much everyone.


Hi there - see my post here: http://forums.roku.com/viewtopic.php?f=34&t=26563#p304237
The other day I started with a fresh SDK & went through this and confirmed that it is correct / successfully removes the leafs. The ONLY thing I left out is that you need to update your XML to include a 'feed' for the top level 'category' elements.
cheers,
Joe
aspiring
 
bandal
Posts: 260
Joined: Sat Oct 15, 2011 2:17 pm

Re: XML - Categories/Levels Question

Thu Nov 10, 2011 10:29 pm

Joe,
I will test this out Friday. Since I keep the leafs, looks like the categoryFeed.brs section needs the additional code. I assume the e@sd_img needs the changed too.
DA

Update, no change messing with child nodes and kids image attributes. My show still shows a graphic picture scrunched up next to the Play Button. But all other graphics above this category Leaf is the normal tall image of a DVD poster.
I am still trying to find where the size of the graphic image is controlled on the last Play screen.
 
joetesta
Posts: 790
Joined: Wed Apr 20, 2011 11:48 am

Re: XML - Categories/Levels Question

Fri Nov 11, 2011 1:26 pm

bandal wrote:
I am still trying to find where the size of the graphic image is controlled on the last Play screen.


Hi bandal,
If you look in the Documents -> ComponentReference.pdf -> 4.4 roSpringboardScreen

If the ContentType is audio, the album art dimensions are:
SD: 124 x 112
HD: 188 x 188
If the ContentType is episode, the album art dimensions are:
SD: 180 x 122
HD: 264 x 198
If the ContentType is any other value, the album art dimensions are:
SD: 112 x 142
HD: 148 x 212

I think that's what you're looking for. The ContentType is set in the xml. For this particular screen you are limited to those options.
aspiring
 
bandal
Posts: 260
Joined: Sat Oct 15, 2011 2:17 pm

Re: XML - Categories/Levels Question

Fri Nov 11, 2011 3:18 pm

Yes, I did see this and I tried episodic and another type not listed to see the results from each. Somehow, the artwork is still scrunched up. I scanned the DVD cover and set the dimensions to eripodic for the SD and HD image, and from top to bottom of image is like compressed in the play area. I will mess more with this, but the wife said it is OK and not a big issue. Next will be the star removal, but the SetStaticRatingEnabled can't be found in the .brs files for videoplayer or my notepad++ isn't searching correctly. Thanks..

DA
 
bandal
Posts: 260
Joined: Sat Oct 15, 2011 2:17 pm

Re: XML - Categories/Levels Question

Mon Nov 14, 2011 3:10 pm

Got the photo to work as I want. The "item.ContentType = "movie" in the showFeed.brs in the videoplayer example was set to movie and the photo looks as it should for a DVD Poster.

The graphical stars is what I need to remove next. I removed the color in the star rating, but not the star graphic.

Update to the Star Rating removal. Find it here. viewtopic.php?f=34&t=44949

DA

Who is online

Users browsing this forum: No registered users and 11 guests