Working on adding FanArt support to XBMC skinning-engine

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
agathorn Offline
Team-XBMC Developer
Posts: 497
Joined: Nov 2007
Reputation: 2
Thumbs Up  Working on adding FanArt support to XBMC skinning-engine
Post: #1
So we've hashed out a lot of stuff over in the FR thread:
http://xboxmediacenter.com/forum/showthr...083&page=2

And i've started work on the code for Fanart support. Now while I did agree to step up and do this, I certainly wouldn't be averse to help if anyone wants to give it Smile I'm most comfortable with the GUI code in XBMC so that is where i'm starting. If anyone wants to work on how the Fanart images/data will be retrieved/scraped I would be most grateful, but if not then i'll burn that bridge when I cross it.

This is my "todo" list as it were:
  1. Add support for expansion of infolabels in various key tags
  2. Add infolabels for the 6 fanart colors
  3. Add infolabel for fanart image
  4. Perhaps add an .nfo reader for local fanart data, or maybe expand the existing one used for movies. I havent' looked at this at all yet so not positive.
  5. Add some method of scraping fanart data from TVDB and storing that data
The first three items I am most confortable taking care of, and would be most appreciative of any help with the last two.

Got Fusion?, a media-centric skin for XBMC.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
spiff Offline
Retired Developer
Posts: 12,386
Joined: Nov 2003
Post: #2
for local fanart / scraped fanart see CVideoInfoTag::Load() (and Save()). just add another member variable and a suitable xml tag, that tag will be read from nfo files and from the xml returned from the scraper. if you need to store it, find a suitable column (see the enum's and structs in VideoDatabase.h).
find quote
agathorn Offline
Team-XBMC Developer
Posts: 497
Joined: Nov 2007
Reputation: 2
Post: #3
spiff Wrote:for local fanart / scraped fanart see CVideoInfoTag::Load() (and Save()). just add another member variable and a suitable xml tag, that tag will be read from nfo files and from the xml returned from the scraper. if you need to store it, find a suitable column (see the enum's and structs in VideoDatabase.h).

Thanks spiff, i'll take a look at that when I get to that point. I appreciate the point in the right direction.

Got Fusion?, a media-centric skin for XBMC.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
plex Offline
Senior Member
Posts: 107
Joined: Mar 2008
Reputation: -10
Post: #4
I can help with #5, I'm pretty good at coming up with short algorithms to parse data, show me a couple examples of your expected matches within the haystack, and a couple haystacks, and anything else I need to know.
find quote
Gamester17 Offline
Team-XBMC Forum Moderator
Posts: 10,523
Joined: Sep 2003
Reputation: 9
Location: Sweden
Information  Get started here...
Post: #5
plex Wrote:I can help with #5, I'm pretty good at coming up with short algorithms to parse data, show me a couple examples of your expected matches within the haystack, and a couple haystacks, and anything else I need to know.
You will need to start by download the latest tvdb.xml as the RegEx XML code for it should be added to it as an option (similar to how IMPAwards and MoviePosterDB are options in imdb.xml, so you want to download that as well to use as an example):
https://xbmc.svn.sourceforge.net/svnroot...ers/video/

Also read up on TheTVDB's API:
http://www.thetvdb.com/wiki/index.php?ti...ammers_API

Then you want to read (and reply if needed) to this topic thread:
http://forums.thetvdb.com/viewtopic.php?p=2777

PS! More about the XBMC's own scraper API can be found in our wiki:
http://wiki.xbmc.org/?title=How_To_Write...o_Scrapers
http://wiki.xbmc.org/?title=Scraper
http://wiki.xbmc.org/?title=Scrap
http://wiki.xbmc.org/?title=Import_-_Exp...eo_Library
http://wiki.xbmc.org/?title=Regular_Expr...9_Tutorial

Happy coding!

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
agathorn Offline
Team-XBMC Developer
Posts: 497
Joined: Nov 2007
Reputation: 2
Post: #6
Thanks for the help. Don't rush out though because they're still tying up all the loose ends at TVDB so the API probably doesn't include the support for Fanart quite yet. Keep an eye on that thread Gamester17 pointed out at the TVDB forums.

Got Fusion?, a media-centric skin for XBMC.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
agathorn Offline
Team-XBMC Developer
Posts: 497
Joined: Nov 2007
Reputation: 2
Post: #7
added: initial support for infolabels in <textcolor>, <shadowcolor>, and <disabledcolor> in Label controls.

Got Fusion?, a media-centric skin for XBMC.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 25,689
Joined: Oct 2003
Reputation: 169
Post: #8
What's your plan in that regard? It's best to make it as universal as possible IMO.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
agathorn Offline
Team-XBMC Developer
Posts: 497
Joined: Nov 2007
Reputation: 2
Post: #9
jmarshall Wrote:What's your plan in that regard? It's best to make it as universal as possible IMO.

I want to. Unfortunately in looking at it, the system really wasn't designed to be universal. Ideally every tag should be able to parse an infolabel, but it looks like it just wasn't set up to allow this. Without a major rewrite I don't see it happening, but you know the code better than I.

Right now i'm just handling required tags on a per-case basis, and expanding the infolabels at render time for the colors. However it isn't done, and i'm having some problems with it so I may step back a few levels and re-think it. Certainly open to suggestions.

Got Fusion?, a media-centric skin for XBMC.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 25,689
Joined: Oct 2003
Reputation: 169
Post: #10
How I'd do it is replace all instances of color (there's not that many I think - diffusecolor, and the text/focus/select/shadow colors) with a CColor class, which combines the color with the integer condition. Then you have a Get() routine to request the color. This causes the infomanager to be hit every frame though, but I don't really see any way around that to be honest.

One thing you'll need to watch is that the colors for text are in general passed to the GUITextLayout class (where the text is cached) so you'll need them there as well.

Any ideas you have would be great to know - we can chat via IRC or gchat or whatever if you like - PM me for my gmail info, and let me know when a good time for you is. I'm normally around 8-22 NZ time.

Cheers,
Jonathan

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
Gamester17 Offline
Team-XBMC Forum Moderator
Posts: 10,523
Joined: Sep 2003
Reputation: 9
Location: Sweden
Post: #11
jmarshall Wrote:It's best to make it as universal as possible IMO.
Universal as in it should be able to be used in the music section as well as the videos (TV-Shows) section?

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
agathorn Offline
Team-XBMC Developer
Posts: 497
Joined: Nov 2007
Reputation: 2
Post: #12
jmarshall Wrote:How I'd do it is replace all instances of color (there's not that many I think - diffusecolor, and the text/focus/select/shadow colors) with a CColor class, which combines the color with the integer condition. Then you have a Get() routine to request the color. This causes the infomanager to be hit every frame though, but I don't really see any way around that to be honest.

