Mercurial > mplayer.hg
comparison Gui/mplayer/play.c @ 1907:83291fafe66c
add new features. and fix skin error loop.
author | pontscho |
---|---|
date | Mon, 17 Sep 2001 21:16:00 +0000 |
parents | 1f1e98fbf3a7 |
children | b55163894e30 |
comparison
equal
deleted
inserted
replaced
1906:01bab6f60ede | 1907:83291fafe66c |
---|---|
125 | 125 |
126 listItems tmpList; | 126 listItems tmpList; |
127 | 127 |
128 void ChangeSkin( void ) | 128 void ChangeSkin( void ) |
129 { | 129 { |
130 if ( strcmp( skinName,gtkShMem->sb.name ) ) | 130 int ret; |
131 { | 131 if ( !strcmp( skinName,gtkShMem->sb.name ) ) return; |
132 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 |
136 | 135 |
137 mainVisible=0; | 136 mainVisible=0; |
138 | 137 |
139 appInitStruct( &tmpList ); | 138 appInitStruct( &tmpList ); |
140 skinAppMPlayer=&tmpList; | 139 skinAppMPlayer=&tmpList; |
141 ret=skinRead( gtkShMem->sb.name ); | 140 fntFreeFont(); |
141 ret=skinRead( gtkShMem->sb.name ); | |
142 | 142 |
143 fntFreeFont(); | 143 appInitStruct( &tmpList ); |
144 skinAppMPlayer=&appMPlayer; | |
145 appInitStruct( &appMPlayer ); | |
146 if ( !ret ) strcpy( skinName,gtkShMem->sb.name ); | |
147 skinRead( skinName ); | |
148 if ( ret ) | |
149 { | |
150 mainVisible=1; | |
151 return; | |
152 } | |
144 | 153 |
145 appInitStruct( &tmpList ); | 154 if ( appMPlayer.menuBase.Bitmap.Image ) |
146 skinAppMPlayer=&appMPlayer; | 155 { |
147 appInitStruct( &appMPlayer ); | 156 if ( mplMenuDrawBuffer ) free( mplMenuDrawBuffer ); |
148 if ( !ret ) strcpy( skinName,gtkShMem->sb.name ); | 157 if ( ( mplMenuDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.menuBase.Bitmap.ImageSize ) ) == NULL ) |
149 skinRead( skinName ); | 158 { message( False,MSGTR_NEMDB ); return; } |
159 wsResizeWindow( &appMPlayer.menuWindow,appMPlayer.menuBase.width,appMPlayer.menuBase.height ); | |
160 wsResizeImage( &appMPlayer.menuWindow,appMPlayer.menuBase.width,appMPlayer.menuBase.height ); | |
161 } | |
150 | 162 |
151 if ( ret ) | 163 mplSkinChanged=1; |
164 if ( appMPlayer.sub.Bitmap.Image ) wsResizeImage( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Width,appMPlayer.sub.Bitmap.Height ); | |
165 if ( !mplShMem->Playing ) | |
166 { | |
167 mplSkinChanged=0; | |
168 if ( !appMPlayer.subWindow.isFullScreen ) | |
152 { | 169 { |
153 mainVisible=1; | 170 wsResizeWindow( &appMPlayer.subWindow,appMPlayer.sub.width,appMPlayer.sub.height ); |
154 return; | 171 wsMoveWindow( &appMPlayer.subWindow,appMPlayer.sub.x,appMPlayer.sub.y ); |
155 } | 172 } |
173 wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.subR,appMPlayer.subG,appMPlayer.subB ); | |
174 wsClearWindow( appMPlayer.subWindow ); | |
175 mplSubRender=1; wsPostRedisplay( &appMPlayer.subWindow ); | |
176 } | |
156 | 177 |
157 if ( appMPlayer.menuBase.Bitmap.Image ) | 178 if ( mplDrawBuffer ) free( mplDrawBuffer ); |
158 { | 179 if ( ( mplDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.main.Bitmap.ImageSize ) ) == NULL ) |
159 if ( mplMenuDrawBuffer ) free( mplMenuDrawBuffer ); | 180 { message( False,MSGTR_NEMDB ); return; } |
160 if ( ( mplMenuDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.menuBase.Bitmap.ImageSize ) ) == NULL ) | 181 wsVisibleWindow( &appMPlayer.mainWindow,wsHideWindow ); |
161 { message( False,MSGTR_NEMDB ); return; } | 182 wsResizeWindow( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height ); |
162 wsResizeWindow( &appMPlayer.menuWindow,appMPlayer.menuBase.width,appMPlayer.menuBase.height ); | 183 wsMoveWindow( &appMPlayer.mainWindow,appMPlayer.main.x,appMPlayer.main.y ); |
163 wsResizeImage( &appMPlayer.menuWindow,appMPlayer.menuBase.width,appMPlayer.menuBase.height ); | 184 wsResizeImage( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height ); |
164 } | 185 wsSetShape( &appMPlayer.mainWindow,appMPlayer.main.Mask.Image ); |
165 | 186 mainVisible=1; mplMainRender=1; wsPostRedisplay( &appMPlayer.mainWindow ); |
166 mplSkinChanged=1; | 187 wsWindowDecoration( &appMPlayer.mainWindow,appMPlayer.mainDecoration ); |
167 if ( appMPlayer.sub.Bitmap.Image ) wsResizeImage( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Width,appMPlayer.sub.Bitmap.Height ); | 188 wsVisibleWindow( &appMPlayer.mainWindow,wsShowWindow ); |
168 if ( !mplShMem->Playing ) | |
169 { | |
170 mplSkinChanged=0; | |
171 if ( !appMPlayer.subWindow.isFullScreen ) | |
172 { | |
173 wsResizeWindow( &appMPlayer.subWindow,appMPlayer.sub.width,appMPlayer.sub.height ); | |
174 wsMoveWindow( &appMPlayer.subWindow,appMPlayer.sub.x,appMPlayer.sub.y ); | |
175 } | |
176 wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.subR,appMPlayer.subG,appMPlayer.subB ); | |
177 wsClearWindow( appMPlayer.subWindow ); | |
178 mplSubRender=1; wsPostRedisplay( &appMPlayer.subWindow ); | |
179 } | |
180 | |
181 if ( mplDrawBuffer ) free( mplDrawBuffer ); | |
182 if ( ( mplDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.main.Bitmap.ImageSize ) ) == NULL ) | |
183 { message( False,MSGTR_NEMDB ); return; } | |
184 wsVisibleWindow( &appMPlayer.mainWindow,wsHideWindow ); | |
185 wsResizeWindow( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height ); | |
186 wsMoveWindow( &appMPlayer.mainWindow,appMPlayer.main.x,appMPlayer.main.y ); | |
187 wsResizeImage( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height ); | |
188 wsSetShape( &appMPlayer.mainWindow,appMPlayer.main.Mask.Image ); | |
189 mainVisible=1; mplMainRender=1; wsPostRedisplay( &appMPlayer.mainWindow ); | |
190 wsWindowDecoration( &appMPlayer.mainWindow,appMPlayer.mainDecoration ); | |
191 wsVisibleWindow( &appMPlayer.mainWindow,wsShowWindow ); | |
192 | 189 |
193 btnModify( evSetVolume,mplShMem->Volume ); | 190 btnModify( evSetVolume,mplShMem->Volume ); |
194 btnModify( evSetBalance,mplShMem->Balance ); | 191 btnModify( evSetBalance,mplShMem->Balance ); |
195 btnModify( evSetMoviePosition,mplShMem->Position ); | 192 btnModify( evSetMoviePosition,mplShMem->Position ); |
196 } | |
197 mplShMem->SkinChange=0; | |
198 } | 193 } |
199 | 194 |
200 void EventHandling( void ) | 195 void EventHandling( void ) |
201 { | 196 { |
202 wsHandleEvents();mplTimerHandler(0); // handle GUI timer events | 197 wsHandleEvents();mplTimerHandler(0); // handle GUI timer events |
203 if ( mplShMem->SkinChange ) ChangeSkin(); | 198 if ( mplShMem->SkinChange ) { ChangeSkin(); mplShMem->SkinChange=0; } |
204 } | 199 } |