Kodi Community Forum

Full Version: Logical ands and ors
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi,

i'm not sure if this is a dumb question, but still,

i want to display a picture where the player is forwarding but *not* if the player is paused. if i understand the manual correct i think i should use this tag:

<visible>[player.forwarding32x | player.forwarding16x | player.forwarding8x | player.forwarding4x | player.forwarding2x] + !player.paused</visible>

the image however is displayed even if the player is paused.
what am i doing wrong here?

tia, cheers,
cacti
that should work just fine as-is. player.paused and player.forwarding* cannot be true simultaneously, so you shouldn't even need player.paused in there.

you can also combine all the or's and just use player.forwarding.

perhaps you could paste the whole xml file and let me know how to reproduce?

cheers,
jonathan



yeah - the + is what xbmc is struggling about

youre telling it to show stuff when forwarding and simultaneously not being paused.

that logic is as twisted as this sentence

only use the + when u need two conditions at once to show it

in your case (picture when player is forwarding) this should do:

<visible>player.forwarding</visible>
hi,

after looking at it some more i saw what was wrong. i'm stacking images half over each other and was under the impression the drawn pictures would become invisible as soon as the condition that made them visible in the firstplace would change. apparently they don't.

i solved it by making separate images and hope they don't consume to much extra memory that way.

thanks for the info.

cheers,
cacti
they do become invisible once the visible condition changes to false.

if you think you found a bug, please post the xml file so i can take a look at it.
k,

