View Full Version : Window.isactive problems?
hi,
i'm trying to use the window.isactive() function but i can't get it to work. the 'wakka' manual state is should be working on all controls and doesn't mention any windows it won't work on.
i'm tried to use the funcion on dialogvolumebar and playercontrols windows but they both seem to fail; when using the function the window doesn't show at all.
oh, and searching or googleing didn't give me *anything*. latest cvs build (9 july) btw...
anyone even did sucsesfully use it? any help is much apreciated.
tia, cheers,
cacti
Chokemaniac
2005-07-10, 11:37
using these tags on anything does only mean, that they work on this condition - not that they show up.
for example you make a dialog using a tag <visible>player.hasmedia</visible>, then this dialog will only work at all when something is actually playing. its not like it will be always up, just because something is playing...
if you think about it that makes sense - because if the player controls would be always up, when media is playing you would only be able to to anything on this particular dialog. even if they were up aall the time, how should xbmc know when you want to use and when you just want to browse your stuff...
you also wouldnt want player controls to pop up, when theres nothing playing, because then there would be nothing to control. so basicly this tag was made to hide stuff, when its not needed...
it works on everything but windows btw. dialogs and buttonmenus are not windows...
also the visibility of most dialogs is hardcoded. we used the new tags for the first time on the seekbar. by now i use them on the custom dialogs i added lately. maybe check these for reference.
try with a custom*.xml. <type>dialog</type>
jmarshall
2005-07-10, 13:24
what are you trying to achieve exactly?
let me know and i'll tell you how it's done (might form a good basis for a tutorial for the skinning section of the manual)
cheers,
jonathan
hi,
for instance, this is what i tried with dialogvolumebar.xml:
<window>
*<id>104</id>
*<defaultcontrol>1</defaultcontrol>
*<coordinates>
* *<system>1</system>
* *<posx>67</posx>
* *<posy>470</posy>
*</coordinates>
*<controls>
* *<control>
* * *<description>popup volume dialog background</description>
* * *<visible>window.isactive(114)</visible>
* * *<type>image</type>
* * *<id>400</id>
* * *<posx>0</posx>
* * *<posy>0</posy>
* * *<width>316</width>
* * *<height>40</height>
* * *<texture>osd_volume_backgroundpc.png</texture>
* *</control>
*<controls>
* *<control>
* * *<description>popup volume dialog background</description>
* * *<visible>!window.isactive(114)</visible>
* * *<type>image</type>
* * *<id>400</id>
* * *<posx>0</posx>
* * *<posy>0</posy>
* * *<width>316</width>
* * *<height>40</height>
* * *<texture>osd_volume_background.png</texture>
* *</control>
i tried it with both the windowid and windowname but in both cases the neigther of the images show up. i tried the same with playercontrol.xlm but with the same results. what i am trying to do is combine the volume and player controls. and maybe other stuff the isactive function could be helpfull with.
another question, is there a way (besides the normal stickaction) to change the volume or mutestate in a skin?
thanks for any hints/help,
cacti
jmarshall
2005-07-11, 22:29
hi cactus.
so if i understand you right, you want the volume control to come up when the playercontrols dialog (start from within the gui) is on screen?
if so, you do the following:
<window>
<id>104</id>
<defaultcontrol>1</defaultcontrol>
<coordinates>
<system>1</system>
<posx>67</posx>
<posy>470</posy>
</coordinates>
<type>dialog</type>
<visible>window.isactive(114) | window.isactive(104)</visible>
<controls>
<control>
<description>popup volume dialog background</description>
<type>image</type>
<id>400</id>
<posx>0</posx>
<posy>0</posy>
<width>316</width>
<height>40</height>
<texture>osd_volume_backgroundpc.png</texture>
</control>
....
</controls>
</window>
this tells xbmc that it should show this dialog if the playercontrols are on screen.
the window.isactive(104) addition is there so that the <visible> setting doesn't override xbmc popping it up on stick events.
if you don't want it to pop up on stick events, and just want it to be available when the playercontrols dialog is onscreen, then try it without the window.isactive(104) bit.
lastly, the | between just means or.
let us know how you get on.
as for changing the volume via the skin, you currently can't do this. i can add it reasonably easily though if you want me to.
cheers,
jonathan
wow, this is exactly what i wanted.
thanks jonathan, you seem to know it *all* :)
cacti
jmarshall
2005-07-12, 12:49
glad i could help. now that you understand it, would you mind writing up a short tutorial for the online manual (eg entitled "how to get a window to popup at the same time as another one.")
i'm more than happy to check it for errors etc. and link it up with the rest of the stuff.
cheers,
jonathan
hi jonathan, i've a problem with the seekbar in the orbs, now the visible tag look like this:
*<visible>player.seeking | player.displayafterseek | player.paused | player.forwarding | player.rewinding</visible>
what i'd like is to show it in above conditions but not if the osd is on, i've tryed to change the conditions using ! or + but i don't know if there is a way to group some of them like :
!window.isactive(videoosd) + !window.isactive(musicosd) + (player.seeking | player.displayafterseek | player.paused | player.forwarding | player.rewinding)
i know you know the way :p
jmarshall
2005-07-12, 14:43
yeah, unfortunately there is no way to group conditionals.
but logic being logic, there is always a way even without this.
the thing to remember is that and takes priority over or.
so what you would have to do (yeah, it's messy) is if you have a combination of ors that you want to and with something else, you must and each one of the ors separately.
eg:
(condition1 | condition2) + condition3
you'd do like this:
condition1 + condition3 | condition2 + condition3.
note that the logic is still preserved.
for your example, you're gonna have to do:
!window.isactive(musicosd) + !window.isactive(videoosd) + player.seeking | !window.isactive(musicosd) + !window.isactive(videoosd) + player.displayafterseek | !window.isactive(musicosd) + !window.isactive(videoosd) + player.paused | !window.isactive(musicosd) + !window.isactive(videoosd) + player.forwarding | !window.isactive(musicosd) + !window.isactive(videoosd) + player.rewinding
maybe i should invest a little time in getting brackets working :p
cheers,
jonathan
wow, this is like going back to school! :) thank you :)
has been a few days that i want to make a new topic to list all the conditional and info tags available right now in xbmc for labels, windows and images (or any other control), because it's hard to remember them all.
would be great to have them in the online manual but a pinned topic here can do the job too.
i can start the topic but i'm sure my list will not be complete because i don't really know where to look exactly for those tags except the changelog and some posts here in the forum.
let me know what you think.
cheers :)
jmarshall
2005-07-12, 15:55
http://manual.xboxmediacenter.de/wakka.php?wakka=conditionalvisibility&v=3ha
feel free to add stuff that's missing, though i'm pretty sure the list itself is up to date. perhaps a little bit more on the above?
btw: i think i will add support for paranthesis, and i'll probably change the evaluator, as i don't think it'd be easy to add paranthesis to the way the evaluator currently works, so replacing the evaluator with a classic stack based system might be easier.
cheers,
jonathan
oops :) i definitly was missing that :p sorry about it
glad i could help. *now that you understand it, would you mind writing up a short tutorial for the online manual (eg entitled "how to get a window to popup at the same time as another one.")
i'm more than happy to check it for errors etc. and link it up with the rest of the stuff.
cheers,
jonathan
sure,
i'll give it a go and as soon as i finish this i'll right up a page on the waka system.
cheers,
cacti
hi,
now that i know how to do it i'm still not satisfied with my results. so if your still willing to make the volumesetting skinnable i'd bow even deeper. :lol:
if at all possible the xbmc.volumeup(), xbmc.volumedown() and xbmc.volumemute() functions would make skinning easier. this way it could be used in a skin and (i presume automatic?) in python scripts too. but it's just a though.
and while i'm at it, a way to change the -xx.x db to a normal positive scale (say from 0 to 30) would be appreciate too.
imho the -db values look a bit weird.
all only if it real easy to change, i can imagine there are more inportant/usefull functions to code.
cheers,
cacti
leveladjustment (volume) works just like we illustrated it now.
0 = no change = unaltered volume
everything below is level/volume adjustment, and since we lower the level, it's negative values. this should not change imho