One thing you'll need to watch is that the colors for text are in general passed to the GUITextLayout class (where the text is cached) so you'll need them there as well.

Any ideas you have would be great to know - we can chat via IRC or gchat or whatever if you like - PM me for my gmail info, and let me know when a good time for you is. I'm normally around 8-22 NZ time.

Cheers,
Jonathan

That is pretty much how I did it, though I packed the data in a bit tighter, since I didn't want to use up too much memory.

Got Fusion?, a media-centric skin for XBMC.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
agathorn Offline
Team-XBMC Developer
Posts: 497
Joined: Nov 2007
Reputation: 2
Post: #13
Ok so my original plan was pretty similiar to what you suggested JM, but I was trying to minimize the memory overhead so instead of making a new class to contain the new colors, I was packing things into the existing color variables, with a couple booleans to work as flags.

This wasn't working properly though and as I dug around trying to find what was wrong, I realized I was missing a part of the infolabel parsing.

In hindsight now I think a class like you suggest is a better alternative considering the amount of code needed. Like I said originally I wanted to avoid that new memory overhead, but since it doesn't seem an issue to you that's what i'm going to go ahead and do.

Thanks for the tip!

Got Fusion?, a media-centric skin for XBMC.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
agathorn Offline
Team-XBMC Developer
Posts: 497
Joined: Nov 2007
Reputation: 2
Post: #14
Rewrote the underlying color code for <textcolor>, <focusedcolor>, <selectedcolor>, <shadowcolor>, and <disabledcolor> to use a new "infolabel aware" class, CGUIInfoColor

The above tags now support infolabels in all controls that use them including:
ButtonControl
ButtonScroller
CheckMarkControl
FadeLabelControl
LabelControl
ListItem
ListLabel
MultiSelect
RSSControl
SettingsSliderControl
SpinControl
TextboxControl

Optimized CGUIInfoColor a bunch

Thanks JMarshall for all your help and support!

Got Fusion?, a media-centric skin for XBMC.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
(This post was last modified: 2008-03-14 02:07 by agathorn.)
find quote
agathorn Offline
Team-XBMC Developer
Posts: 497
Joined: Nov 2007
Reputation: 2
Post: #15
Fixed some bugs that broke CGUIInfoColor when I revamped it

BUG: RSSFeedControl isn't displaying colors properly

Got Fusion?, a media-centric skin for XBMC.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
Post Reply