[Mplayer-cvslog] CVS: main/Gui/mplayer common.c, 1.7, 1.8 common.h, 1.1, 1.2

Alex Beregszaszi syncmail at mplayerhq.hu
Sat Jun 26 15:54:22 CEST 2004


CVS change done by Alex Beregszaszi

Update of /cvsroot/mplayer/main/Gui/mplayer
In directory mail:/var2/tmp/cvs-serv4219/Gui/mplayer

Modified Files:
	common.c common.h 
Log Message:
simple, smooth, ram-saving dynamic potmeter, which feature is required by the tvisor skin, patch by Andre Kuhne

Index: common.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/common.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- common.c	26 Jun 2004 13:26:11 -0000	1.7
+++ common.c	26 Jun 2004 13:54:20 -0000	1.8
@@ -214,6 +214,30 @@
 #endif
 }
 
+void SimplePotmeterPutImage( txSample * bf,int x,int y,float frac )
+{
+ int i=0,w,r,ix,iy;
+ uint32_t * buf = NULL;
+ uint32_t * drw = NULL;
+ register uint32_t tmp;
+
+ if ( ( !bf )||( bf->Image == NULL ) ) return;
+
+ buf=(uint32_t *)image_buffer;
+ drw=(uint32_t *)bf->Image;
+ w=bf->Width*frac;
+ r=bf->Width-w;
+ for ( iy=y;iy < (int)(y+bf->Height);iy++ )
+ {
+  for ( ix=x;ix < (int)(x+w);ix++ )
+   {
+    tmp=drw[i++]; 
+    if ( tmp != 0x00ff00ff ) buf[iy * image_width + ix]=tmp;
+   }
+  i+=r;
+ }
+}
+
 void Render( wsTWindow * window,wItem * Items,int nrItems,char * db,int size )
 {
  wItem    * item;
@@ -232,10 +256,12 @@
           PutImage( &item->Bitmap,item->x,item->y,3,item->pressed );
           break;
      case itPotmeter:
-          PutImage( &item->Bitmap,item->x,item->y,item->phases,( item->phases - 1 ) * ( item->value / 100.0f ) );
+          if (item->phases == 1)SimplePotmeterPutImage( &item->Bitmap,item->x,item->y, item->value / 100.0f );
+          else PutImage( &item->Bitmap,item->x,item->y,item->phases,( item->phases - 1 ) * ( item->value / 100.0f ) );
           break;
      case itHPotmeter:
-          PutImage( &item->Bitmap,item->x,item->y,item->phases,item->phases * ( item->value / 100.0f ) );
+          if (item->phases == 1)SimplePotmeterPutImage( &item->Bitmap,item->x,item->y, item->value / 100.0f );
+          else PutImage( &item->Bitmap,item->x,item->y,item->phases,( item->phases - 1 ) * ( item->value / 100.0f ) );
           PutImage( &item->Mask,item->x + (int)( ( item->width - item->psx ) * item->value / 100.0f ),item->y,3,item->pressed );
           break;
      case itVPotmeter:

Index: common.h
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/common.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- common.h	17 Jan 2003 22:39:39 -0000	1.1
+++ common.h	26 Jun 2004 13:54:20 -0000	1.2
@@ -14,6 +14,7 @@
 extern inline void TranslateFilename( int c,char * tmp );
 extern char * Translate( char * str );
 extern void PutImage( txSample * bf,int x,int y,int max,int ofs );
+extern void SimplePotmeterPutImage( txSample * bf,int x,int y,float frac );
 extern void Render( wsTWindow * window,wItem * Items,int nrItems,char * db,int size );
 
 #endif




More information about the MPlayer-cvslog mailing list