Kodi Community Forum

Full Version: Fading added to the gui
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
hi all,

fading was added to the gui last night. it works as follows: whenever a control has a <visible> tag with the fade attributes set, it'll fade whenever the visibility changes.

for instance:

<visible effect="fade" time="400">player.hasaudio</visible>

will cause the control to fade in (lasting a time of 400 milliseconds) when xbmc starts playing music, and will fade back out again when it stops playing music.

you can use this on any control except videowindow's and visualisation controls. videowindow's i can probably do reasonably easily, but visualisations would need changes to the vis interface.

there's also some other attributes that you can add:

<visible effect="fade" time="200" start="hidden">true</visible>

this control will always be visible (as we've set the visible tag to true) but it will always start out hidden and fade in over 200 milliseconds. you can also do:

<visible effect="fade" intime="500" outtime="100">player.hasmedia</visible>

to specify the fade in and fade out times separately.

lastly, the fade attribute works for dialogs as well, so at the top of any dialog window's xml, you can add:

<visible effect="fade" time="200">window.isactive(windowid)</visible>

to have it fade in when it pops up, and fade out again when it is finished with.

note that you need the window.isactive(windowid) command there, otherwise it'll always be on screen. (windowid will ofcourse be the dialogs id).

the only exceptions to the dialog fading are the music and video overlays, which always vanish immediately if you change to a window that doesn't allow overlays (eg fullscreen video)

let me know what you think, and if you find any bugs! i strongly suggest you don't overuse it - keep the fades short (less than 400ms or so) otherwise it gets a bit much.


edit: updated to the new system.

related to this topic, i've also enhanced the system.idletime() visibility condition - you can now have as many different idle time trigger times as you like. (before it was limited to just one time skin-wide)

and lastly, there's been a couple of minor changes to the way visualisation and slideshow are skinned:

1. the codec information (stuff that pops up on black) is now handled via the player.showcodec visibility condition. fading is now handled by the skin, rather than by xbmc.

2. the filename information in slideshow.xml is handled by the same player.showinfo visibility condition. you can make it fade in and out now as well.

i'll probably be changing the info bars in fullscreen video and the music info in musicvisualisation to use fading in the skin as well (rather than us forcing them on and off via the code), though i don't know if i'll have time to do all this. i'm currently looking at redoing the videoosd settings options.


edit: updated slideshow to use player.showinfo rather than player.showcodec.

i posted a bug (i think) here http://www.xboxmediaplayer.de/cgi-bin....t=14625

i'm not sure if it's related or if something new has to be done to a python script. i checked the only link i have to an updated xbmcgui doc that thor918 hosts. (has more info that the docs in cvs) i also didn't see anything in the manual.

but i think this is a nice feature and if it is supposed to be exposed to python great.
thanks for the fix. i like the fade in/out on most dialogs, but...

may i suggest not having the dialogprogress.xml fade in/out. it doesn't work well and causes strange behavior in quicktimebrowser.py. after i removed the <visible fade="10" start="hidden">window.isactive(101)</visible> line everything works good again.

if you need an example just go into system info and select any of the categories that have a progress dialog or use quicktimebrowser.py.

i know you're probably still fine tuning it, so maybe this doesn't/won't apply in the future.
yeah - because it's done frame-based, if there is a lot of activity between frame updates, then the fade will go very slowly.

i'm gonna take a look at doing it timebased and see if that helps (might not look as smooth).

i also may look at adding separate fade in and fade out times (as stuff like the videoosd you want to fade in a bit quicker, but fade out is about right atm.)

its great on the same kind of line, i would love a vis tag for internet connected even if tag is slow to boot like onscreen weather checking. i wouldnt want it if it polled google.com or something like it does in system settings.
also a fade tag for after 5 mins fade infor 10 secs and repeat this would be great. but what is done is brillant cheers again very usefull.
updated the first post for the new fading system.

i've also added 3 new conditional visibilities:

control.hasfocus(controlid) - returns true if the current focused control has id controlid.

buttonscroller.hasicon(icon) - returns true if the current button scroller has focus, and is on the item that usually loads background image "icon".

player.showinfo - returns true currently only in musicvisualisation when the current track info should be displayed on screen. this takes over from the built in fading stuff which has now been removed.

the manual has also been updated with these changes.

please let me know asap (ie before monday) if there's any errors.
wow this seems like the beginnings of a pretty powerful animation system for skins.

the obvious next step would be to do a similar setup for a "slide" effect with an extra attribute specifying the direction. the time/intime/outtime stuff wouldnt need to be changed.

although you might want to if you want to support fading/sliding at the same time? that would allow some pretty fancy gui transitions between screens.
that's the idea, yeah. not sure if combining more than one is really needed though - we'll see.

i'm away for the next 2 months, but i'm sure there'll be others around to extend it. everything is in place for other stuff such as slideleft etc. though, as you can see.

other stuff is perhaps a pause before the effect kicks in (so that you can time the opening anim of a window.) and some way to do exit animation on windows (only thing not possible unless an entire dialog is sliden out or whatever)

pressing the info button on the remote no longer works during visuals when listening to music. i liked how it use to display the current/next track info and then fade out.

how do i achieve this functionality with the new visual effect code?
the lovely fade-in and fade-out between the background pictures when changing between the menu items on the home screen has still not been fixed (pm3 skin with latest cvs).

this feature first apperead seen in about 3 cvs builds ago. since then its been missing/broken!!

really hope they put that back in as it makes xbmc sleek and makes using xbmc more enjoyable!!!
gamster17, completly different issue..

it doesn't fade the gui images anymoreHuh how weird.. nothing should have changed in that.. will check why that might be.

<edit> hehe, it was fading out over 10ms.. not to easy to spot. happend when fading was changed from being framebased to timebased </edit>

Pages: 1 2