comparison Gui/mplayer/play.c @ 1866:32b1bb50a0e8

some bug fix, and add decoration item to skin conffile. faszom(C)
author pontscho
date Fri, 07 Sep 2001 21:04:14 +0000
parents 17660d830bcb
children d21f8afc7680
comparison
equal deleted inserted replaced
1865:538b993b3518 1866:32b1bb50a0e8
22 #include "./mplayer.h" 22 #include "./mplayer.h"
23 #include "psignal.h" 23 #include "psignal.h"
24 #include "play.h" 24 #include "play.h"
25 25
26 #include "../skin/skin.h" 26 #include "../skin/skin.h"
27 #include "../config.h"
28 #include "../error.h" 27 #include "../error.h"
29 #include "../language.h" 28 #include "../language.h"
30 29
31 mplCommStruct * mplShMem; 30 mplCommStruct * mplShMem;
32 char * Filename = NULL; 31 char * Filename = NULL;
125 124
126 listItems tmpList; 125 listItems tmpList;
127 126
128 void ChangeSkin( void ) 127 void ChangeSkin( void )
129 { 128 {
130 if ( strcmp( cfgSkin,gtkShMem->sb.name ) ) 129 if ( strcmp( skinName,gtkShMem->sb.name ) )
131 { 130 {
132 int ret; 131 int ret;
133 #ifdef DEBUG 132 #ifdef DEBUG
134 dbprintf( 1,"[psignal] skin: %s\n",gtkShMem->sb.name ); 133 dbprintf( 1,"[psignal] skin: %s\n",gtkShMem->sb.name );
135 #endif 134 #endif
143 fntFreeFont(); 142 fntFreeFont();
144 143
145 appInitStruct( &tmpList ); 144 appInitStruct( &tmpList );
146 skinAppMPlayer=&appMPlayer; 145 skinAppMPlayer=&appMPlayer;
147 appInitStruct( &appMPlayer ); 146 appInitStruct( &appMPlayer );
148 if ( !ret ) strcpy( cfgSkin,gtkShMem->sb.name ); 147 if ( !ret ) strcpy( skinName,gtkShMem->sb.name );
149 skinRead( cfgSkin ); 148 skinRead( skinName );
150 149
151 if ( ret ) 150 if ( ret )
152 { 151 {
153 mainVisible=1; 152 mainVisible=1;
154 return; 153 return;
155 } 154 }
156
157 // appCopy( &appMPlayer,&tmpList );
158 // appInitStruct( &tmpList );
159 // skinAppMPlayer=&appMPlayer;
160 // strcpy( cfgSkin,gtkShMem->sb.name );
161
162 if ( mplDrawBuffer ) free( mplDrawBuffer );
163 if ( ( mplDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.main.Bitmap.ImageSize ) ) == NULL )
164 { message( False,langNEMDB ); return; }
165 wsResizeWindow( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height );
166 wsMoveWindow( &appMPlayer.mainWindow,appMPlayer.main.x,appMPlayer.main.y );
167 wsResizeImage( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height );
168 wsSetShape( &appMPlayer.mainWindow,appMPlayer.main.Mask.Image );
169 mainVisible=1; mplMainRender=1; wsPostRedisplay( &appMPlayer.mainWindow );
170
171 btnModify( evSetVolume,mplShMem->Volume );
172 btnModify( evSetBalance,mplShMem->Balance );
173 btnModify( evSetMoviePosition,mplShMem->Position );
174 155
175 if ( appMPlayer.menuBase.Bitmap.Image ) 156 if ( appMPlayer.menuBase.Bitmap.Image )
176 { 157 {
177 if ( mplMenuDrawBuffer ) free( mplMenuDrawBuffer ); 158 if ( mplMenuDrawBuffer ) free( mplMenuDrawBuffer );
178 if ( ( mplMenuDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.menuBase.Bitmap.ImageSize ) ) == NULL ) 159 if ( ( mplMenuDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.menuBase.Bitmap.ImageSize ) ) == NULL )
184 mplSkinChanged=1; 165 mplSkinChanged=1;
185 if ( appMPlayer.sub.Bitmap.Image ) wsResizeImage( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Width,appMPlayer.sub.Bitmap.Height ); 166 if ( appMPlayer.sub.Bitmap.Image ) wsResizeImage( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Width,appMPlayer.sub.Bitmap.Height );
186 if ( !mplShMem->Playing ) 167 if ( !mplShMem->Playing )
187 { 168 {
188 mplSkinChanged=0; 169 mplSkinChanged=0;
189 // if ( appMPlayer.subWindow.isFullScreen ) wsFullScreen( &appMPlayer.subWindow );
190 if ( !appMPlayer.subWindow.isFullScreen ) 170 if ( !appMPlayer.subWindow.isFullScreen )
191 { 171 {
192 wsResizeWindow( &appMPlayer.subWindow,appMPlayer.sub.width,appMPlayer.sub.height ); 172 wsResizeWindow( &appMPlayer.subWindow,appMPlayer.sub.width,appMPlayer.sub.height );
193 wsMoveWindow( &appMPlayer.subWindow,appMPlayer.sub.x,appMPlayer.sub.y ); 173 wsMoveWindow( &appMPlayer.subWindow,appMPlayer.sub.x,appMPlayer.sub.y );
194 } 174 }
195 wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.subR,appMPlayer.subG,appMPlayer.subB ); 175 wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.subR,appMPlayer.subG,appMPlayer.subB );
196 wsClearWindow( appMPlayer.subWindow ); 176 wsClearWindow( appMPlayer.subWindow );
197 mplSubRender=1; wsPostRedisplay( &appMPlayer.subWindow ); 177 mplSubRender=1; wsPostRedisplay( &appMPlayer.subWindow );
198 } 178 }
179
180 if ( mplDrawBuffer ) free( mplDrawBuffer );
181 if ( ( mplDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.main.Bitmap.ImageSize ) ) == NULL )
182 { message( False,langNEMDB ); return; }
183 wsVisibleWindow( &appMPlayer.mainWindow,wsHideWindow );
184 wsResizeWindow( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height );
185 wsMoveWindow( &appMPlayer.mainWindow,appMPlayer.main.x,appMPlayer.main.y );
186 wsResizeImage( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height );
187 wsSetShape( &appMPlayer.mainWindow,appMPlayer.main.Mask.Image );
188 mainVisible=1; mplMainRender=1; wsPostRedisplay( &appMPlayer.mainWindow );
189 wsWindowDecoration( &appMPlayer.mainWindow,appMPlayer.mainDecoration );
190 wsVisibleWindow( &appMPlayer.mainWindow,wsShowWindow );
191
192 btnModify( evSetVolume,mplShMem->Volume );
193 btnModify( evSetBalance,mplShMem->Balance );
194 btnModify( evSetMoviePosition,mplShMem->Position );
199 } 195 }
200 mplShMem->SkinChange=0; 196 mplShMem->SkinChange=0;
201 } 197 }
202 198
203 void EventHandling( void ) 199 void EventHandling( void )