annotate Gui/mplayer/common.c @ 11112:1d2c30ef6c11

Prefer TOOLS/cpuinfo over /proc/cpuinfo on Cygwin, approved by Sascha.
author diego
date Tue, 14 Oct 2003 12:14:48 +0000
parents bc24dd70c6e2
children 897bda2dfe29
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8973
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
1
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
2 // main window
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
3
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
4 #include <stdlib.h>
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
5 #include <stdio.h>
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
6 #include <inttypes.h>
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
7 #include <sys/stat.h>
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
8 #include <unistd.h>
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
9
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
10 #include "../app.h"
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
11 #include "../skin/font.h"
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
12 #include "../skin/skin.h"
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
13 #include "../wm/ws.h"
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
14
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
15 #include "../../config.h"
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
16 #include "../../help_mp.h"
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
17 #include "../../libvo/x11_common.h"
9625
bc24dd70c6e2 many 10l for me ...
pontscho
parents: 9191
diff changeset
18 #include "../../libvo/fastmemcpy.h"
8973
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
19
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
20 #include "../../libmpdemux/stream.h"
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
21 #include "../../mixer.h"
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
22 #include "../../libvo/sub.h"
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
23 #include "../../mplayer.h"
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
24
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
25 #include "../../libmpdemux/demuxer.h"
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
26 #include "../../libmpdemux/stheader.h"
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
27 #include "../../codec-cfg.h"
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
28
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
29
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
30 #include "play.h"
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
31 #include "widgets.h"
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
32
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
33 extern unsigned int GetTimerMS( void );
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
34
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
35 inline void TranslateFilename( int c,char * tmp )
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
36 {
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
37 int i;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
38 switch ( guiIntfStruct.StreamType )
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
39 {
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
40 case STREAMTYPE_STREAM:
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
41 strcpy( tmp,guiIntfStruct.Filename );
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
42 break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
43 case STREAMTYPE_FILE:
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
44 if ( ( guiIntfStruct.Filename )&&( guiIntfStruct.Filename[0] ) )
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
45 {
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
46 if ( strrchr( guiIntfStruct.Filename,'/' ) ) strcpy( tmp,strrchr( guiIntfStruct.Filename,'/' ) + 1 );
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
47 else strcpy( tmp,guiIntfStruct.Filename );
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
48 if ( tmp[strlen( tmp ) - 4] == '.' ) tmp[strlen( tmp ) - 4]=0;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
49 if ( tmp[strlen( tmp ) - 5] == '.' ) tmp[strlen( tmp ) - 5]=0;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
50 } else strcpy( tmp,MSGTR_NoFileLoaded );
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
51 break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
52 #ifdef USE_DVDREAD
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
53 case STREAMTYPE_DVD:
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
54 if ( guiIntfStruct.DVD.current_chapter ) sprintf( tmp,MSGTR_Chapter,guiIntfStruct.DVD.current_chapter );
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
55 else strcat( tmp,MSGTR_NoChapter );
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
56 break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
57 #endif
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
58 #ifdef HAVE_VCD
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
59 case STREAMTYPE_VCD:
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
60 sprintf( tmp,MSGTR_VCDTrack,guiIntfStruct.Track );
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
61 break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
62 #endif
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
63 default: strcpy( tmp,MSGTR_NoMediaOpened );
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
64 }
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
65 if ( c )
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
66 {
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
67 for ( i=0;i < (int)strlen( tmp );i++ )
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
68 {
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
69 int t=0;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
70 if ( c == 1 ) { if ( ( tmp[i] >= 'A' )&&( tmp[i] <= 'Z' ) ) t=32; }
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
71 if ( c == 2 ) { if ( ( tmp[i] >= 'a' )&&( tmp[i] <= 'z' ) ) t=-32; }
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
72 tmp[i]=(char)( tmp[i] + t );
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
73 }
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
74 }
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
75 }
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
76
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
77 char * Translate( char * str )
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
78 {
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
79 static char trbuf[512];
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
80 char tmp[512];
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
81 int i,c;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
82 int t;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
83 memset( trbuf,0,512 );
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
84 memset( tmp,0,128 );
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
85 for ( c=0,i=0;i < (int)strlen( str );i++ )
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
86 {
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
87 if ( str[i] != '$' ) { trbuf[c++]=str[i]; trbuf[c]=0; }
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
88 else
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
89 {
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
90 switch ( str[++i] )
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
91 {
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
92 case 't': sprintf( tmp,"%02d",guiIntfStruct.Track ); strcat( trbuf,tmp ); break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
93 case 'o': TranslateFilename( 0,tmp ); strcat( trbuf,tmp ); break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
94 case 'f': TranslateFilename( 1,tmp ); strcat( trbuf,tmp ); break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
95 case 'F': TranslateFilename( 2,tmp ); strcat( trbuf,tmp ); break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
96 case '6': t=guiIntfStruct.LengthInSec; goto calclengthhhmmss;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
97 case '1': t=guiIntfStruct.TimeSec;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
98 calclengthhhmmss:
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
99 sprintf( tmp,"%02d:%02d:%02d",t/3600,t/60%60,t%60 ); strcat( trbuf,tmp );
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
100 break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
101 case '7': t=guiIntfStruct.LengthInSec; goto calclengthmmmmss;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
102 case '2': t=guiIntfStruct.TimeSec;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
103 calclengthmmmmss:
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
104 sprintf( tmp,"%04d:%02d",t/60,t%60 ); strcat( trbuf,tmp );
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
105 break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
106 case '3': sprintf( tmp,"%02d",guiIntfStruct.TimeSec / 3600 ); strcat( trbuf,tmp ); break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
107 case '4': sprintf( tmp,"%02d",( ( guiIntfStruct.TimeSec / 60 ) % 60 ) ); strcat( trbuf,tmp ); break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
108 case '5': sprintf( tmp,"%02d",guiIntfStruct.TimeSec % 60 ); strcat( trbuf,tmp ); break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
109 case '8': sprintf( tmp,"%01d:%02d:%02d",guiIntfStruct.TimeSec / 3600,( guiIntfStruct.TimeSec / 60 ) % 60,guiIntfStruct.TimeSec % 60 ); strcat( trbuf,tmp ); break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
110 case 'v': sprintf( tmp,"%3.2f%%",guiIntfStruct.Volume ); strcat( trbuf,tmp ); break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
111 case 'V': sprintf( tmp,"%3.1f",guiIntfStruct.Volume ); strcat( trbuf,tmp ); break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
112 case 'b': sprintf( tmp,"%3.2f%%",guiIntfStruct.Balance ); strcat( trbuf,tmp ); break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
113 case 'B': sprintf( tmp,"%3.1f",guiIntfStruct.Balance ); strcat( trbuf,tmp ); break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
114 case 'd': sprintf( tmp,"%d",guiIntfStruct.FrameDrop ); strcat( trbuf,tmp ); break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
115 case 'x': sprintf( tmp,"%d",guiIntfStruct.MovieWidth ); strcat( trbuf,tmp ); break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
116 case 'y': sprintf( tmp,"%d",guiIntfStruct.MovieHeight ); strcat( trbuf,tmp ); break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
117 case 'C': sprintf( tmp,"%s", guiIntfStruct.sh_video? ((sh_video_t *)guiIntfStruct.sh_video)->codec->name : "");
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
118 strcat( trbuf,tmp ); break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
119 case 's': if ( guiIntfStruct.Playing == 0 ) strcat( trbuf,"s" ); break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
120 case 'l': if ( guiIntfStruct.Playing == 1 ) strcat( trbuf,"p" ); break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
121 case 'e': if ( guiIntfStruct.Playing == 2 ) strcat( trbuf,"e" ); break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
122 case 'a':
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
123 if ( muted ) { strcat( trbuf,"n" ); break; }
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
124 switch ( guiIntfStruct.AudioType )
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
125 {
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
126 case 0: strcat( trbuf,"n" ); break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
127 case 1: strcat( trbuf,"m" ); break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
128 case 2: strcat( trbuf,"t" ); break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
129 }
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
130 break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
131 case 'T':
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
132 switch ( guiIntfStruct.StreamType )
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
133 {
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
134 case STREAMTYPE_FILE: strcat( trbuf,"f" ); break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
135 #ifdef HAVE_VCD
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
136 case STREAMTYPE_VCD: strcat( trbuf,"v" ); break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
137 #endif
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
138 case STREAMTYPE_STREAM: strcat( trbuf,"u" ); break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
139 #ifdef USE_DVDREAD
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
140 case STREAMTYPE_DVD: strcat( trbuf,"d" ); break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
141 #endif
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
142 default: strcat( trbuf," " ); break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
143 }
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
144 break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
145 case '$': strcat( trbuf,"$" ); break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
146 default: continue;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
147 }
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
148 c=strlen( trbuf );
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
149 }
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
150 }
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
151 return trbuf;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
152 }
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
153
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
154 static char * image_buffer = NULL;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
155 static int image_width = 0;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
156
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
157 void PutImage( txSample * bf,int x,int y,int max,int ofs )
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
158 {
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
159 int i=0,ix,iy;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
160 uint32_t * buf = NULL;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
161 uint32_t * drw = NULL;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
162 register uint32_t tmp;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
163 register uint32_t yc;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
164
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
165 if ( ( !bf )||( bf->Image == NULL ) ) return;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
166
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
167 i=( bf->Width * ( bf->Height / max ) ) * ofs;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
168 buf=(uint32_t *)image_buffer;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
169 drw=(uint32_t *)bf->Image;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
170
9191
21920dfcc37c workaround one possible sig11
pontscho
parents: 8973
diff changeset
171 #if 1
8973
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
172 for ( iy=y;iy < (int)(y+bf->Height / max);iy++ )
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
173 for ( ix=x;ix < (int)(x+bf->Width);ix++ )
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
174 {
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
175 tmp=drw[i++];
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
176 if ( tmp != 0x00ff00ff ) buf[iy * image_width + ix]=tmp;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
177 }
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
178 #else
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
179 yc=y * image_width;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
180 for ( iy=y;iy < (int)(y+bf->Height / max);iy++ )
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
181 {
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
182 for ( ix=x;ix < (int)(x+bf->Width);ix++ )
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
183 {
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
184 tmp=drw[i++];
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
185 if ( tmp != 0x00ff00ff ) buf[yc + ix]=tmp;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
186 }
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
187 yc+=image_width;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
188 }
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
189 #endif
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
190 }
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
191
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
192 void Render( wsTWindow * window,wItem * Items,int nrItems,char * db,int size )
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
193 {
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
194 wItem * item;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
195 txSample * image = NULL;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
196 int i, type;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
197
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
198 image_buffer=db;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
199 image_width=window->Width;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
200
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
201 for( i=0;i < nrItems + 1;i++ )
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
202 {
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
203 item=&Items[i];
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
204 switch( item->type )
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
205 {
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
206 case itButton:
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
207 PutImage( &item->Bitmap,item->x,item->y,3,item->pressed );
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
208 break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
209 case itPotmeter:
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
210 PutImage( &item->Bitmap,item->x,item->y,item->phases,( item->phases - 1 ) * ( item->value / 100.0f ) );
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
211 break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
212 case itHPotmeter:
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
213 PutImage( &item->Bitmap,item->x,item->y,item->phases,item->phases * ( item->value / 100.0f ) );
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
214 PutImage( &item->Mask,item->x + (int)( ( item->width - item->psx ) * item->value / 100.0f ),item->y,3,item->pressed );
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
215 break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
216 case itVPotmeter:
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
217 PutImage( &item->Bitmap,
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
218 item->x,item->y,
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
219 item->phases,
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
220 item->phases * ( item->value / 100.0f ) );
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
221 PutImage( &item->Mask,
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
222 item->x,item->y + (int)( ( item->height - item->psy ) * item->value / 100.0f ),
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
223 3,item->pressed );
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
224 break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
225 case itSLabel:
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
226 image=fntRender( item,0,"%s",item->label );
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
227 if ( image ) PutImage( image,item->x,item->y,1,0 );
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
228 case itDLabel:
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
229 {
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
230 char * t = Translate( item->label );
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
231 int l = fntTextWidth( item->fontid,t );
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
232 image=fntRender( item,(GetTimerMS() / 20)%(l?l:item->width),"%s",t );
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
233 }
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
234 if ( image ) PutImage( image,item->x,item->y,1,0 );
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
235 break;
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
236 }
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
237 }
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
238 wsConvert( window,db,size );
0a665389cf2b - add playbar
pontscho
parents:
diff changeset
239 }