Question about References.xml
#1
I have been searching for two days now, but I cannot find much information about References.xml, or includes.xml. I think I've got them mostly figured out, but I'm still having problems with references and I'm hoping for some help.

First, what I think is the right way to use these files:

includes.xml: Put code snipets here that will be used on several controls, using name="blah", then calling it by name with include tags in other .xml files... This only works when the name is typed in all lowercase letters.

references.xml: Put generic controls here that can be loaded in other .xml files, allowing for a standard control that you can "shorthand" by only using tags that need to change from default in other places.

The problem I'm having is that only the first thing defined in references.xml seems to be recognized when I use the control somewhere else. EG: I have three control definitions in references.xml, I try to call these in home.xml, but only the first one works. I have tried different ids, and I have tried changing the order in which they appear, and nomatter which one is defined first, only it will work as I think they should.

Here is my code from references.xml:
Code:
<controls>
  <control>
       <description>default background image</description>
       <type>image</type>
       <id>1</id>
       <posx>0</posx>
       <posy>0</posy>
       <width>720</width>
       <height>576</height>
       <texture>shared\MainBackground.png</texture>
       <visible>![Player.HasAudio + System.IdleTime(60)]</visible>
  </control>
  <control>
    <description>main info background</description>
       <type>image</type>
        <id>22</id>
        <posx>170</posx>
        <posy>33</posy>
        <width>521</width>
        <height>64</height>
        <texture>shared\MainInfoBackground.png</texture>
       <visible>![Player.HasAudio + System.IdleTime(60)]</visible>
    <animation effect="slide" start="0,470" time="700" delay="200" condition="!Skin.HasSetting(animated)">WindowOpen</animation>
    <animation effect="slide" end="0,470" time="700" delay="200" condition="!Skin.HasSetting(animated)">WindowClose</animation>
  </control>
  <control>
    <description>default peepHole border</description>
       <type>image</type>
        <id>21</id>
        <posx>174</posx>
        <posy>97</posy>
        <width>515</width>
        <height>328</height>
        <texture>shared\PeepHoleBorder.png</texture>
       <visible>![Player.HasAudio + System.IdleTime(60)]</visible>
    <animation effect="zoom" start="0" end="100" center="360,240" time="700" delay="200" condition="!Skin.HasSetting(animated)">WindowOpen</animation>
    <animation effect="zoom" start="100"end="0" center="360,240" time="700" delay="200" condition="!Skin.HasSetting(animated)">WindowClose</animation>
  </control>
</controls>

This is from home.xml:
Code:
<control>
       <description>default background image</description>
       <type>image</type>
       <id>1</id>
  </control>

  <control>
    <description>default peepHole border</description>
       <type>image</type>
        <id>21</id>
  </control>

  <control>
    <description>main info background</description>
       <type>image</type>
        <id>22</id>
  </control>

If I put it in home.xml it works perfectly, but these are all things that I think I'll be trying to use on many pages so I thought they should go in references.xml...

Anyway, I hope this hasn't been to long, and I really appreciate any help with this. I'll check back tomorrow and hope for the best.

Thanks -- Krusty
Reply
#2
Oh yea, I'm using the XBMC-2.0.0-FINAL-FAT-T3CH Built on Sep 29 2006.

Thanks again for any help Smile
Reply
#3
references.xml just loads the first one of each type, exactly as you suspect.

The best info regarding the skinning engine has been written pretty much all by me, and is in the online manual.

Please add to it if you find anything you don't quite understand.

Note that IMO References.xml is pretty much unneeded nowadays with includes.xml available.

You can include entire controls from includes.xml, and if you want to override certain things, then make an include with all the default tags, then do:

<include name="defaultbuttontags">
<id>12</id>
<type>button</id>
<posx>12</posx>
</include>

<control>
<include>defaultbuttontags</include>
override stuff here
</control>

Note that there'll soon be some new fun stuff added now that we're about to leave the feature freeze. Stuff such as groups treated as controls, so you can do animations on a bunch of controls by just specifying it once etc.

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
Reply
#4
Thank you! This has been driving me nuts, I've been searching the manual, these forums, Chokemaniac's forums, xbox-scene, even the source code, (though that was like trying to read Latin or something). Somehow I didn't make the connection that it was the first one of each type in the references.xml, or that I could include entire controls in the includes.xml.
Quote:Note that there'll soon be some new fun stuff added now that we're about to leave the feature freeze. Stuff such as groups treated as controls, so you can do animations on a bunch of controls by just specifying it once etc.
This would be awsome, it is exactly what I had hoped a controlgroup would do, but actually does not. The one other thing that would be nice, if it doesn't exist yet, is a tag for focused text...

Anyway, thanks again, I'll get back to playing with this again. Smile
Reply
#5
Okay! So far far I have figured out that includes.xml is a very cool thing. You can include previous includes into an include, and you can put entire blocks of controls in an include, then call it in a page.xml file without wrapping it in a control.

Like this:
Code:
<window>

<id>0</id>
<defaultcontrol>2</defaultcontrol>
<allowoverlay>no</allowoverlay>

<controls>
  <include>backgroundrotators</include>
  <include>defaultbackground</include>
  <include>defaultclock</include>

--------------SNIP----------------
Wham... There's 3/4 of my home page, and since I'm planning on using pretty much uniform pages I can just change the id tag, delete or add a few lines, and have most of a new page already done.

Very nice..

Anyway, if nobody minds, I would like to keep posting my progress and whatnot here so that I can remember it later, and so people might comment on what I'm getting right or wrong. Hopefully it'll turn into a thread that might help other newbies, or maybe even help with the writing of a wiki page...

Thanks to the Dev's for making a great product -- Krusty Smile
Reply
#6
Sure, that'd be great. Any useful details effectively adds to the documentation. Ideally, you'd write up a a couple of step by steps explaining the trickier aspects. Smile

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
Reply
#7
Includes are very nice... but don't get to nested otherwise trying to figure out what is where gets tedious.

What Krusty really seems to need is Templates... where you can create an XML template and then build new screens referencing the template. I asked for this a few years ago, it was ignored but it really is just a more robust version of Includes.
I'm not an expert but I play one at work.
Reply
#8
Affini Wrote:Includes are very nice... but don't get to nested otherwise trying to figure out what is where gets tedious.

Yea, I've noticed that, it seems pretty easy to get carried away....

Affini Wrote:What Krusty really seems to need is Templates... where you can create an XML template and then build new screens referencing the template. I asked for this a few years ago, it was ignored but it really is just a more robust version of Includes.

I was thinking it would be great if the include tag also had a src attribute. Something that would allow .xml files to be placed in a folder, possibly called something like "includes", then if a file was called with the src attribute it would just basically cram the entire contents of the file in that spot before moving on to the next line.

I'm not a real programmer, so I may be way off on this, but I think that could help things out alot. Not only would it make things easier for the skinners to organize, but it would allow things to be included without all of the code for it having to be read when the skin loads. It's a thought anyway...

-- Krusty
Reply

Logout Mark Read Team Forum Stats Members Help
Question about References.xml0