Xbmc coder and expert with <id>s please read
#1
i (and others) run into problems with <id>s constantly!

the problem is not knowing what numbers can be used when building buttons and using the "wrong" ids that screw things up!


example:

within xboxmediacenter.xml
Quote: <control>
<type>image</type>
<id>120</id>
<posx>100</posx>
<posy>105</posy>
<width>640</width>
<height>362</height>
<texture>home_radio.png</texture>
</control>

within home.xml in buttonscroller <homebuttons>
Quote: <button>
<description>webradio</description>
<label>web radio</label>
<execute>q:\scripts\kmlbrowse.py</execute>
<icon>120</icon>
</button>

i'd "think" that when that button is selected the image would change to the icon # given... but nooooo, instead it that icon shows on the screen always? if i remove that id, it works as expected.

<rant>

wtf? i already skipped 110-114 because they screw things up too.. what freak'n numbers actually work?

it would be nice if whoever owns that portion of the code mod'd it to allowed the ids to be alphanumeric and not just numbers. the id scheme is very confusing and not easy to keep track of... add a one on the front if; do the hokey pokey and that id will turn water into wine... blah blah.

at least if the id is alphanumeric it can be self explainatory if the skin designer makes it so.

please fix, i'm begging :bowdown:
</rant>
I'm not an expert but I play one at work.
Reply
#2
i'm very new to this, but here is how the home.xml works.

if you have a <type>button</type> with <id>2-19</id> it will show <type>image</type> with <id>102-119</id> (the id # plus 100, not sure if it has to be <type>image</type>)

the <type>buttonscroller</type> has to be <id>300</id> and the associated <type>image</type> with <id>102-119</id> will be shown based on what you have in home.xml <icon>102-119</icon>. these are also associated with <type>image</type> with <id>122-139</id> and <type>image</type> with <id>142-159</id> (+20 and +40) these are alternate focus and non focus graphics.

hth

edit: as you noticed <id>10-14</id> are:
#define control_btn_shutdown 10
#define control_btn_dashboard 11
#define control_btn_reboot 12
#define control_btn_credits 13
#define control_btn_online 14

you can use them, it's just they do the predefined function.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#3
the reason there is no documentation is because noone such as yourself has taken the time to add it to the online manual.

i documented the button scroller quite succintly when it was first added - it's all there in either the v1.1 plus skin thread, or the thread describing what the skinners initially wanted. i even believe there is some info on this in the online manual.

yes, i agree that it would be nice to have more documentation as to what is "special" id's and what isn't. i just don't have the time to write it all up - anyone with the source will be able to see immediately which ones do what - they're all #define'd up the top of each of the window files. i believe someone has even written a program for themselves to grep these out.

the reason they are integers is purely a performance thing. comparing an int is miles faster than comparing a string.

i'm trying to remove all the "special" meaning of buttons for example via the execute strings. some will always remain - once again for performance considerations.

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
a while back, i wrote a little perl script to pull these all out of the source and cross-reference them to the correct xml files. i'll revisit that script and make sure it still works. should i wait until after skin version 1.3 is in place to post the results?
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.
Reply
#5
kraqh3d:

yeah, better had. pm 3 still isn't 1.3 compliant quite yet. a few id's to change and some other stuff that needs organising.

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
#6
the fewer "special" id's the better.

any static images or labels should use an id of 1. if it's linked to a control, then it needs a unique id number. a perfect example of this is the button scroller which uses a fixed offset.

and those special id's for the home window should probably be removed at some point. they're mostly all already replaced by built-in commands. (i think only kai doesnt have a command yet.) then they can be put anywhere.
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.
Reply
#7
i know that it is faster to parse int (integers) but even if you put a character limit on the ids it would be nice to use alpha characters to reduce the "rules" you've put on referencing and such. could using alpha slow things down that much?

i'd like to see us get to the point where we simply define all objects (buttonscrollers, images/icon, buttons, etc) within 'xboxmediacenter.xml' and just use references (ie... ids) within the other xml files to "display" the defined objects.

this would greatly simply and streamline things plus make skinning much more "pure"... we could have "true skins" (ie just replace the images, not change the functionality) if the skinner wanted... but it would give the option of still adding functionality also if the skinner wanted.
I'm not an expert but I play one at work.
Reply
#8
i got the script working again and i noticed a few possible problems with the pm3 skin...

window id 10105 is used by the following skin files:
pointer.xml
dialogsubmenu.xml

window id 12004 is used by the following skin files:
dialogscriptinfo.xml
musicoverlay.xml
videooverlay.xml

shouldnt these all have unique window id's?
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.
Reply
#9
they probably should, although it won't cause any problems.

the reason is that 4 of the 5 windows there (all but dialogsubmenu.xml) are "special" in that they are always around, and are not added to the windowmanager.

probably best to assign them id's - will do so for the next skin version after v1.3 - not that it'll effect things.

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
#10
there's also some "illegal" xml in pm3. several skin files have controls defined like this:

<*control>
....
<*/control>

perl's expat does not like it. it complains that it's malformed xml.
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.
Reply
#11
does it complain if it's <*control> ... </*control> ? it's just chokeman's way of "commenting" bits out.
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
#12
i'm not sure... i just know it barfed when it hit those asterick'ed tags.  expat must be less tolerant than tinyxml.

i just removed the astericks in the meantime.  i'm only cross referencing the controls found in the cpp file to an xml file so i can get information like the control type and description from there.

here's a sample of the output. (there's a few controls in each window that dont seem to get correctly cross-referenced to a control in the skin file. i havent really looked at why yet.)

