Kodi Community Forum

Full Version: Does RSS support Visibility?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
i cannot get rss to support visibility conditions. it always shows even when buttons with the same conditions do not.

home.xml...

Quote:<!-- rss scroller - lower center -->
<control>
<description>rss feed</description>
<type>rss</type>
<id>1</id>
<posx>0</posx>
<posy>475</posy>
<width>720</width>
<font>font13</font>
<urlset>1</urlset>
<titlecolor>ffffd200</titlecolor>
<headlinecolor>ddced8da</headlinecolor>
<textcolor>60ffffff</textcolor>
<include>home-rss</include>
</control>

includes.xml...
Quote: <!-- rss -->

<include name="home-rss">
<visible>!player.hasvideo | ![player.hasmedia + system.idletime(60)]</visible>
<animation effect="fade" time="1000">visiblechange</animation>
<animation effect="fade" time="600">windowopen</animation>
</include>
the code works fine.

it's set up to show the feed if:

you aren't playing video or

you aren't playing media or

the system has not being idle for 60 seconds.

the only time it hides, therefore, is if you are playing video and the system has been idle for 60 seconds, where it fades out.

cheers,
jonathan
i thought its setup for:

you aren't playing video or

you aren't playing media and the system has not being idle for 60 seconds.
it is not working for me... i have even set the timeout to 5 seconds. i play a cd and all other buttons/images fade away, but not the rss.
i repeat:

the only time it will hide is if you are playing video and you are idle for the idle time.

!a | !(b + c) = !a | !b | !c

this states when it is visible.

it is therefore hidden when !(!a | !b | !c) = a + b + c

ie the only time it'll be hidden is if you are playing video and playing media and are idle for 60 seconds.

cheers,
jonathan
(jmarshall @ april 05 2006,14:27 Wrote:i repeat:

the only time it will hide is if you are playing video and you are idle for the idle time.

!a | !(b + c) = !a | !b | !c

this states when it is visible.

it is therefore hidden when !(!a | !b | !c) = a + b + c

ie the only time it'll be hidden is if you are playing video and playing media and are idle for 60 seconds.

cheers,
jonathan
with standard math notation, !a | ![b + c] should not equal !a | !b | !c

do the conditions not follow standard math notation?

my interpretation using standard mathematic grouping of:
!player.hasvideo | ![player.hasmedia + system.idletime(60)]

would mean...

take what is in the [] first, add them to become a single unit of measurement, then not that unit (the !Wink

... then evaluate the statement left to right after that.
don't argue with a mathematician Wink

remember: it's and, not add. it's plain boolean logic.

draw a venn diagram if you are still not convinced.

cheers,
jonathan
i'm no math major but i took up to diff eq for my engineering degree and i still remember it being this way...

the [] in conjunction with and should cause you to evaluate that portion of the equation first, right?

so it should end up being...

!side1 or !side2

so that side2 is the outcome of all arguments within the []


in order for side2 to be true the outcome of all arguments anded together must be true.

in my example code the player would need to have media and the system idle for 60 seconds in order for it to be true. there is no or in that at all.

if this is not the case, there is no reason at all to use [] if you are not going to evaluate that portion first.
here's a venn diagram for you - yeah, i'm a lecturer Wink

Image

the red circle represents player.hasmedia. the yellow circle is player.hasvideo. the blue circle is system.idletime(60).

the second expression (player.hasmedia + system.idletime(60)) is the green and magenta segments.

thus ![player.hasmedia + system.idletime(60)] is everything except the green and magenta segments (ie the white, red, blue, and yellow bits). ***

when we or this with !player.hasvideo (everything outside the yellow circle, ie the white, red, blue and magenta bits) we get the white, red, blue, magenta and yellow bits.

ie the control is visible as long as we're not in the green segment, which corresponds to having video playing and the system being idle for 60 seconds.

i think the error you were making was treating the + as some sort of a "set add" (which is effectively or) instead of and.

and yes, the [] are evaluated first as i did above.

cheers,
jonathan

*** note that this is the same as !player.hasmedia or !system.idletime(60) - this is a general rule: ![a + b] = (!a) | (!b)



ok, so the brackets are useless in my situation. so how do i get to where i want to be...

where:

is idle=60 and hasmedia is evaluated !(true/false)

then is ored with !hasvideo

to get the outcome?
the brackets are not useless, the expression is being evaluated correctly in exactly the way you state. (and operation within brackets done first, then the not, then the or).

the issue is the expression is just not the one you are after.



what expression gets me what i want? how do i make the right side evaluate together and exclusive of the left?
i have no idea what it is you want.

i suspect it is something like:

no matter what is playing, please fade out the rss feed after 60 seconds.

if video is playing, fade it out immediately.

if so, you want it hidden when:

1. player.hasvideo

or

2. player.hasaudio + system.idletime(60)

thus, you want it visible when:

![player.hasvideo | [player.hasaudio + system.idletime(60)]]

note that this can be simplified to:

!player.hasvideo + ![player.hasaudio + system.idletime(60)]

using player.hasmedia in place of player.hasaudio won't make a difference either (as video playback doesn't get you past the first condition).

note that this is quite close to what you had Wink

cheers,
jonathan
so was i right with my statement:

playing video or !(playing media and idle for 60 )

or is it :

playing video | !playing media | !idle for 60

so if he was playing audio but was only idle for 30:

false | !(true and false)
or is it
false | !true | !false

the only confusion for me is first jmarshall said it was or and now and. was that a typo or am i just stupid. i ask out of curiosity not for a argument. i just wana learn :d
i think i've just relised my stupid mistake(maybe) lol

+ = or
not +=and

x=and?

man i realy need to work on my logic here
Pages: 1 2