diff options
author | pontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-09-17 21:16:00 +0000 |
---|---|---|
committer | pontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-09-17 21:16:00 +0000 |
commit | ba57320b827840b97f758a576244cc730ad468f5 (patch) | |
tree | 577f3cfda6057ec155302313f685ccc9290b65dc /Gui/mplayer/play.c | |
parent | 41bbd1a7fdf7f0d6143c7cb5abdc522a53f5820c (diff) | |
download | mpv-ba57320b827840b97f758a576244cc730ad468f5.tar.bz2 mpv-ba57320b827840b97f758a576244cc730ad468f5.tar.xz |
add new features. and fix skin error loop.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1908 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'Gui/mplayer/play.c')
-rw-r--r-- | Gui/mplayer/play.c | 113 |
1 files changed, 54 insertions, 59 deletions
diff --git a/Gui/mplayer/play.c b/Gui/mplayer/play.c index 0a45d3fe8a..fbf9b610c9 100644 --- a/Gui/mplayer/play.c +++ b/Gui/mplayer/play.c @@ -127,78 +127,73 @@ listItems tmpList; void ChangeSkin( void ) { - if ( strcmp( skinName,gtkShMem->sb.name ) ) - { - int ret; + int ret; + if ( !strcmp( skinName,gtkShMem->sb.name ) ) return; #ifdef DEBUG - dbprintf( 1,"[psignal] skin: %s\n",gtkShMem->sb.name ); + dbprintf( 1,"[psignal] skin: %s\n",gtkShMem->sb.name ); #endif - mainVisible=0; + mainVisible=0; - appInitStruct( &tmpList ); - skinAppMPlayer=&tmpList; - ret=skinRead( gtkShMem->sb.name ); + appInitStruct( &tmpList ); + skinAppMPlayer=&tmpList; + fntFreeFont(); + ret=skinRead( gtkShMem->sb.name ); - fntFreeFont(); + appInitStruct( &tmpList ); + skinAppMPlayer=&appMPlayer; + appInitStruct( &appMPlayer ); + if ( !ret ) strcpy( skinName,gtkShMem->sb.name ); + skinRead( skinName ); + if ( ret ) + { + mainVisible=1; + return; + } - appInitStruct( &tmpList ); - skinAppMPlayer=&appMPlayer; - appInitStruct( &appMPlayer ); - if ( !ret ) strcpy( skinName,gtkShMem->sb.name ); - skinRead( skinName ); + if ( appMPlayer.menuBase.Bitmap.Image ) + { + if ( mplMenuDrawBuffer ) free( mplMenuDrawBuffer ); + if ( ( mplMenuDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.menuBase.Bitmap.ImageSize ) ) == NULL ) + { message( False,MSGTR_NEMDB ); return; } + wsResizeWindow( &appMPlayer.menuWindow,appMPlayer.menuBase.width,appMPlayer.menuBase.height ); + wsResizeImage( &appMPlayer.menuWindow,appMPlayer.menuBase.width,appMPlayer.menuBase.height ); + } - if ( ret ) + mplSkinChanged=1; + if ( appMPlayer.sub.Bitmap.Image ) wsResizeImage( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Width,appMPlayer.sub.Bitmap.Height ); + if ( !mplShMem->Playing ) + { + mplSkinChanged=0; + if ( !appMPlayer.subWindow.isFullScreen ) { - mainVisible=1; - return; - } + wsResizeWindow( &appMPlayer.subWindow,appMPlayer.sub.width,appMPlayer.sub.height ); + wsMoveWindow( &appMPlayer.subWindow,appMPlayer.sub.x,appMPlayer.sub.y ); + } + wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.subR,appMPlayer.subG,appMPlayer.subB ); + wsClearWindow( appMPlayer.subWindow ); + mplSubRender=1; wsPostRedisplay( &appMPlayer.subWindow ); + } - if ( appMPlayer.menuBase.Bitmap.Image ) - { - if ( mplMenuDrawBuffer ) free( mplMenuDrawBuffer ); - if ( ( mplMenuDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.menuBase.Bitmap.ImageSize ) ) == NULL ) - { message( False,MSGTR_NEMDB ); return; } - wsResizeWindow( &appMPlayer.menuWindow,appMPlayer.menuBase.width,appMPlayer.menuBase.height ); - wsResizeImage( &appMPlayer.menuWindow,appMPlayer.menuBase.width,appMPlayer.menuBase.height ); - } - - mplSkinChanged=1; - if ( appMPlayer.sub.Bitmap.Image ) wsResizeImage( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Width,appMPlayer.sub.Bitmap.Height ); - if ( !mplShMem->Playing ) - { - mplSkinChanged=0; - if ( !appMPlayer.subWindow.isFullScreen ) - { - wsResizeWindow( &appMPlayer.subWindow,appMPlayer.sub.width,appMPlayer.sub.height ); - wsMoveWindow( &appMPlayer.subWindow,appMPlayer.sub.x,appMPlayer.sub.y ); - } - wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.subR,appMPlayer.subG,appMPlayer.subB ); - wsClearWindow( appMPlayer.subWindow ); - mplSubRender=1; wsPostRedisplay( &appMPlayer.subWindow ); - } - - if ( mplDrawBuffer ) free( mplDrawBuffer ); - if ( ( mplDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.main.Bitmap.ImageSize ) ) == NULL ) - { message( False,MSGTR_NEMDB ); return; } - wsVisibleWindow( &appMPlayer.mainWindow,wsHideWindow ); - wsResizeWindow( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height ); - wsMoveWindow( &appMPlayer.mainWindow,appMPlayer.main.x,appMPlayer.main.y ); - wsResizeImage( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height ); - wsSetShape( &appMPlayer.mainWindow,appMPlayer.main.Mask.Image ); - mainVisible=1; mplMainRender=1; wsPostRedisplay( &appMPlayer.mainWindow ); - wsWindowDecoration( &appMPlayer.mainWindow,appMPlayer.mainDecoration ); - wsVisibleWindow( &appMPlayer.mainWindow,wsShowWindow ); + if ( mplDrawBuffer ) free( mplDrawBuffer ); + if ( ( mplDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.main.Bitmap.ImageSize ) ) == NULL ) + { message( False,MSGTR_NEMDB ); return; } + wsVisibleWindow( &appMPlayer.mainWindow,wsHideWindow ); + wsResizeWindow( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height ); + wsMoveWindow( &appMPlayer.mainWindow,appMPlayer.main.x,appMPlayer.main.y ); + wsResizeImage( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height ); + wsSetShape( &appMPlayer.mainWindow,appMPlayer.main.Mask.Image ); + mainVisible=1; mplMainRender=1; wsPostRedisplay( &appMPlayer.mainWindow ); + wsWindowDecoration( &appMPlayer.mainWindow,appMPlayer.mainDecoration ); + wsVisibleWindow( &appMPlayer.mainWindow,wsShowWindow ); - btnModify( evSetVolume,mplShMem->Volume ); - btnModify( evSetBalance,mplShMem->Balance ); - btnModify( evSetMoviePosition,mplShMem->Position ); - } - mplShMem->SkinChange=0; + btnModify( evSetVolume,mplShMem->Volume ); + btnModify( evSetBalance,mplShMem->Balance ); + btnModify( evSetMoviePosition,mplShMem->Position ); } void EventHandling( void ) { wsHandleEvents();mplTimerHandler(0); // handle GUI timer events - if ( mplShMem->SkinChange ) ChangeSkin(); + if ( mplShMem->SkinChange ) { ChangeSkin(); mplShMem->SkinChange=0; } } |