Quote:------------------------------------------------------------------------------------------

window id = 12700
------------------------------------------------------------------------------------------

xml = mybuddies.xml
cpp = guiwindowbuddies.cpp
------------------------------------------------------------------------------------------
control_btnmode                    3012 button              mode button
control_btnjoin                    3013 button              join (friends)
control_btninvite                  3014 button              invite (friends)
control_btnremove                  3015 button              remove (friends)
control_btnspeex                   3016 button              speex (friends)
control_listex                     3031 listcontrolex       arena list
control_btnplay                    3033
control_btnadd                     3034 button              add (arenas)
control_btnhost                    3035 button              host (arenas)
control_btnkeyboard                3036 button              keyboard (chat)
control_labelbuddywin              3050
control_labelusername              3051 button              username
control_labelupdated               3052 button              arena name
control_imagelogo                  3053
control_imagebuddyicon1            3060 image               buddy (offline) icon
control_imagebuddyicon2            3061 image               buddy (online) icon
control_imageopponent              3062 image               opponent icon
control_imagearena                 3063 image               arena icon
control_imageme                    3064 image               my avatar icon
control_labelbuddyname             3070 fadelabel           buddy name
control_labelbuddystat             3071 fadelabel           buddy status
control_labelbuddyinvt             3072 label               buddy invitation status
control_labelplayercnt             3073 label               player count
control_kai_console                3074 console             console control
control_kai_textedit               3075 edit                edit control
control_kai_textedarea             3076 image               chat panel
control_kai_tab_friends            3080 button              friends tab
control_kai_tab_games              3081 button              games tab
control_kai_tab_arena              3082 button              arenas tab
control_kai_tab_chat               3083 button              chat tab
------------------------------------------------------------------------------------------

commenting out a control should really be done by surrounding the control with comment tags.
<!--
<control>
...
</control>
!-->
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.
Reply
#13
agreed - i'll update the skin with these tonight. best practise is always best.

nice script. could it be no <description> tag available? if so, an easy fix.

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
#14
lol i wish it was that easy. i double checked them and they are definately in the skin with both a type and description tag. i need to debug it bit more this weekend to figure out why it ignores some of them. i just havent had the time to single line advance it through the perl debugger to see whats up.
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.
Reply
#15
jmarshall,
anymore thoughts about making the ids more "flexible"?

also...
can you publish a complete list of reserved ids and with what tags they are a reserved id?


thanks!
I'm not an expert but I play one at work.
Reply

Logout Mark Read Team Forum Stats Members Help
Xbmc coder and expert with <id>s please read0