Quote:<window>
 <id>115</id>
 <defaultcontrol>1</defaultcontrol>
 <visible>player.seeking | player.displayafterseek | window.isactive(videoosd) | window.isactive(musicosd) | player.paused | player.forwarding | player.rewinding</visible>
 <controls>

   <control>
     <description>seekbar background left</description>
     <type>image</type>
     <id>23</id>
     <posx>40</posx>
     <posy>495</posy>
     <width>13</width>
     <height>68</height>
     <texture>seekbar_background_left.png</texture>
   </control>
   
   <control>
     <description>seekbar background middle</description>
     <type>image</type>
     <id>23</id>
     <posx>53</posx>
     <posy>495</posy>
     <width>614</width>
     <height>68</height>
     <texture>seekbar_background_middle.png</texture>
   </control>

   <control>
     <description>seekbar background right</description>
     <type>image</type>
     <id>23</id>
     <posx>667</posx>
     <posy>495</posy>
     <width>13</width>
     <height>68</height>
     <texture>seekbar_background_right.png</texture>
   </control>

   <control>
     <description>seekbar progress</description>
     <type>progress</type>
     <id>23</id>
     <posx>124</posx>
     <posy>521</posy>
     <width>422</width>
     <height>15</height>
     <info>player.progress</info>
     <texturebg>seekbar_progress_background.png</texturebg>
     <lefttexture>seekbar_progress_left.png</lefttexture>
     <midtexture>seekbar_progress_middle.png</midtexture>
     <righttexture>seekbar_progress_right.png</righttexture>
     <overlaytexture>-</overlaytexture>
     <visible>true</visible>
   </control>

   <control>
     <description>seekbar slider</description>
     <type>slider</type>
     <id>401</id>
     <posx>124</posx>
     <posy>476</posy>
     <width>422</width>
     <height>60</height>
     <texturesliderbar>transparent.png</texturesliderbar>
     <textureslidernib>seekbar_needle.png</textureslidernib>
     <textureslidernibfocus>seekbar_needle.png</textureslidernibfocus>
     <visible>true</visible>
     <onup>1</onup>
     <ondown>1</ondown>
     <onleft>1</onleft>
     <onright>1</onright>
   </control>

   <control>
     <description>seekbar time label</description>
     <type>label</type>
     <id>1</id>
     <posx>120</posx>
     <posy>521</posy>
     <info>player.time</info>
     <font>font10</font>
     <align>right</align>
     <width>100</width>
     <height>16</height>
   </control>

   <control>
     <description>seekbar duration label</description>
     <type>label</type>
     <id>1</id>
     <posx>550</posx>
     <posy>521</posy>
     <info>player.duration</info>
     <font>font10</font>
     <align>left</align>
     <width>100</width>
     <height>16</height>
   </control>

   <control>
     <description>pause image</description>
     <type>image</type>
     <id>0</id>
     <posx>639</posx>
     <posy>519</posy>
     <height>20</height>
     <width>10</width>
     <visible>player.paused</visible>
     <texture>seekbar_pause.png</texture>
   </control>

   <control>
     <description>play 1x image</description>
     <type>image</type>
     <id>0</id>
     <posx>639</posx>
     <posy>519</posy>
     <height>20</height>
     <width>10</width>
     <visible>!player.paused + !player.rewinding</visible>
     <texture>seekbar_forward.png</texture>
   </control>

   <control>
     <description>play 2x image</description>
     <type>image</type>
     <id>0</id>
     <posx>646</posx>
     <posy>519</posy>
     <height>20</height>
     <width>10</width>
     <visible>[player.forwarding32x | player.forwarding16x | player.forwarding8x | player.forwarding4x | player.forwarding2x] + !player.paused</visible>
     <texture>seekbar_forward.png</texture>
   </control>

   <control>
     <description>play 4x image</description>
     <type>image</type>
     <id>0</id>
     <posx>632</posx>
     <posy>519</posy>
     <height>20</height>
     <width>10</width>
     <visible>[player.forwarding32x | player.forwarding16x | player.forwarding8x | player.forwarding4x] + !player.paused</visible>
     <texture>seekbar_forward.png</texture>
   </control>

   <control>
     <description>play 8x image</description>
     <type>image</type>
     <id>0</id>
     <posx>653</posx>
     <posy>519</posy>
     <height>20</height>
     <width>10</width>
     <visible>[player.forwarding32x | player.forwarding16x | player.forwarding8x] + !player.paused</visible>
     <texture>seekbar_forward.png</texture>
   </control>

   <control>
     <description>play 16x image</description>
     <type>image</type>
     <id>0</id>
     <posx>625</posx>
     <posy>519</posy>
     <height>20</height>
     <width>10</width>
     <visible>[player.forwarding32x | player.forwarding16x] + !player.paused</visible>
     <texture>seekbar_forward.png</texture>
   </control>

   <control>
     <description>play 32x image</description>
     <type>image</type>
     <id>0</id>
     <posx>660</posx>
     <posy>519</posy>
     <height>20</height>
     <width>10</width>
     <visible>player.forwarding32x + !player.paused</visible>
     <texture>seekbar_forward.png</texture>
   </control>

   <control>
     <description>play -1x image</description>
     <type>image</type>
     <id>0</id>
     <posx>639</posx>
     <posy>519</posy>
     <height>20</height>
     <width>10</width>
     <visible>!player.paused + player.rewinding</visible>
     <texture>seekbar_rewind.png</texture>
   </control>

   <control>
     <description>play -2x image</description>
     <type>image</type>
     <id>0</id>
     <posx>646</posx>
     <posy>519</posy>
     <height>20</height>
     <width>10</width>
     <visible>[player.rewinding32x | player.rewinding16x | player.rewinding8x | player.rewinding4x | player.rewinding2x] + !player.paused</visible>
     <texture>seekbar_rewind.png</texture>
   </control>

   <control>
     <description>play -4x image</description>
     <type>image</type>
     <id>0</id>
     <posx>632</posx>
     <posy>519</posy>
     <height>20</height>
     <width>10</width>
     <visible>[player.rewinding32x | player.rewinding16x | player.rewinding8x | player.rewinding4x] + !player.paused</visible>
     <texture>seekbar_rewind.png</texture>
   </control>

   <control>
     <description>play -8x image</description>
     <type>image</type>
     <id>0</id>
     <posx>653</posx>
     <posy>519</posy>
     <height>20</height>
     <width>10</width>
     <visible>[player.rewinding32x | player.rewinding16x | player.rewinding8x] + !player.paused</visible>
     <texture>seekbar_rewind.png</texture>
   </control>

   <control>
     <description>play -16x image</description>
     <type>image</type>
     <id>0</id>
     <posx>625</posx>
     <posy>519</posy>
     <height>20</height>
     <width>10</width>
     <visible>[player.rewinding32x | player.rewinding16x] + !player.paused</visible>
     <texture>seekbar_rewind.png</texture>
   </control>

   <control>
     <description>play -32x image</description>
     <type>image</type>
     <id>0</id>
     <posx>660</posx>
     <posy>519</posy>
     <height>20</height>
     <width>10</width>
     <visible>player.rewinding32x + !player.paused</visible>
     <texture>seekbar_rewind.png</texture>
   </control>

 </controls>
</window>

like i said, what happens is that only the last image drawn 'listens' to the new condition and becomes invisible if it's told to, the others keep their currect state.
what i wanted to achieve is the images indicating the forward/rewind speed except when the player is paused. it should only display the paused image the. it does display that image, but over the speed indicator images.

using build of he 9th of this month btw.

thx, cheers,
cacti