[MPlayer-dev-eng] [PATCH] simple, smooth and ram-saving potmeters

André Kühne andre.kuehne at gmx.net
Thu Mar 18 14:15:29 CET 2004


hi,

this patch does the following: if a skin-file defines a (h)potmeter to 
have only one phase, like in

   ; potmeter=phasebitmaps,phases,default value,x,y,sx,sy,msg
   potmeter = slider_volume,  1, 50, 147, 51, 138, 18, evSetVolume

then this "phase" will be drawn from left to the point of value, thus 
creating virtual phases on the fly.

the benefits:

   - the method uses significantly less ram
     (about 7mb with my example skin, see below)

   - there is no stepping, as in potmeters which use
     few phases to save memory

   - creating potmeters for a skin this way is very easy

on the codeside, there is only an additional PutImage function and an 
if-statement to test which function to use.

this patch doesn't break anything, since there was no use for single 
phased phasebitmaps before.

i made a skin that can make use of the patch:

http://home.t-online.de/home/andre.kuehne/tvisor/tvisor-1.0.tar.gz
http://home.t-online.de/home/andre.kuehne/tvisor/screenshot.jpg

by default the skin uses standard multiphased bitmaps, so it works 
with every mplayer. to use the patch, just switch the potmeter 
definitions in the skin-file.

any feedback is welcome.

--
Andre Kuehne

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: simplePotmeter.patch
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20040318/1a4306e3/attachment.txt>


More information about the MPlayer-dev-eng mailing list