feature request : GIF support

About usage, announcement and development of skins for VLC
xanax

feature request : GIF support

Postby xanax » 02 Dec 2005 11:21

Hi

Is it possible that you, nice developers, could add the .GIF support into the skins' engine ?

I read that at the moment, PNG and now BMP (for winamp2 skins support) files were supported in skins but what about .GIF ?

I tried with a simple GIF animation but only the first frame was displayed and of course, this image was "frozen" (no animation was displayed).

If you could (please, say yes) add GIF support, I could :
- create buttons (states : "over" and "down" with animations !
- create animated decorations images (I am creating a skin that would be much more beautiful with this feature.., well I think so).

This way, we could have something like that :

Code: Select all

<Bitmap id="play-button_over" file="images/play-button_over.gif" alphacolor="ff00ff" /> <Button up="play-button_up" over="play-button_over" down="play-button_down" action="vlc.play()">

If GIF is a patent problem, why not trying to make a way to have animations with one image file (PNG) which would have all the frames on it (pasted vertically), like winamp2 's volume.bmp images.


Please, please, add this possibility, I need it.

AsMaX
Cone that earned his stripes
Cone that earned his stripes
Posts: 139
Joined: 05 Mar 2004 09:00
Location: Antibes, France

Postby AsMaX » 02 Dec 2005 18:52

hi,
I'm not sure if reading animated gif is possible, but animated bitmaps would be indeed fun to implement.
It should not be very difficult in theory, but the impacts on the code may not be trivial so I have to think a little about it...

xanax

Postby xanax » 02 Dec 2005 19:12

Oh, thanks a lot for saying that.
I can't wait to test a nightly build that features this 8)

AsMaX
Cone that earned his stripes
Cone that earned his stripes
Posts: 139
Joined: 05 Mar 2004 09:00
Location: Antibes, France

Postby AsMaX » 03 Dec 2005 12:55

I guess you will be able to try it tomorrow ;)
r13499 | asmax | 2005-12-03 12:43:35 +0100 (Sat, 03 Dec 2005) | 7 lines
Changed paths:
M /trunk/modules/gui/skins2/Modules.am
M /trunk/modules/gui/skins2/controls/ctrl_button.cpp
M /trunk/modules/gui/skins2/controls/ctrl_button.hpp
M /trunk/modules/gui/skins2/controls/ctrl_generic.cpp
M /trunk/modules/gui/skins2/controls/ctrl_generic.hpp
M /trunk/modules/gui/skins2/parser/builder.cpp
M /trunk/modules/gui/skins2/parser/builder_data.def
M /trunk/modules/gui/skins2/parser/builder_data.hpp
M /trunk/modules/gui/skins2/parser/skin_parser.cpp
M /trunk/modules/gui/skins2/src/file_bitmap.cpp
M /trunk/modules/gui/skins2/src/file_bitmap.hpp
M /trunk/modules/gui/skins2/src/generic_bitmap.cpp
M /trunk/modules/gui/skins2/src/generic_bitmap.hpp
M /trunk/modules/gui/skins2/src/os_graphics.hpp
M /trunk/share/skins2/skin.dtd

* all: support of animated bitmaps in skins: there are new attributes
"nbFrames" and "fps" in the (Sub)Bitmap elements to set the number
of frames and the frame rate in a bitmap. As in the radialslider,
the different frames are just laid vertically in the bitmap (and
all the frames must have the same size)
At the moment animated bitmaps are only supported in Button controls.

xanax

Postby xanax » 05 Dec 2005 13:53

To make my life easier (and others' too), could you create a simple skin with this new code (animated Bitmap), as an example for my own skin.

Thanks a lot (an example is often more "useful" than an explaination).


----------------------------------------------------------------

Using this same technique (several images vertically pasted in a single image), will we be abble to create "volumebars" like winamp2 classic skins ones ?

Example :
Image

This example is not very representative because only colors change, but with this volume, we could create everykind of volumes shapes..

- Voltmeter displays :
Image

- vertical VUmeters:
Image

- misc buttons :
Image


And so on.. By the way, won't you be obliged to support these kind of volumebar and seekbars (don't forget them !) because of winamp2 skins ?

AsMaX
Cone that earned his stripes
Cone that earned his stripes
Posts: 139
Joined: 05 Mar 2004 09:00
Location: Antibes, France

Postby AsMaX » 05 Dec 2005 20:48

Hi,

for instance to do an animated "next" button with 4 images per second , you can have a bitmap with 8 sub-images laid vertically (as your volume bar example)

Code: Select all

<Bitmap id="next" file="next.png" alphacolor="#FF0000" nbFrames="8" fps="4"/> <Bitmap id="next_onclick" file="next_onclick.png" alphacolor="#FF0000" nbFrames="8" fps="4"/> ... <Button x="196" y="79" up="next" down="next_onclick" over="next" action="playlist.next()" tooltiptext="Next Item"/>

As for winamp2 volume bars, please try to load a winamp2 skin in vlc and you'll see it's already implemented ;)
For instance, in the equalizer you have:

Code: Select all

<Slider value="equalizer.preamp" x="21" y="39" up="eq_slider_up" down="eq_slider_down" points="(6,55),(6,7)" thickness="6" tooltiptext=""> <SliderBackground image="eq_slider_bg" nbhoriz="14" nbvert="2" padhoriz="1" padvert="1" /> </Slider>
"nbhoriz" / "nbvert" are the number of sub-images horizontally and vertically, and "padhoriz" / "padvert" are the number of pixels between 2 images.
OK i think I'll have to update the documentation ;)
By the way you can have a look at "winamp2.xml" provided with vlc, which is the template for winamp skins

xanax

Postby xanax » 06 Dec 2005 19:38

Please, I want a working example (a real skin).
I'll try your code but .. in the case it does not work.. I would like to get inspired by another example.

Thanks.


Return to “Skins”

Who is online

Users browsing this forum: No registered users and 2 guests