Skinning Engine Conditional Bug...
#1
currently i'm using the following conditional to check for focus of a specific item
!player.hasaudio | player.hasaudio + !control.hasfocus(50)

but it needs to actually check 3 controls for focus (list, big list, thumbnail list)

!player.hasaudio | player.hasaudio + [!control.hasfocus(50) | !control.hasfocus(51) | !control.hasfocus(52)]
or
!player.hasaudio | player.hasaudio + !control.hasfocus(50) | player.hasaudio + !control.hasfocus(51) | player.hasaudio + !control.hasfocus(52)

infortunaly do not work.
is it my syntax? is there a limit to the number of or operators you can use?



Reply
#2
i dont know what our "order of operations" are, so you may want to try bracketing a bit differently like this:

!player.hasaudio |
[player.hasaudio + !control.hasfocus(50)] |
[player.hasaudio + !control.hasfocus(51)] |
[player.hasaudio + !control.hasfocus(52)]
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
#3
according to manual
Quote:the and operator takes precedence over the or operator when evaluating the logic, and operators are read from left to right.
http://manual.xboxmediacenter.de/wakka.p....y&v=mzf

i will test this evening and confirm if its a order of operations bug or not
Reply
#4
neg

that breaks the entire condition as well. perhaps we could pop this over to the bug discussion forum



Reply
#5
i agree without alot of thought and massive cross logic eg (is it not 2+3+4+5 instead of is it 1) it doesnt work.

so basically it makes life really hard as logic is broken with ors.

cheers
Reply
#6
bug tracker link
http://sourceforge.net/tracker....=581838
Reply
#7
ok, let's see what you are trying to achieve:

!player.hasaudio | player.hasaudio + !control.hasfocus(50)

this, in a <visible> tag will show the control (i assume it is control 50 you are applying this to?) if the player doesn't have audio, or the player has audio and another control has focus.

not sure if this is what you want??

but it needs to actually check 3 controls for focus (list, big list, thumbnail list)

!player.hasaudio | player.hasaudio + [!control.hasfocus(50) | !control.hasfocus(51) | !control.hasfocus(52)]

this will show the control if the player isn't playing audio, but the second bit doesn't make sense.

you've specified !a | !b | !c, which is true if a is false, or if b is false, or if c is false. note that this will be false only if a, b and c are all true. in the above expression, a, b and c are mutually exclusive, so !a | !b | !c will never be false, thus will always be true. you've thus effectively got:

!player.hasaudio | player.hasaudio + true

which ofcourse is true! thus, it'll always show Smile

!player.hasaudio | player.hasaudio + !control.hasfocus(50) | player.hasaudio + !control.hasfocus(51) | player.hasaudio + !control.hasfocus(52)

this is the same (you've just distributed the player.hasaudio + over the or operations)

eg a + (b | c | d) = a+b | a+c | a+d

you are probably wanting:

!player.hasaudio | control.hasfocus(50) | control.hasfocus(51) | control.hasfocus(52)

this will show the lists if the player isn't playing, or if one of the lists is focused 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
#8
!player.hasaudio | control.hasfocus(50) | control.hasfocus(51) | control.hasfocus(52)

yes this would be great at the moment you have to reverse the logic to + is nots, instead of ors. cheers jmarshal. when will the slide feature go into cvs?



Reply
#9
britneyspairs:

if the above doesn't work (which i doubt) then there may be a bug.

my point is that i'm pretty sure there isn't a bug at all.

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
actually it is not applied to control id 50. it is applied to all buttons and background textures in mymusicnav. the objective of the operation is to make the background and buttons visible when
a) no music is playing
b) when music is playing but control 50/51/52 is not focused.

this results in buttons and portions of the background fading out when the list control is focused. when the user navigates back to any other button the same portions of the background and the buttons reappear. illustrated here
pic1 vs pic2
see it in action with this patch rar archive

!player.hasaudio | control.hasfocus(50) | control.hasfocus(51) | control.hasfocus(52)

unfortunatly this results in the background being faded when music is not being played.

!player.hasaudio | player.hasaudio + [!control.hasfocus(50) | !control.hasfocus(51) | !control.hasfocus(52)]

should mean
a) is player is not playing audio
b) if player is playing and control 50/51/52 is not focused

if any hasfocus returns true the entire [50/51/52] portion should return true correct? (which is turned into a false with !Wink


just to add more confusion (at least on my part) today i used a condition
control.hasfocus(301) | control.hasfocus(302) | control.hasfocus(303) | control.hasfocus(304)
and it seems to work fine.

if you want to use my pack thing to test modify line 336 of mymusicnav this will cause the sort:by button to not fade out while music is playing and the list control is focused

im not sure if its my retardedness or a bug... thanks for taking a look though



Reply
#11
that's cool,

this bit:

[!control.hasfocus(50) | !control.hasfocus(51) | !control.hasfocus(52)]

is not right though. you want ands instead of nots. as it stands, it'll be be false only if controls 50, 51 and 52 are simultaneously focused (which will never happen), thus it will always be true.

having this:

[!control.hasfocus(50) + !control.hasfocus(51) + !control.hasfocus(52)]

will do what you want. this is equivalent to:

![control.hasfocus(50) | control.hasfocus(51) | control.hasfocus(52)]

which makes perfect sense.

you therefore want:

!player.hasaudio | player.hasaudio + ![control.hasfocus(50) | control.hasfocus(51) | control.hasfocus(52)]

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

Logout Mark Read Team Forum Stats Members Help
Skinning Engine Conditional Bug...0