From c090d0da98cfc613b7b9b7227dd505735df224a6 Mon Sep 17 00:00:00 2001 From: pontscho Date: Sat, 23 Feb 2002 15:12:55 +0000 Subject: new gui interface, and gtk moved into mplayer process. fork ... bleh :) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4819 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Gui/app.c | 4 +- Gui/bitmap.c | 38 +++----- Gui/bitmap.h | 1 + Gui/bitmap/bitmap.c | 38 +++----- Gui/bitmap/bitmap.h | 1 + Gui/bitmap/bmp/bmp.c | 33 ++----- Gui/bitmap/png/png.c | 17 +--- Gui/bitmap/tga/tga.c | 63 +++++-------- Gui/error.c | 61 ------------ Gui/error.h | 22 ----- Gui/events.h | 2 +- Gui/gui.mak | 4 +- Gui/interface.c | 33 ++++++- Gui/interface.h | 99 ++++++++++++++++++++ Gui/language.c | 45 --------- Gui/language.h | 7 -- Gui/mplayer/gtk/about.c | 3 +- Gui/mplayer/gtk/fs.c | 114 ++++++++++------------- Gui/mplayer/gtk/mb.c | 3 - Gui/mplayer/gtk/menu.c | 40 ++++---- Gui/mplayer/gtk/opts.c | 16 ++-- Gui/mplayer/gtk/pl.c | 3 - Gui/mplayer/gtk/sb.c | 35 ++++--- Gui/mplayer/menu.h | 8 +- Gui/mplayer/mplayer.c | 49 +++------- Gui/mplayer/mplayer.h | 6 +- Gui/mplayer/mw.h | 240 +++++++++++++++++++++--------------------------- Gui/mplayer/play.c | 117 ++++++++++------------- Gui/mplayer/play.h | 93 +------------------ Gui/mplayer/psignal.c | 234 ---------------------------------------------- Gui/mplayer/psignal.h | 69 -------------- Gui/mplayer/sw.h | 19 ++-- Gui/mplayer/widgets.c | 150 ++++++++++++++++++------------ Gui/mplayer/widgets.h | 72 +++------------ Gui/skin/font.c | 21 ++--- Gui/skin/skin.c | 177 ++++++++++++----------------------- Gui/timer.c | 37 -------- Gui/timer.h | 12 --- Gui/wm/ws.c | 19 ++-- Gui/wm/ws.h | 2 + Gui/wm/wsconv.c | 18 ++-- Gui/wm/wsconv.h | 16 ++-- mp_msg.h | 5 + mplayer.c | 106 ++++++++++----------- mplayer.h | 1 + 45 files changed, 735 insertions(+), 1418 deletions(-) delete mode 100644 Gui/error.c delete mode 100644 Gui/error.h delete mode 100644 Gui/language.c delete mode 100644 Gui/language.h delete mode 100644 Gui/mplayer/psignal.c delete mode 100644 Gui/mplayer/psignal.h delete mode 100644 Gui/timer.c delete mode 100644 Gui/timer.h diff --git a/Gui/app.c b/Gui/app.c index f9161a5bac..c3535f2fc1 100644 --- a/Gui/app.c +++ b/Gui/app.c @@ -8,7 +8,6 @@ #include "../help_mp.h" #include "app.h" -#include "error.h" #include "wm/wskeys.h" #include "skin/skin.h" #include "mplayer/mplayer.h" @@ -106,10 +105,9 @@ void appInit( int argc,char* argv[], char *envp[], void* disp ) printf("SKIN dir 2: '%s'\n",skinMPlayerDir); if ( !skinName ) { - if ( ( skinName=(char *)calloc( 1,7 ) ) == NULL ) { dbprintf( 0,"[config] Not enough memory.\n" ); exit( 1 ); } + if ( ( skinName=(char *)calloc( 1,7 ) ) == NULL ) { mp_msg( MSGT_GPLAYER,MSGL_STATUS,"[config] Not enough memory.\n" ); exit( 1 ); } strcpy( skinName,"default" ); } - initDebug(NULL); // write messages to stderr switch ( skinRead( skinName ) ) { case -1: mp_msg( MSGT_GPLAYER,MSGL_ERR,MSGTR_SKIN_SKINCFG_SkinNotFound,skinName ); exit( 0 ); diff --git a/Gui/bitmap.c b/Gui/bitmap.c index 657c1f3330..b04e2ba926 100644 --- a/Gui/bitmap.c +++ b/Gui/bitmap.c @@ -4,7 +4,6 @@ #include #include "bitmap.h" -#include "../error.h" #define BMP 1 #define TGA 2 @@ -25,13 +24,11 @@ int conv24to32( txSample * bf ) bf->BPP=32; if ( ( bf->Image=malloc( bf->ImageSize ) ) == NULL ) { - #ifdef DEBUG - dbprintf( 4,"[bitmap] Not enough memory for image.\n" ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bitmap] Not enough memory for image.\n" ); return 1; } memset( bf->Image,0,bf->ImageSize ); - for ( c=0,i=0;i < bf->Width * bf->Height * 3; ) + for ( c=0,i=0;i < (int)(bf->Width * bf->Height * 3); ) { bf->Image[c++]=tmpImage[i++]; bf->Image[c++]=tmpImage[i++]; @@ -47,7 +44,7 @@ void bgr2rgb( txSample * bf ) unsigned char c; int i; - for ( i=0;i < bf->ImageSize;i+=4 ) + for ( i=0;i < (int)bf->ImageSize;i+=4 ) { c=bf->Image[i]; bf->Image[i]=bf->Image[i+2]; @@ -58,8 +55,7 @@ void bgr2rgb( txSample * bf ) void Normalize( txSample * bf ) { int i; - - for ( i=0;i < bf->ImageSize;i+=4 ) bf->Image[i+3]=0; + for ( i=0;i < (int)bf->ImageSize;i+=4 ) bf->Image[i+3]=0; } unsigned char tmp[512]; @@ -149,23 +145,17 @@ int bpRead( char * fname, txSample * bf ) bgr=1; break; case TGAPACKED: - #ifdef DEBUG - dbprintf( 4,"[bitmap] sorry, packed TGA not supported.\n" ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bitmap] sorry, packed TGA not supported.\n" ); return -6; default: { - #ifdef DEBUG - dbprintf( 4,"[bitmap] Unknown file type ( %s ).\n",fname ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bitmap] Unknown file type ( %s ).\n",fname ); return -7; } } if ( bf->BPP < 24 ) { - #ifdef DEBUG - dbprintf( 4,"[bitmap] sorry, 16 or less bitmaps not supported.\n" ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bitmap] sorry, 16 or less bitmaps not supported.\n" ); return -1; } if ( conv24to32( bf ) ) return -8; @@ -180,15 +170,15 @@ void Convert32to1( txSample * in,txSample * out,int adaptivlimit ) out->Height=in->Height; out->BPP=1; out->ImageSize=out->Width * out->Height / 8; - dbprintf( 4,"[c1to32] imagesize: %d\n",out->ImageSize ); + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[c1to32] imagesize: %d\n",out->ImageSize ); out->Image=(char *)calloc( 1,out->ImageSize ); - if ( out->Image == NULL ) dbprintf( 4,"nem van ram baze\n" ); + if ( out->Image == NULL ) mp_msg( MSGT_GPLAYER,MSGL_STATUS,"nem van ram baze\n" ); { int i,b,c=0; unsigned long * buf = NULL; unsigned char tmp = 0; int nothaveshape = 1; buf=(unsigned long *)in->Image; - for ( b=0,i=0;i < out->Width * out->Height;i++ ) + for ( b=0,i=0;i < (int)(out->Width * out->Height);i++ ) { - if ( buf[i] != adaptivlimit ) tmp=( tmp >> 1 )|128; + if ( (int)buf[i] != adaptivlimit ) tmp=( tmp >> 1 )|128; else { tmp=tmp >> 1; buf[i]=nothaveshape=0; } if ( b++ == 7 ) { out->Image[c++]=tmp; tmp=b=0; } } @@ -205,12 +195,12 @@ void Convert1to32( txSample * in,txSample * out ) out->BPP=32; out->ImageSize=out->Width * out->Height * 4; out->Image=(char *)calloc( 1,out->ImageSize ); - dbprintf( 4,"[c32to1] imagesize: %d\n",out->ImageSize ); - if ( out->Image == NULL ) dbprintf( 4,"nem van ram baze\n" ); + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[c32to1] imagesize: %d\n",out->ImageSize ); + if ( (int)out->Image == NULL ) mp_msg( MSGT_GPLAYER,MSGL_STATUS,"nem van ram baze\n" ); { int i,b,c=0; unsigned long * buf = NULL; unsigned char tmp = 0; buf=(unsigned long *)out->Image; - for ( c=0,i=0;i < in->Width * in->Height / 8;i++ ) + for ( c=0,i=0;i < (int)(in->Width * in->Height / 8);i++ ) { tmp=in->Image[i]; for ( b=0;b<8;b++ ) diff --git a/Gui/bitmap.h b/Gui/bitmap.h index 6daa2927a1..913f2636a2 100644 --- a/Gui/bitmap.h +++ b/Gui/bitmap.h @@ -14,6 +14,7 @@ typedef struct _txSample #include "tga/tga.h" #include "bmp/bmp.h" #include "png/png.h" +#include "../../mp_msg.h" extern int bpRead( char * fname, txSample * bf ); extern int conv24to32( txSample * bf ); diff --git a/Gui/bitmap/bitmap.c b/Gui/bitmap/bitmap.c index 657c1f3330..b04e2ba926 100644 --- a/Gui/bitmap/bitmap.c +++ b/Gui/bitmap/bitmap.c @@ -4,7 +4,6 @@ #include #include "bitmap.h" -#include "../error.h" #define BMP 1 #define TGA 2 @@ -25,13 +24,11 @@ int conv24to32( txSample * bf ) bf->BPP=32; if ( ( bf->Image=malloc( bf->ImageSize ) ) == NULL ) { - #ifdef DEBUG - dbprintf( 4,"[bitmap] Not enough memory for image.\n" ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bitmap] Not enough memory for image.\n" ); return 1; } memset( bf->Image,0,bf->ImageSize ); - for ( c=0,i=0;i < bf->Width * bf->Height * 3; ) + for ( c=0,i=0;i < (int)(bf->Width * bf->Height * 3); ) { bf->Image[c++]=tmpImage[i++]; bf->Image[c++]=tmpImage[i++]; @@ -47,7 +44,7 @@ void bgr2rgb( txSample * bf ) unsigned char c; int i; - for ( i=0;i < bf->ImageSize;i+=4 ) + for ( i=0;i < (int)bf->ImageSize;i+=4 ) { c=bf->Image[i]; bf->Image[i]=bf->Image[i+2]; @@ -58,8 +55,7 @@ void bgr2rgb( txSample * bf ) void Normalize( txSample * bf ) { int i; - - for ( i=0;i < bf->ImageSize;i+=4 ) bf->Image[i+3]=0; + for ( i=0;i < (int)bf->ImageSize;i+=4 ) bf->Image[i+3]=0; } unsigned char tmp[512]; @@ -149,23 +145,17 @@ int bpRead( char * fname, txSample * bf ) bgr=1; break; case TGAPACKED: - #ifdef DEBUG - dbprintf( 4,"[bitmap] sorry, packed TGA not supported.\n" ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bitmap] sorry, packed TGA not supported.\n" ); return -6; default: { - #ifdef DEBUG - dbprintf( 4,"[bitmap] Unknown file type ( %s ).\n",fname ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bitmap] Unknown file type ( %s ).\n",fname ); return -7; } } if ( bf->BPP < 24 ) { - #ifdef DEBUG - dbprintf( 4,"[bitmap] sorry, 16 or less bitmaps not supported.\n" ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bitmap] sorry, 16 or less bitmaps not supported.\n" ); return -1; } if ( conv24to32( bf ) ) return -8; @@ -180,15 +170,15 @@ void Convert32to1( txSample * in,txSample * out,int adaptivlimit ) out->Height=in->Height; out->BPP=1; out->ImageSize=out->Width * out->Height / 8; - dbprintf( 4,"[c1to32] imagesize: %d\n",out->ImageSize ); + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[c1to32] imagesize: %d\n",out->ImageSize ); out->Image=(char *)calloc( 1,out->ImageSize ); - if ( out->Image == NULL ) dbprintf( 4,"nem van ram baze\n" ); + if ( out->Image == NULL ) mp_msg( MSGT_GPLAYER,MSGL_STATUS,"nem van ram baze\n" ); { int i,b,c=0; unsigned long * buf = NULL; unsigned char tmp = 0; int nothaveshape = 1; buf=(unsigned long *)in->Image; - for ( b=0,i=0;i < out->Width * out->Height;i++ ) + for ( b=0,i=0;i < (int)(out->Width * out->Height);i++ ) { - if ( buf[i] != adaptivlimit ) tmp=( tmp >> 1 )|128; + if ( (int)buf[i] != adaptivlimit ) tmp=( tmp >> 1 )|128; else { tmp=tmp >> 1; buf[i]=nothaveshape=0; } if ( b++ == 7 ) { out->Image[c++]=tmp; tmp=b=0; } } @@ -205,12 +195,12 @@ void Convert1to32( txSample * in,txSample * out ) out->BPP=32; out->ImageSize=out->Width * out->Height * 4; out->Image=(char *)calloc( 1,out->ImageSize ); - dbprintf( 4,"[c32to1] imagesize: %d\n",out->ImageSize ); - if ( out->Image == NULL ) dbprintf( 4,"nem van ram baze\n" ); + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[c32to1] imagesize: %d\n",out->ImageSize ); + if ( (int)out->Image == NULL ) mp_msg( MSGT_GPLAYER,MSGL_STATUS,"nem van ram baze\n" ); { int i,b,c=0; unsigned long * buf = NULL; unsigned char tmp = 0; buf=(unsigned long *)out->Image; - for ( c=0,i=0;i < in->Width * in->Height / 8;i++ ) + for ( c=0,i=0;i < (int)(in->Width * in->Height / 8);i++ ) { tmp=in->Image[i]; for ( b=0;b<8;b++ ) diff --git a/Gui/bitmap/bitmap.h b/Gui/bitmap/bitmap.h index 6daa2927a1..913f2636a2 100644 --- a/Gui/bitmap/bitmap.h +++ b/Gui/bitmap/bitmap.h @@ -14,6 +14,7 @@ typedef struct _txSample #include "tga/tga.h" #include "bmp/bmp.h" #include "png/png.h" +#include "../../mp_msg.h" extern int bpRead( char * fname, txSample * bf ); extern int conv24to32( txSample * bf ); diff --git a/Gui/bitmap/bmp/bmp.c b/Gui/bitmap/bmp/bmp.c index b362d3f9a3..4511f33eef 100644 --- a/Gui/bitmap/bmp/bmp.c +++ b/Gui/bitmap/bmp/bmp.c @@ -27,7 +27,6 @@ #include "bmp.h" #include "../bitmap.h" -#include "../../error.h" int bmpRead( unsigned char * fname,txSample * bF ) { @@ -40,16 +39,12 @@ int bmpRead( unsigned char * fname,txSample * bF ) if ( (BMP=fopen( fname,"rt" )) == NULL ) { -#ifdef DEBUG - dbprintf( 4,"[bmp] File not found ( %s ).\n",fname ); -#endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bmp] File not found ( %s ).\n",fname ); return 1; } if ( (i=fread( bmpHeader,54,1,BMP )) != 1 ) { -#ifdef DEBUG - dbprintf( 4,"[bmp] Header read error ( %s ).\n",fname ); -#endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bmp] Header read error ( %s ).\n",fname ); return 2; } // memcpy( &bF->Size,&bmpHeader[2],4 ); @@ -61,31 +56,23 @@ int bmpRead( unsigned char * fname,txSample * bF ) if ( bF->BPP < 24 ) { - #ifdef DEBUG - dbprintf( 4,"[bmp] Sorry, this loader not supported 16 bit or less ...\n" ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bmp] Sorry, this loader not supported 16 bit or less ...\n" ); return 3; } -#ifdef DEBUG - dbprintf( 4,"[bmp] filename: %s\n",fname ); - dbprintf( 4,"[bmp] size: %dx%d bits: %d\n",bF->Width,bF->Height,bF->BPP ); - dbprintf( 4,"[bmp] imagesize: %lu\n",bF->ImageSize ); -#endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bmp] filename: %s\n",fname ); + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bmp] size: %dx%d bits: %d\n",bF->Width,bF->Height,bF->BPP ); + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bmp] imagesize: %lu\n",bF->ImageSize ); if ( ( bF->Image=malloc( bF->ImageSize ) ) == NULL ) { - #ifdef DEBUG - dbprintf( 4,"[bmp] Not enough memory for image buffer.\n" ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bmp] Not enough memory for image buffer.\n" ); return 4; } if ( (i=fread( bF->Image,bF->ImageSize,1,BMP )) != 1 ) { - #ifdef DEBUG - dbprintf( 4,"[bmp] Image read error.\n" ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bmp] Image read error.\n" ); return 5; } @@ -94,9 +81,7 @@ int bmpRead( unsigned char * fname,txSample * bF ) linesize=bF->Width * ( bF->BPP / 8 ); if ( (line=malloc( linesize )) == NULL ) { - #ifdef DEBUG - dbprintf( 4,"[bmp] Not enough memory for flipping.\n" ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bmp] Not enough memory for flipping.\n" ); return 6; } diff --git a/Gui/bitmap/png/png.c b/Gui/bitmap/png/png.c index 113a22b095..175cf7e582 100644 --- a/Gui/bitmap/png/png.c +++ b/Gui/bitmap/png/png.c @@ -2,7 +2,6 @@ #include #include "./png.h" -#include "../../error.h" #include typedef struct @@ -106,9 +105,7 @@ int pngRead( unsigned char * fname,txSample * bf ) if ( pngLoadRaw( fname,&raw ) ) { - #ifdef DEBUG - dbprintf( 4,"[png] file read error ( %s ).\n",fname ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[png] file read error ( %s ).\n",fname ); return 1; } bf->Width=raw.Width; @@ -117,17 +114,13 @@ int pngRead( unsigned char * fname,txSample * bf ) bf->ImageSize=bf->Width * bf->Height * ( bf->BPP / 8 ); if ( ( bf->Image=malloc( bf->ImageSize ) ) == NULL ) { - #ifdef DEBUG - dbprintf( 4,"[png] Not enough memory for image buffer.\n" ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[png] Not enough memory for image buffer.\n" ); return 2; } memcpy( bf->Image,raw.Data,bf->ImageSize ); free( raw.Data ); - #ifdef DEBUG - dbprintf( 4,"[png] filename: %s.\n",fname ); - dbprintf( 4,"[png] size: %dx%d bits: %d\n",bf->Width,bf->Height,bf->BPP ); - dbprintf( 4,"[png] imagesize: %lu\n",bf->ImageSize ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[png] filename: %s.\n",fname ); + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[png] size: %dx%d bits: %d\n",bf->Width,bf->Height,bf->BPP ); + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[png] imagesize: %lu\n",bf->ImageSize ); return 0; } diff --git a/Gui/bitmap/tga/tga.c b/Gui/bitmap/tga/tga.c index 8a33f6a07e..de826d2bd8 100644 --- a/Gui/bitmap/tga/tga.c +++ b/Gui/bitmap/tga/tga.c @@ -4,7 +4,6 @@ #include #include "tga.h" -#include "../../error.h" int tgaRead( char * filename,txSample * bf ) { @@ -20,23 +19,17 @@ int tgaRead( char * filename,txSample * bf ) if ( !strstr( tmp,".tga" ) ) strcat( tmp,".tga" ); if ( (BMP=fopen( tmp,"rb" )) == NULL ) { - #ifdef DEBUG - dbprintf( 4,"[tga] File not found ( %s ).\n",tmp ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[tga] File not found ( %s ).\n",tmp ); return 1; } if ( (i=fread( &tgaHeader,sizeof( tgaHeader ),1,BMP )) != 1 ) { - #ifdef DEBUG - dbprintf( 4,"[tga] Header read error ( %s ).\n",tmp ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[tga] Header read error ( %s ).\n",tmp ); return 2; } if ( tgaHeader.depth < 24 ) { - #ifdef DEBUG - dbprintf( 4,"[tga] Sorry, this loader not supported 16 bit or less ...\n" ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[tga] Sorry, this loader not supported 16 bit or less ...\n" ); return 3; } bf->Width=tgaHeader.sx; @@ -46,9 +39,7 @@ int tgaRead( char * filename,txSample * bf ) if ( ( bf->Image=malloc( bf->ImageSize ) ) == NULL ) { - #ifdef DEBUG - dbprintf( 4,"[tga] Not enough memory for image buffer.\n" ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[tga] Not enough memory for image buffer.\n" ); return 4; } @@ -57,35 +48,29 @@ int tgaRead( char * filename,txSample * bf ) { if ( ( comment=malloc( tgaHeader.tmp[0] + 1 ) ) == NULL ) { - #ifdef DEBUG - dbprintf( 4,"[tga] Not enough memory for comment string.\n" ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[tga] Not enough memory for comment string.\n" ); return 5; } memset( comment,0,tgaHeader.tmp[0] + 1 ); if ( fread( comment,tgaHeader.tmp[0],1,BMP ) != 1 ) { - #ifdef DEBUG - dbprintf( 4,"[tga] Comment read error.\n" ); - #endif - return 6; + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[tga] Comment read error.\n" ); + return 6; } } - #ifdef DEBUG - dbprintf( 4,"[tga] filename ( read ): %s\n",tmp ); - dbprintf( 4,"[tga] size: %dx%d bits: %d\n",bf->Width,bf->Height,bf->BPP ); - dbprintf( 4,"[tga] imagesize: %lu\n",bf->ImageSize ); - if ( comment ) dbprintf( 4,"[tga] comment: %s\n",comment ); + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[tga] filename ( read ): %s\n",tmp ); + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[tga] size: %dx%d bits: %d\n",bf->Width,bf->Height,bf->BPP ); + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[tga] imagesize: %lu\n",bf->ImageSize ); + #ifdef MP_DEBUG + if ( comment ) mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[tga] comment: %s\n",comment ); #endif if ( comment ) free( comment ); if ( fread( bf->Image,bf->ImageSize,1,BMP ) != 1 ) { - #ifdef DEBUG - dbprintf( 4,"[tga] Image read error.\n" ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[tga] Image read error.\n" ); return 7; } @@ -96,9 +81,7 @@ int tgaRead( char * filename,txSample * bf ) linesize=bf->Width * ( bf->BPP / 8 ); if ( (line=malloc( linesize )) == NULL ) { - #ifdef DEBUG - dbprintf( 4,"[tga] Not enough memory for flipping.\n" ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[tga] Not enough memory for flipping.\n" ); return 8; } @@ -129,7 +112,7 @@ void tgaWriteTexture( char * filename,txSample * bf ) if ( !strstr( tmp,".tga" ) ) strcat( tmp,".tga" ); if ( ( BMP=fopen( tmp,"wb+" ) ) == NULL ) { - dbprintf( 0,"[tga] File not open ( %s ).\n",tmp ); + mp_msg( MSGT_GPLAYER,MSGL_STATUS,"[tga] File not open ( %s ).\n",tmp ); exit( 0 ); } memset( &tgaHeader,0,sizeof( tgaHeader ) ); @@ -141,21 +124,19 @@ void tgaWriteTexture( char * filename,txSample * bf ) if ( bf->BPP != 8 ) tgaHeader.tmp[2]=2; else tgaHeader.tmp[2]=3; - #ifdef DEBUG - dbprintf( 4,"\n[tga] filename ( write ): %s\n",tmp ); - dbprintf( 4,"[tga] size: %dx%d\n",bf->Width,bf->Height ); - dbprintf( 4,"[tga] bits: %d\n",bf->BPP ); - dbprintf( 4,"[tga] imagesize: %lu\n",bf->ImageSize ); - dbprintf( 4,"[tga] comment: %s\n",comment ); - dbprintf( 4,"\n" ); - #endif + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"\n[tga] filename ( write ): %s\n",tmp ); + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[tga] size: %dx%d\n",bf->Width,bf->Height ); + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[tga] bits: %d\n",bf->BPP ); + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[tga] imagesize: %lu\n",bf->ImageSize ); + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[tga] comment: %s\n",comment ); + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"\n" ); if ( tgaHeader.ctmp == 0 ) { linesize=bf->Width * ( bf->BPP / 8 ); if ( (line=malloc( linesize )) == NULL ) { - dbprintf( 0,"[tga] Not enough memory for flipping.\n" ); + mp_msg( MSGT_GPLAYER,MSGL_STATUS,"[tga] Not enough memory for flipping.\n" ); exit( 0 ); } diff --git a/Gui/error.c b/Gui/error.c deleted file mode 100644 index 16a38b1c24..0000000000 --- a/Gui/error.c +++ /dev/null @@ -1,61 +0,0 @@ - -#include -#include -#include - -#include "error.h" - -int debug_level = 2; -FILE * debug_file; -int debug_stderr = 0; - -void defaultErrorHandler( int critical,const char * format, ... ) -{ - char * p; - va_list ap; - - if ( (p=(char *)malloc( 512 ) ) == NULL ) return; - va_start( ap,format ); - vsnprintf( p,512,format,ap ); - va_end( ap ); - fprintf( stderr,"%s",p ); - free( p ); - if ( critical ) exit( 1 ); -} - -void defaultDebugHandler( int critical,const char * format, ... ) -{ - char * p; - va_list ap; - - if ( critical >= debug_level ) return; - if ( (p=(char *)malloc( 512 ) ) == NULL ) return; - va_start( ap,format ); - vsnprintf( p,512,format,ap ); - va_end( ap ); - fprintf( debug_file,"%s",p ); - free( p ); -} - -errorTHandler message = defaultErrorHandler; -errorTHandler dbprintf = defaultDebugHandler; - -void initDebug( char * name ) -{ - if ( name ) - { - if ( ( debug_file=fopen( name,"wt+" ) ) != NULL ) - { - debug_stderr=0; - return; - } - } - debug_file=stderr; - debug_stderr=1; -} -void doneDebug( void ) -{ - if ( !debug_stderr ) fclose( debug_file ); - debug_file=stderr; - debug_stderr=1; -} diff --git a/Gui/error.h b/Gui/error.h deleted file mode 100644 index 7ce79e7cde..0000000000 --- a/Gui/error.h +++ /dev/null @@ -1,22 +0,0 @@ - -#ifndef _MPLAYER_ERROR_HANDLER -#define _MPLAYER_ERROR_HANDLER - -#define True 1 -#define False 0 - -// 0 - standard message -// 1 - detto -// 2 - events -// 3 - skin reader messages -// 4 - bitmap reader messages -// 5 - signal handling messages -// 6 - gtk messages - -typedef void (*errorTHandler)( int critical,const char * format, ... ); - -extern errorTHandler message; -extern errorTHandler dbprintf; - -#endif - diff --git a/Gui/events.h b/Gui/events.h index 508e12ecb7..4c21cdbb99 100644 --- a/Gui/events.h +++ b/Gui/events.h @@ -47,7 +47,7 @@ #define evHelp 37 #define evLoadSubtitle 38 -#define evPlayDVD 39 +#define evPlayDVD 39 #define evExit 1000 diff --git a/Gui/gui.mak b/Gui/gui.mak index 5e2e05bb6e..cd12beebdd 100644 --- a/Gui/gui.mak +++ b/Gui/gui.mak @@ -7,9 +7,9 @@ GTKSRCS = $(MPLAYERDIR)gtk/menu.c $(MPLAYERDIR)gtk/mb.c $(MPLAYERDIR)gtk/about.c $(MPLAYERDIR)gtk/opts.c MPLAYERSRCS = $(MPLAYERDIR)mplayer.c $(MPLAYERDIR)widgets.c $(MPLAYERDIR)play.c \ - $(MPLAYERDIR)psignal.c $(GTKSRCS) + $(GTKSRCS) MPLAYEROBJS = $(MPLAYERSRCS:.c=.o) -SRCS = $(SKINSRC) $(BITMAPSRCS) wm/ws.c wm/wsconv.c app.c events.c timer.c error.c interface.c +SRCS = $(SKINSRC) $(BITMAPSRCS) wm/ws.c wm/wsconv.c app.c events.c interface.c OBJS = $(SRCS:.c=.o) diff --git a/Gui/interface.c b/Gui/interface.c index c4b1fba858..ff003d4064 100644 --- a/Gui/interface.c +++ b/Gui/interface.c @@ -1,9 +1,31 @@ +#include #include "ws.h" #include "mplayer/play.h" #include "interface.h" + #include "../mplayer.h" +#include "mplayer/widgets.h" +#include "mplayer/mplayer.h" +#include "app.h" +#include "../libvo/x11_common.h" + +guiInterface_t guiIntfStruct; + +void guiInit( int argc,char* argv[], char *envp[] ) +{ + memset( &guiIntfStruct,0,sizeof( guiIntfStruct ) ); + appInit( argc,argv,envp,(void*)mDisplay ); +} + +void guiDone( void ) +{ + mp_msg( MSGT_GPLAYER,MSGL_V,"[mplayer] exit.\n" ); + mplStop(); + gtkDone(); + wsXDone(); +} void guiGetEvent( int type,char * arg ) { @@ -11,15 +33,16 @@ void guiGetEvent( int type,char * arg ) { case guiXEvent: wsEvents( wsDisplay,(XEvent *)arg,NULL ); - break; + gtkEventHandling(); + break; case guiCEvent: - break; + break; } } void guiEventHandling( void ) { - if ( use_gui && !mplShMem->Playing ) wsHandleEvents(); - mplTimerHandler(0); // handle GUI timer events - if ( mplShMem->SkinChange ) { ChangeSkin(); mplShMem->SkinChange=0; } + if ( use_gui && !guiIntfStruct.Playing ) wsHandleEvents(); + gtkEventHandling(); + mplTimerHandler(); // handle GUI timer events } diff --git a/Gui/interface.h b/Gui/interface.h index f3580a37e0..0125ad9e06 100644 --- a/Gui/interface.h +++ b/Gui/interface.h @@ -2,13 +2,112 @@ #ifndef _INTERFACE_H #define _INTERFACE_H +#include "../config.h" #include "mplayer/play.h" #include "../mplayer.h" +#ifdef USE_DVDREAD + #include "../libmpdemux/stream.h" +#endif + + +typedef struct +{ + int x; + int y; + int width; + int height; +} guiResizeStruct; + +typedef struct +{ + int signal; + char module[512]; +} guiUnknowErrorStruct; + +typedef struct +{ + int seek; + int format; + int width; + int height; + char codecdll[128]; +} guiVideoStruct; + +#ifdef USE_DVDREAD +typedef struct +{ + int titles; + int chapters; + int angles; + int current_chapter; + int current_title; + int current_angle; + int nr_of_audio_channels; + stream_language_t audio_streams[32]; + int nr_of_subtitles; + stream_language_t subtitles[32]; +} guiDVDStruct; +#endif + +typedef struct +{ + int message; + guiResizeStruct resize; + guiVideoStruct videodata; + guiUnknowErrorStruct error; +#ifdef USE_DVDREAD + guiDVDStruct DVD; + int DVDChanged; +#endif + + int Playing; + float Position; + + int MovieWidth; + int MovieHeight; + + float Volume; + int VolumeChanged; + float Balance; + int Mute; + + int Track; + int AudioType; + int StreamType; + int TimeSec; + int LengthInSec; + int FrameDrop; + + char * Filename; + int FilenameChanged; + + char * Subtitlename; + int SubtitleChanged; + + char * Othername; + int OtherChanged; + + int SkinChange; +} guiInterface_t; + +extern guiInterface_t guiIntfStruct; + #define guiXEvent 0 #define guiCEvent 1 +extern void guiInit( int argc,char* argv[], char *envp[] ); extern void guiGetEvent( int type,char * arg ); extern void guiEventHandling( void ); +#define guiSetFilename( s,n ) \ + { if ( s ) free( s ); s=NULL; s=strdup( n ); } + +#define guiSetDF( s,d,n ) \ + { \ + if ( s ) free( s ); s=NULL; \ + s=malloc( strlen( d ) + strlen( n ) + 5 ); \ + sprintf( s,"%s/%s",d,n ); \ + } + #endif \ No newline at end of file diff --git a/Gui/language.c b/Gui/language.c deleted file mode 100644 index 75faba2b10..0000000000 --- a/Gui/language.c +++ /dev/null @@ -1,45 +0,0 @@ - -// --- labels --- -char * langAbout = "About"; -char * langFileSelect = "Select file ..."; -char * langMessageBox = "MessageBox"; -char * langPlayList = "PlayList"; -char * langSkinBrowser = "Skin Browser"; - -// --- buttons --- -char * langOk = "Ok"; -char * langCancel = "Cancel"; -char * langAdd = "Add"; -char * langRemove = "Remove"; - -// --- error messages --- -char * langNEMDB = "Sorry, not enough memory for draw buffer."; -char * langNEMFMR = "Sorry, not enough memory for menu rendering."; -char * langNEMFMM = "Sorry, not enough memory for main window shape mask."; - -#if 0 -char * langLIRCSNW = "LIRC support not working. Disabled."; -char * langAudioDriverSelectNotSupported = "Your audio driver DOES NOT support select(). Recompile mplayer with #undef HAVE_AUDIO_SELECT in config.h !"; -char * langNotSupportedFileFormat = "Sorry, this file format not recognized/supported. If this file is an AVI, ASF or MPEG stream, please contact the author!"; -char * langCodecConfNotFound = "The codecs.conf config file not found. Please copy/link DOCS/codecs.conf to ~/.mplayer/codecs.conf."; -char * langErrorProcessingDVDKey = "Error processing DVD KEY."; -char * langErrorInDVDAuth = "Error in DVD authentication."; -char * langAVIMissing = "AVI_NI: missing video stream!? contact the author, it may be a bug. :("; -char * langAVIMissingVideoStream = "AVI: missing video stream!? contact the author, it may be a bug. :("; -char * langASFMissingVideoStream = "ASF: missing video stream!? contact the author, it may be a bug. :("; -char * langMPEGEOFNotFound = "MPEG: FATAL: EOF while searching for sequence header."; -char * langCannotAllocateSharedMem = "Cannot allocate shared memory. ( Not enough memory ? )"; -char * langMPEGCannotReadSeqHeader = "MPEG: FATAL: Cannot read sequence header!"; -char * langMPEGBadSeqHeader = "MPEG: Bad sequence header!"; -char * langMPEGCannotReadSeqHeaderExt = "MPEG: FATAL: Cannot read sequence header extension!"; -char * langMPEGBadSeqHeaderExt = "MPEG: Bad sequence header extension!"; -char * langCantFindCodec = "Can't find codec for video format"; -char * langSelectedVideoOutIncompTheCodec = "Sorry, selected video_out device is incompatible with this codec."; -char * langMPCompWithoutDSSupport = "MPlayer was compiled WITHOUT directshow support!"; -char * langDSCodecNotFound = "ERROR: Couldn't open required DirectShow codec: %s. " \ - "Maybe you forget to upgrade your win32 codecs?? It's time to download the new " \ - "package from: ftp://thot.banki.hu/esp-team/linux/MPlayer/w32codec.zip! " \ - "Or you should disable DShow support."; -char * langCantInitVideoDriver = "FATAL: Cannot initialize video driver!"; -char * langUnknowError = "Unknow error. Please contact the developer team."; -#endif diff --git a/Gui/language.h b/Gui/language.h deleted file mode 100644 index 945d955790..0000000000 --- a/Gui/language.h +++ /dev/null @@ -1,7 +0,0 @@ - -#ifndef __MPLAYER_LANG -#define __MPLAYER_LANG - -#include "../help_mp.h" - -#endif \ No newline at end of file diff --git a/Gui/mplayer/gtk/about.c b/Gui/mplayer/gtk/about.c index 9a09fae2ce..3f881aee2d 100644 --- a/Gui/mplayer/gtk/about.c +++ b/Gui/mplayer/gtk/about.c @@ -10,7 +10,6 @@ void ab_Ok_released( GtkButton * button,gpointer user_data ) { gtk_widget_hide( AboutBox ); - gtkVisibleAboutBox=0; } GtkWidget * create_About( void ) @@ -157,7 +156,7 @@ GtkWidget * create_About( void ) "Homepage:\n" \ " Design: Chass\n" \ " Contents: Gabucino\n" \ - " LGB\n\n" \ + " LGB\n\n" \ "English documentation:\n" \ " tech-*.txt: A'rpi\n" \ " all the others: Gabucino\n\n" \ diff --git a/Gui/mplayer/gtk/fs.c b/Gui/mplayer/gtk/fs.c index a40c6365f3..2cca47d75b 100644 --- a/Gui/mplayer/gtk/fs.c +++ b/Gui/mplayer/gtk/fs.c @@ -7,14 +7,13 @@ #include #include "./mplayer.h" -#include "psignal.h" -#include "../error.h" #include "pixmaps/up.xpm" #include "pixmaps/dir.xpm" #include "pixmaps/file.xpm" #include "../../events.h" +#include "../../interface.h" #include "../../../config.h" #include "../../../help_mp.h" @@ -35,30 +34,30 @@ unsigned char * fsThatDir = "."; gchar fsFilter[8] = "*"; int fsPressed = 0; -int fsMessage = -1; -int fsType = 0; +int fsMessage = -1; +int fsType = 0; #define fsNumberOfVideoFilterNames 6 -char * fsVideoFilterNames[fsNumberOfVideoFilterNames+1][2] = +char * fsVideoFilterNames[fsNumberOfVideoFilterNames+1][2] = { { "MPEG files ( *.mpg )", "*.mpg" }, - { "VOB files ( *.vob )", "*.vob" }, + { "VOB files ( *.vob )", "*.vob" }, { "AVI files ( *.avi )", "*.avi" }, - { "QT files ( *.mov )", "*.mov" }, - { "ASF files ( *.asf )", "*.asf" }, - { "VIVO files ( *.viv )", "*.viv" }, + { "QT files ( *.mov )", "*.mov" }, + { "ASF files ( *.asf )", "*.asf" }, + { "VIVO files ( *.viv )", "*.viv" }, { "All files ( * )", "*" } }; - + #define fsNumberOfSubtitleFilterNames 8 char * fsSubtitleFilterNames[fsNumberOfSubtitleFilterNames+1][2] = { { "UTF ( *.utf )", "*.utf" }, - { "SUB ( *.sub )", "*.sub" }, - { "SRT ( *.srt )", "*.str" }, + { "SUB ( *.sub )", "*.sub" }, + { "SRT ( *.srt )", "*.str" }, { "SMI ( *.smi )", "*.smi" }, { "RT ( *.rt )", "*.rt" }, { "TXT ( *.txt )", "*.txt" }, { "SSA ( *.ssa )", "*.ssa" }, { "AQT ( *.aqt )", "*.aqt" }, - { "All files ( * )", "*" } }; + { "All files ( * )", "*" } }; #define fsNumberOfOtherFilterNames 0 char * fsOtherFilterNames[fsNumberOfOtherFilterNames+1][2] = @@ -99,7 +98,7 @@ void CheckDir( GtkWidget * list,char * directory ) gtk_widget_hide( list ); gtk_clist_clear( GTK_CLIST( list ) ); str[0][0]=NULL; - + pixmap=dpixmap; mask=dmask; str[0][0]=NULL; str[0][1]=(gchar *)malloc( 3 ); strcpy( str[0][1],"." ); gtk_clist_append( GTK_CLIST( list ),str[0] ); gtk_clist_set_pixmap( GTK_CLIST( list ),0,0,pixmap,mask ); @@ -121,9 +120,9 @@ void CheckDir( GtkWidget * list,char * directory ) free( str[0][1] ); } globfree( &gg ); - + glob( fsFilter,0,NULL,&gg ); - + #if 0 if ( !strcmp( fsFilter,"*" ) ) { @@ -132,7 +131,7 @@ void CheckDir( GtkWidget * list,char * directory ) for( i=0;i= 'A' )&&( f[i] <= 'Z' ) ) f[i]+=32; glob( f,GLOB_APPEND,NULL,&gg ); - + for( i=0;i= 'a' )&&( f[i] <= 'z' ) ) f[i]-=32; glob( f,GLOB_APPEND,NULL,&gg ); @@ -163,13 +162,13 @@ void CheckDir( GtkWidget * list,char * directory ) void ShowFileSelect( int type ) { int i; - if ( gtkVisibleFileSelect ) gtk_widget_hide( FileSelect ); + gtk_widget_hide( FileSelect ); fsType=type; switch ( type ) { case fsVideoSelector: fsMessage=evFileLoaded; - gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_FileSelect ); + gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_FileSelect ); fsList_items=NULL; for( i=0;ivs.window=evLoad; - gtkSendMessage( evHideWindow ); } void fs_fsFileSelect_destroy( GtkObject * object,gpointer user_data ) @@ -223,35 +218,35 @@ void fs_fsFilterCombo_changed( GtkEditable * editable,gpointer user_data ) int i; str=gtk_entry_get_text( GTK_ENTRY(user_data ) ); - + switch ( fsType ) { case fsVideoSelector: for( i=0;i directory: %s\n",fsSelectedDirectory ); -// printf( "----gtk---> filename: %s\n",fsSelectedFile ); switch ( fsType ) { case fsVideoSelector: - strcpy( gtkShMem->fs.dir,fsSelectedDirectory ); - strcpy( gtkShMem->fs.filename,fsSelectedFile ); -// printf( "----gtksm-> directory: %s\n",gtkShMem->fs.dir ); -// printf( "----gtksm-> filename: %s\n",gtkShMem->fs.filename ); - gtkSendMessage( evFileLoaded ); - break; + guiSetDF( guiIntfStruct.Filename,fsSelectedDirectory,fsSelectedFile ); + guiIntfStruct.StreamType=STREAMTYPE_FILE; + guiIntfStruct.FilenameChanged=1; + break; case fsSubtitleSelector: - strcpy( gtkShMem->fs.subtitlename,fsSelectedDirectory ); - strcat( gtkShMem->fs.subtitlename,"/" ); - strcat( gtkShMem->fs.subtitlename,fsSelectedFile ); - gtkSendMessage( evSubtitleLoaded ); + guiSetDF( guiIntfStruct.Subtitlename,fsSelectedDirectory,fsSelectedFile ); + guiIntfStruct.SubtitleChanged=1; break; case fsOtherSelector: - strcpy( gtkShMem->fs.otherfilename,fsSelectedDirectory ); - strcat( gtkShMem->fs.subtitlename,"/" ); - strcat( gtkShMem->fs.otherfilename,fsSelectedFile ); + guiSetDF( guiIntfStruct.Othername,fsSelectedDirectory,fsSelectedFile ); break; } item=fsTopList_items; @@ -375,6 +352,7 @@ void fs_Ok_released( GtkButton * button,gpointer user_data ) fsTopList_items=g_list_prepend( fsTopList_items,(gchar *)get_current_dir_name() ); gtk_combo_set_popdown_strings( GTK_COMBO( user_data ),fsTopList_items ); } + if ( mplMainAutoPlay ) mplEventHandling( evPlay,0 ); } void fs_Cancel_released( GtkButton * button,gpointer user_data ) @@ -382,7 +360,7 @@ void fs_Cancel_released( GtkButton * button,gpointer user_data ) void fs_fsFNameList_select_row( GtkWidget * widget,gint row,gint column,GdkEventButton *bevent,gpointer user_data ) { - gtk_clist_get_text( GTK_CLIST(widget ),row,1,&fsSelectedFile ); + gtk_clist_get_text( GTK_CLIST(widget ),row,1,&fsSelectedFile ); fsPressed=1; if( !bevent ) return; if( bevent->type == GDK_2BUTTON_PRESS ) gtk_button_released( GTK_BUTTON( fsOk ) ); diff --git a/Gui/mplayer/gtk/mb.c b/Gui/mplayer/gtk/mb.c index 9382ea4e6c..31ae2f1ea8 100644 --- a/Gui/mplayer/gtk/mb.c +++ b/Gui/mplayer/gtk/mb.c @@ -21,14 +21,11 @@ void on_MessageBox_destroy( GtkObject * object,gpointer user_data ) } */ gtk_widget_hide( MessageBox ); - gtkVisibleMessageBox=0; } void on_Ok_released( GtkButton * button,gpointer user_data ) { gtk_widget_hide( MessageBox ); - gtkVisibleMessageBox=0; - gtkSendMessage( evMessageBox ); } GtkWidget * create_MessageBox( int type ) diff --git a/Gui/mplayer/gtk/menu.c b/Gui/mplayer/gtk/menu.c index 82688d0013..58b8e8ce53 100644 --- a/Gui/mplayer/gtk/menu.c +++ b/Gui/mplayer/gtk/menu.c @@ -14,10 +14,9 @@ void ActivateMenuItem( int Item ) { // fprintf( stderr,"[menu] item: %d.%d\n",Item&0xffff,Item>>16 ); - gtkShMem->popupmenu=Item & 0x0000ffff; - gtkShMem->popupmenuparam=Item >> 16; - gtkShMem->visiblepopupmenu=0; - gtkSendMessage( evShowPopUpMenu ); + gtkPopupMenu=Item & 0x0000ffff; + gtkPopupMenuParam=Item >> 16; + mplEventHandling( Item & 0x0000ffff,Item >> 16 ); } GtkWidget * AddMenuItem( GtkWidget * Menu,char * label,int Number ) @@ -246,6 +245,7 @@ char * GetLanguage( int language ) int i; for ( i=0;iDVD.titles ) + if ( guiIntfStruct.DVD.titles ) { char tmp[32]; int i; - for ( i=0;iDVD.titles;i++ ) + for ( i=0;i < guiIntfStruct.DVD.titles;i++ ) { sprintf( tmp,MSGTR_MENU_Title,i+1 ); AddMenuItem( DVDTitleMenu,tmp,( (i+1) << 16 ) + evSetDVDTitle ); } } - else + else { MenuItem=AddMenuItem( DVDTitleMenu,MSGTR_MENU_None,evNone ); gtk_widget_set_sensitive( MenuItem,FALSE ); } DVDChapterMenu=AddSubMenu( DVDSubMenu,MSGTR_MENU_Chapters ); - if ( gtkShMem->DVD.chapters ) + if ( guiIntfStruct.DVD.chapters ) { char tmp[32]; int i; - for ( i=0;iDVD.chapters;i++ ) + for ( i=0;i < guiIntfStruct.DVD.chapters;i++ ) { sprintf( tmp,MSGTR_MENU_Chapter,i+1 ); AddMenuItem( DVDChapterMenu,tmp,( (i+1) << 16 ) + evSetDVDChapter ); } } - else + else { MenuItem=AddMenuItem( DVDChapterMenu,MSGTR_MENU_None,evNone ); gtk_widget_set_sensitive( MenuItem,FALSE ); } DVDAudioLanguageMenu=AddSubMenu( DVDSubMenu,MSGTR_MENU_AudioLanguages ); - if ( gtkShMem->DVD.nr_of_audio_channels ) + if ( guiIntfStruct.DVD.nr_of_audio_channels ) { char tmp[64]; int i; - for ( i=0;iDVD.nr_of_audio_channels;i++ ) + for ( i=0;i < guiIntfStruct.DVD.nr_of_audio_channels;i++ ) { - strcpy( tmp,GetLanguage( gtkShMem->DVD.audio_streams[i].language ) ); - AddMenuItem( DVDAudioLanguageMenu,tmp,( gtkShMem->DVD.audio_streams[i].id << 16 ) + evSetDVDAudio ); + strcpy( tmp,GetLanguage( guiIntfStruct.DVD.audio_streams[i].language ) ); + AddMenuItem( DVDAudioLanguageMenu,tmp,( guiIntfStruct.DVD.audio_streams[i].id << 16 ) + evSetDVDAudio ); } } - else + else { MenuItem=AddMenuItem( DVDAudioLanguageMenu,MSGTR_MENU_None,evNone ); gtk_widget_set_sensitive( MenuItem,FALSE ); } DVDSubtitleLanguageMenu=AddSubMenu( DVDSubMenu,MSGTR_MENU_SubtitleLanguages ); - if ( gtkShMem->DVD.nr_of_subtitles ) + if ( guiIntfStruct.DVD.nr_of_subtitles ) { char tmp[64]; int i; - for ( i=0;iDVD.nr_of_subtitles;i++ ) + for ( i=0;i < guiIntfStruct.DVD.nr_of_subtitles;i++ ) { - strcpy( tmp,GetLanguage( gtkShMem->DVD.subtitles[i].language ) ); - AddMenuItem( DVDSubtitleLanguageMenu,tmp,( gtkShMem->DVD.subtitles[i].id << 16 ) + evSetDVDSubtitle ); + strcpy( tmp,GetLanguage( guiIntfStruct.DVD.subtitles[i].language ) ); + AddMenuItem( DVDSubtitleLanguageMenu,tmp,( guiIntfStruct.DVD.subtitles[i].id << 16 ) + evSetDVDSubtitle ); } } - else + else { MenuItem=AddMenuItem( DVDSubtitleLanguageMenu,MSGTR_MENU_None,evNone ); gtk_widget_set_sensitive( MenuItem,FALSE ); diff --git a/Gui/mplayer/gtk/opts.c b/Gui/mplayer/gtk/opts.c index adda2b963e..90981f28c9 100644 --- a/Gui/mplayer/gtk/opts.c +++ b/Gui/mplayer/gtk/opts.c @@ -1,7 +1,8 @@ +#include +#include + #include "./mplayer.h" -#include "psignal.h" -#include "../error.h" #include "../../events.h" #include "../../../config.h" @@ -27,14 +28,11 @@ GtkWidget * opAutoFullscreenCheckBox; GtkWidget * opOk; GtkWidget * opCancel; -int opShift = False; +int opShift = 0; void HideOptions( void ) { gtk_widget_hide( Options ); - gtkVisibleOptions=0; - gtkShMem->vs.window=evPreferences; - gtkSendMessage( evHideWindow ); } gboolean on_window2_key_press_event( GtkWidget * widget,GdkEventKey * event,gpointer user_data ) @@ -43,10 +41,10 @@ gboolean on_window2_key_press_event( GtkWidget * widget,GdkEventKey * event,gpoi { case GDK_Shift_L: case GDK_Shift_R: - opShift=True; + opShift=1; break; } - return FALSE; + return 0; } gboolean on_window2_key_release_event( GtkWidget * widget,GdkEventKey * event,gpointer user_data ) @@ -66,7 +64,7 @@ gboolean on_window2_key_release_event( GtkWidget * widget,GdkEventKey * event,gp break; case GDK_Shift_L: case GDK_Shift_R: - opShift=False; + opShift=0; break; } return FALSE; diff --git a/Gui/mplayer/gtk/pl.c b/Gui/mplayer/gtk/pl.c index abc946889e..ecd2b86b86 100644 --- a/Gui/mplayer/gtk/pl.c +++ b/Gui/mplayer/gtk/pl.c @@ -9,9 +9,6 @@ void HidePlayList( void ) { gtk_widget_hide( PlayList ); - gtkVisiblePlayList=0; - gtkShMem->vs.window=evPlayList; - gtkSendMessage( evHideWindow ); } void pl_PlayList_destroy( GtkObject * object,gpointer user_data ) diff --git a/Gui/mplayer/gtk/sb.c b/Gui/mplayer/gtk/sb.c index fcf6b037fd..ac991eff44 100644 --- a/Gui/mplayer/gtk/sb.c +++ b/Gui/mplayer/gtk/sb.c @@ -4,6 +4,7 @@ #include #include #include +#include #include "sb.h" #include "../../events.h" @@ -18,16 +19,7 @@ char * sbSelectedSkin=NULL; char * sbMPlayerDirInHome=NULL; char * sbMPlayerPrefixDir=NULL; -void HideSkinBrowser( void ) -{ - gtk_widget_hide( SkinBrowser ); - gtkVisibleSkinBrowser=0; - gtkShMem->vs.window=evSkinBrowser; - gtkSendMessage( evHideWindow ); - gtkSendMessage( evSkinBrowser ); -} - -char gtkOldSkin[128]; +char * gtkOldSkin; int gtkFillSkinList( gchar * mdir ) { @@ -37,7 +29,7 @@ int gtkFillSkinList( gchar * mdir ) glob_t gg; struct stat fs; - strcpy( gtkOldSkin,gtkShMem->sb.name ); + gtkOldSkin=strdup( skinName ); if ( ( str[0]=(char *)calloc( 1,7 ) ) == NULL ) { gtkMessageBox( GTK_MB_FATAL,MSGTR_SKINBROWSER_NotEnoughMemory ); @@ -68,21 +60,28 @@ int gtkFillSkinList( gchar * mdir ) } void on_SkinBrowser_destroy( GtkObject * object,gpointer user_data ) -{ HideSkinBrowser(); } +{ gtk_widget_hide( SkinBrowser ); } void on_SkinBrowser_Cancel( GtkObject * object,gpointer user_data ) { - strcpy( gtkShMem->sb.name,gtkOldSkin ); - HideSkinBrowser(); + ChangeSkin( skinName ); + gtk_widget_hide( SkinBrowser ); +} + +void on_SkinBrowser_Ok( GtkObject * object,gpointer user_data ) +{ + ChangeSkin( sbSelectedSkin ); + if ( skinName ) free( skinName ); + skinName=strdup( sbSelectedSkin ); + gtk_widget_hide( SkinBrowser ); } void on_SkinList_select_row( GtkCList * clist,gint row,gint column,GdkEvent * bevent,gpointer user_data ) { gtk_clist_get_text( clist,row,0,&sbSelectedSkin ); - strcpy( gtkShMem->sb.name,sbSelectedSkin ); - gtkSendMessage( evSkinBrowser ); + ChangeSkin( sbSelectedSkin ); if( !bevent ) return; - if( bevent->type == GDK_2BUTTON_PRESS ) HideSkinBrowser(); + if( bevent->type == GDK_2BUTTON_PRESS ) gtk_widget_hide( SkinBrowser ); } GtkWidget * create_SkinBrowser( void ) @@ -248,7 +247,7 @@ GtkWidget * create_SkinBrowser( void ) gtk_signal_connect( GTK_OBJECT( SkinBrowser ),"destroy",GTK_SIGNAL_FUNC( on_SkinBrowser_destroy ),NULL ); gtk_signal_connect( GTK_OBJECT( SkinList ),"select_row",GTK_SIGNAL_FUNC( on_SkinList_select_row ),NULL ); - gtk_signal_connect( GTK_OBJECT( Ok ),"released",GTK_SIGNAL_FUNC( on_SkinBrowser_destroy ),NULL ); + gtk_signal_connect( GTK_OBJECT( Ok ),"released",GTK_SIGNAL_FUNC( on_SkinBrowser_Ok ),NULL ); gtk_signal_connect( GTK_OBJECT( Cancel ),"released",GTK_SIGNAL_FUNC( on_SkinBrowser_Cancel ),NULL ); if ( ( sbMPlayerDirInHome=(char *)calloc( 1,strlen( skinDirInHome ) + 4 ) ) != NULL ) diff --git a/Gui/mplayer/menu.h b/Gui/mplayer/menu.h index f72467ad96..b8031dcb12 100644 --- a/Gui/mplayer/menu.h +++ b/Gui/mplayer/menu.h @@ -100,14 +100,14 @@ void mplHideMenu( int mx,int my ) if ( ( x < 0 ) || ( y < 0 ) ) return; -// printf( "---------> %d %d,%d\n",i,x,y ); +// printf( "---------> %d %d,%d\n",i,x,y ); // printf( "--------> mi: %d,%d %dx%d\n",appMPlayer.MenuItems[i].x,appMPlayer.MenuItems[i].y,appMPlayer.MenuItems[i].width,appMPlayer.MenuItems[i].height ); if ( wgIsRect( x,y, appMPlayer.MenuItems[i].x,appMPlayer.MenuItems[i].y, appMPlayer.MenuItems[i].x+appMPlayer.MenuItems[i].width, appMPlayer.MenuItems[i].y+appMPlayer.MenuItems[i].height ) ) { - mplMsgHandle( appMPlayer.MenuItems[i].msg,0 ); + mplEventHandling( appMPlayer.MenuItems[i].msg,0 ); } } @@ -122,7 +122,7 @@ void mplMenuInit( void ) if ( ( mplMenuDrawBuffer = calloc( 1,appMPlayer.menuBase.Bitmap.ImageSize ) ) == NULL ) { #ifdef DEBUG - dbprintf( 1,MSGTR_NEMFMR ); + mp_msg( MSGT_GPLAYER,MSGL_DBG2,"[menu.h] %s",MSGTR_NEMFMR ); #endif gtkMessageBox( GTK_MB_FATAL,MSGTR_NEMFMR ); return; @@ -133,7 +133,7 @@ void mplMenuInit( void ) wsNoBorder,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,wsOverredirect|wsHideFrame|wsMaxSize|wsMinSize|wsHideWindow,"MPlayer menu" ); #ifdef DEBUG - dbprintf( 1,"[menu.h] menu: 0x%x\n",(int)appMPlayer.menuWindow.WindowID ); + mp_msg( MSGT_GPLAYER,MSGL_DBG2,"[menu.h] menu: 0x%x\n",(int)appMPlayer.menuWindow.WindowID ); #endif appMPlayer.menuWindow.ReDraw=mplMenuDraw; diff --git a/Gui/mplayer/mplayer.c b/Gui/mplayer/mplayer.c index ac6552f0a6..a9f2e1bf95 100644 --- a/Gui/mplayer/mplayer.c +++ b/Gui/mplayer/mplayer.c @@ -7,29 +7,28 @@ #include "./mplayer.h" #include "../events.h" #include "../app.h" +#include "../interface.h" #include "../skin/skin.h" #include "../skin/font.h" #include "../wm/ws.h" #include "../wm/wskeys.h" #include "../wm/widget.h" #include "../bitmap/bitmap.h" -#include "../timer.h" -#include "../error.h" #include "../../config.h" #include "../../help_mp.h" #include "../../libvo/x11_common.h" #include "../../libmpdemux/stream.h" +#include "../../mp_msg.h" #define mplMouseTimerConst 10 #define mplRedrawTimerConst 5 int mplMouseTimer = mplMouseTimerConst; int mplRedrawTimer = mplRedrawTimerConst; -int mplGeneralTimer = -1; int mplTimer = 0; -void mplMsgHandle( int msg,float param ); +void mplEventHandling( int msg,float param ); #include "widgets.h" #include "play.h" @@ -38,31 +37,24 @@ void mplMsgHandle( int msg,float param ); #include "sw.h" #include "widgets.h" -void mplTimerHandler( int signum ) +void mplTimerHandler( void ) { mplTimer++; mplMouseTimer--; mplRedrawTimer--; - mplGeneralTimer--; - if ( mplMouseTimer == 0 ) mplMsgHandle( evHideMouseCursor,0 ); - if ( mplRedrawTimer == 0 ) mplMsgHandle( evRedraw,0 ); - if ( mplGeneralTimer == 0 ) mplMsgHandle( evGeneralTimer,0 ); + if ( mplMouseTimer == 0 ) mplEventHandling( evHideMouseCursor,0 ); + if ( mplRedrawTimer == 0 ) mplEventHandling( evRedraw,0 ); } void mplInit( int argc,char* argv[], char *envp[], void* disp ) { int i; - // allocates shmem to mplShMem // init fields of this struct to default values mplMPlayerInit( argc,argv,envp ); - // allocates shmem to gtkShMem // fork() a process which runs gtkThreadProc() [gtkPID] gtkInit( argc,argv,envp ); - strcpy( gtkShMem->sb.name,skinName ); - - message=mplErrorHandler; // error messagebox drawing function // opens X display, checks for extensions (XShape, DGA etc) wsXInit(disp); @@ -81,7 +73,7 @@ void mplInit( int argc,char* argv[], char *envp[], void* disp ) wsCreateImage( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Width,appMPlayer.sub.Bitmap.Height ); vo_setwindow( appMPlayer.subWindow.WindowID, appMPlayer.subWindow.wGC ); - + i=wsHideFrame|wsMaxSize|wsHideWindow; if ( appMPlayer.mainDecoration ) i=wsShowFrame|wsMaxSize|wsHideWindow; wsCreateWindow( &appMPlayer.mainWindow, @@ -89,13 +81,13 @@ void mplInit( int argc,char* argv[], char *envp[], void* disp ) wsNoBorder,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,i,"MPlayer" ); //wsMinSize| wsSetShape( &appMPlayer.mainWindow,appMPlayer.main.Mask.Image ); - + mplMenuInit(); #ifdef DEBUG - dbprintf( 1,"[main] Depth on screen: %d\n",wsDepthOnScreen ); - dbprintf( 1,"[main] parent: 0x%x\n",(int)appMPlayer.mainWindow.WindowID ); - dbprintf( 1,"[main] sub: 0x%x\n",(int)appMPlayer.subWindow.WindowID ); + mp_msg( MSGT_GPLAYER,MSGL_DBG2,"[main] Depth on screen: %d\n",wsDepthOnScreen ); + mp_msg( MSGT_GPLAYER,MSGL_DBG2,"[main] parent: 0x%x\n",(int)appMPlayer.mainWindow.WindowID ); + mp_msg( MSGT_GPLAYER,MSGL_DBG2,"[main] sub: 0x%x\n",(int)appMPlayer.subWindow.WindowID ); #endif appMPlayer.mainWindow.ReDraw=mplMainDraw; @@ -114,24 +106,13 @@ void mplInit( int argc,char* argv[], char *envp[], void* disp ) wsPostRedisplay( &appMPlayer.mainWindow ); wsPostRedisplay( &appMPlayer.subWindow ); - btnModify( evSetVolume,mplShMem->Volume ); - btnModify( evSetBalance,mplShMem->Balance ); - btnModify( evSetMoviePosition,mplShMem->Position ); + btnModify( evSetVolume,guiIntfStruct.Volume ); + btnModify( evSetBalance,guiIntfStruct.Balance ); + btnModify( evSetMoviePosition,guiIntfStruct.Position ); - mplShMem->Playing=0; + guiIntfStruct.Playing=0; wsVisibleWindow( &appMPlayer.mainWindow,wsShowWindow ); wsVisibleWindow( &appMPlayer.subWindow,wsShowWindow ); } -void mplDone(){ - - dbprintf( 1,"[mplayer] exit.\n" ); - - mplStop(); -// timerDone(); - gtkDone(); // kills the gtkThreadProc() process - wsXDone(); - -} - diff --git a/Gui/mplayer/mplayer.h b/Gui/mplayer/mplayer.h index 8bfabf8122..718895e8ed 100644 --- a/Gui/mplayer/mplayer.h +++ b/Gui/mplayer/mplayer.h @@ -4,16 +4,16 @@ extern int mplSubRender; extern int mplMainRender; -extern int mplGeneralTimer; extern unsigned char * mplDrawBuffer; extern unsigned char * mplMenuDrawBuffer; extern int mainVisible; extern int mplMainAutoPlay; -extern int mplMiddleMenu; +extern int mplMiddleMenu; extern void mplInit( int argc,char* argv[], char *envp[], void* disp ); -extern void mplMsgHandle( int msg,float param ); +extern void mplEventHandling( int msg,float param ); +extern void mplTimerHandler( void ); #endif diff --git a/Gui/mplayer/mw.h b/Gui/mplayer/mw.h index 5194563be8..2de88e348a 100644 --- a/Gui/mplayer/mw.h +++ b/Gui/mplayer/mw.h @@ -7,7 +7,7 @@ unsigned char * mplDrawBuffer = NULL; int mplMainRender = 1; int mplMainAutoPlay = 0; -int mplMiddleMenu = 0; +int mplMiddleMenu = 0; int mainVisible = 1; @@ -18,19 +18,19 @@ int i,pot = 0; inline void TranslateFilename( int c,char * tmp ) { int i; - switch ( mplShMem->StreamType ) + switch ( guiIntfStruct.StreamType ) { case STREAMTYPE_FILE: - if ( gtkShMem->fs.filename[0] ) + if ( ( guiIntfStruct.Filename )&&( guiIntfStruct.Filename[0] ) ) { - strcpy( tmp,gtkShMem->fs.filename ); + strcpy( tmp,guiIntfStruct.Filename ); if ( tmp[strlen( tmp ) - 4] == '.' ) tmp[strlen( tmp ) - 4]=0; if ( tmp[strlen( tmp ) - 5] == '.' ) tmp[strlen( tmp ) - 5]=0; } else strcpy( tmp,"no file loaded" ); break; -#ifdef USE_DVDREAD +#ifdef USE_DVDREAD case STREAMTYPE_DVD: - if ( mplShMem->DVD.current_chapter ) sprintf( tmp,"chapter %d",mplShMem->DVD.current_chapter ); + if ( guiIntfStruct.DVD.current_chapter ) sprintf( tmp,"chapter %d",guiIntfStruct.DVD.current_chapter ); else strcat( tmp,"no chapter" ); break; #endif @@ -38,7 +38,7 @@ inline void TranslateFilename( int c,char * tmp ) } if ( c ) { - for ( i=0;i < strlen( tmp );i++ ) + for ( i=0;i < (int)strlen( tmp );i++ ) { int t=0; if ( c == 1 ) { if ( ( tmp[i] >= 'A' )&&( tmp[i] <= 'Z' ) ) t=32; } @@ -51,46 +51,46 @@ inline void TranslateFilename( int c,char * tmp ) char * Translate( char * str ) { static char trbuf[512]; - char tmp[128]; + char tmp[512]; int i,c; int t; memset( trbuf,0,512 ); memset( tmp,0,128 ); - for ( c=0,i=0;i < strlen( str );i++ ) + for ( c=0,i=0;i < (int)strlen( str );i++ ) { if ( str[i] != '$' ) { trbuf[c++]=str[i]; trbuf[c]=0; } else { switch ( str[++i] ) { - case 't': sprintf( tmp,"%02d",mplShMem->Track ); strcat( trbuf,tmp ); break; + case 't': sprintf( tmp,"%02d",guiIntfStruct.Track ); strcat( trbuf,tmp ); break; case 'o': TranslateFilename( 0,tmp ); strcat( trbuf,tmp ); break; case 'f': TranslateFilename( 1,tmp ); strcat( trbuf,tmp ); break; case 'F': TranslateFilename( 2,tmp ); strcat( trbuf,tmp ); break; - case '6': t=mplShMem->LengthInSec; goto calclengthhhmmss; - case '1': t=mplShMem->TimeSec; + case '6': t=guiIntfStruct.LengthInSec; goto calclengthhhmmss; + case '1': t=guiIntfStruct.TimeSec; calclengthhhmmss: sprintf( tmp,"%02d:%02d:%02d",t/3600,t/60%60,t%60 ); strcat( trbuf,tmp ); break; - case '7': t=mplShMem->LengthInSec; goto calclengthmmmmss; - case '2': t=mplShMem->TimeSec; + case '7': t=guiIntfStruct.LengthInSec; goto calclengthmmmmss; + case '2': t=guiIntfStruct.TimeSec; calclengthmmmmss: sprintf( tmp,"%04d:%02d",t/60,t%60 ); strcat( trbuf,tmp ); break; - case '3': sprintf( tmp,"%02d",mplShMem->TimeSec / 3600 ); strcat( trbuf,tmp ); break; - case '4': sprintf( tmp,"%02d",( ( mplShMem->TimeSec / 60 ) % 60 ) ); strcat( trbuf,tmp ); break; - case '5': sprintf( tmp,"%02d",mplShMem->TimeSec % 60 ); strcat( trbuf,tmp ); break; - case '8': sprintf( tmp,"%01d:%02d:%02d",mplShMem->TimeSec / 3600,( mplShMem->TimeSec / 60 ) % 60,mplShMem->TimeSec % 60 ); strcat( trbuf,tmp ); break; - case 'v': sprintf( tmp,"%3.2f%%",mplShMem->Volume ); strcat( trbuf,tmp ); break; - case 'V': sprintf( tmp,"%3.1f",mplShMem->Volume ); strcat( trbuf,tmp ); break; - case 'b': sprintf( tmp,"%3.2f%%",mplShMem->Balance ); strcat( trbuf,tmp ); break; - case 'B': sprintf( tmp,"%3.1f",mplShMem->Balance ); strcat( trbuf,tmp ); break; - case 'd': sprintf( tmp,"%d",mplShMem->FrameDrop ); strcat( trbuf,tmp ); break; - case 's': if ( mplShMem->Playing == 0 ) strcat( trbuf,"s" ); break; - case 'l': if ( mplShMem->Playing == 1 ) strcat( trbuf,"p" ); break; - case 'e': if ( mplShMem->Playing == 2 ) strcat( trbuf,"e" ); break; + case '3': sprintf( tmp,"%02d",guiIntfStruct.TimeSec / 3600 ); strcat( trbuf,tmp ); break; + case '4': sprintf( tmp,"%02d",( ( guiIntfStruct.TimeSec / 60 ) % 60 ) ); strcat( trbuf,tmp ); break; + case '5': sprintf( tmp,"%02d",guiIntfStruct.TimeSec % 60 ); strcat( trbuf,tmp ); break; + case '8': sprintf( tmp,"%01d:%02d:%02d",guiIntfStruct.TimeSec / 3600,( guiIntfStruct.TimeSec / 60 ) % 60,guiIntfStruct.TimeSec % 60 ); strcat( trbuf,tmp ); break; + case 'v': sprintf( tmp,"%3.2f%%",guiIntfStruct.Volume ); strcat( trbuf,tmp ); break; + case 'V': sprintf( tmp,"%3.1f",guiIntfStruct.Volume ); strcat( trbuf,tmp ); break; + case 'b': sprintf( tmp,"%3.2f%%",guiIntfStruct.Balance ); strcat( trbuf,tmp ); break; + case 'B': sprintf( tmp,"%3.1f",guiIntfStruct.Balance ); strcat( trbuf,tmp ); break; + case 'd': sprintf( tmp,"%d",guiIntfStruct.FrameDrop ); strcat( trbuf,tmp ); break; + case 's': if ( guiIntfStruct.Playing == 0 ) strcat( trbuf,"s" ); break; + case 'l': if ( guiIntfStruct.Playing == 1 ) strcat( trbuf,"p" ); break; + case 'e': if ( guiIntfStruct.Playing == 2 ) strcat( trbuf,"e" ); break; case 'a': - switch ( mplShMem->AudioType ) + switch ( guiIntfStruct.AudioType ) { case 0: strcat( trbuf,"n" ); break; case 1: strcat( trbuf,"m" ); break; @@ -98,12 +98,12 @@ calclengthmmmmss: } break; case 'T': - switch ( mplShMem->StreamType ) + switch ( guiIntfStruct.StreamType ) { case STREAMTYPE_FILE: strcat( trbuf,"f" ); break; case STREAMTYPE_VCD: strcat( trbuf,"v" ); break; case STREAMTYPE_STREAM: strcat( trbuf,"u" ); break; -#ifdef USE_DVDREAD +#ifdef USE_DVDREAD case STREAMTYPE_DVD: strcat( trbuf,"d" ); break; #endif default: strcat( trbuf," " ); break; @@ -131,8 +131,8 @@ inline void PutImage( txSample * bf,int x,int y,int max,int ofs ) buf=(unsigned long *)mplDrawBuffer; drw=(unsigned long *)bf->Image; - for ( iy=y;iy < y+bf->Height / max;iy++ ) - for ( ix=x;ix < x+bf->Width;ix++ ) + for ( iy=y;iy < (int)(y+bf->Height / max);iy++ ) + for ( ix=x;ix < (int)(x+bf->Width);ix++ ) { tmp=drw[i++]; if ( tmp != 0x00ff00ff ) @@ -150,8 +150,8 @@ void mplMainDraw( wsParamDisplay ) !mainVisible ) return; // !appMPlayer.mainWindow.Mapped ) return; - btnModify( evSetMoviePosition,mplShMem->Position ); - btnModify( evSetVolume,mplShMem->Volume ); + btnModify( evSetMoviePosition,guiIntfStruct.Position ); + btnModify( evSetVolume,guiIntfStruct.Volume ); if ( mplMainRender ) { @@ -176,7 +176,7 @@ void mplMainDraw( wsParamDisplay ) goto drawrenderedtext; case itDLabel: image=fntRender( item->fontid,mplTimer%item->width,item->width,"%s",Translate( item->label ) ); -// image=fntRender( item->fontid,( mplRedrawTimer / 10 )%item->width,item->width,"%s",Translate( item->label ) ); +//// image=fntRender( item->fontid,( mplRedrawTimer / 10 )%item->width,item->width,"%s",Translate( item->label ) ); drawrenderedtext: PutImage( image,item->x,item->y,1,0 ); if ( image ) @@ -200,7 +200,7 @@ extern void exit_player(char* how); extern int audio_id; extern int dvdsub_id; -void mplMsgHandle( int msg,float param ) +void mplEventHandling( int msg,float param ) { int j; @@ -218,69 +218,64 @@ void mplMsgHandle( int msg,float param ) dvd_chapter=1; dvd_angle=1; play_dvd_2: - mplShMem->StreamType=STREAMTYPE_DVD; + guiIntfStruct.StreamType=STREAMTYPE_DVD; #endif case evPlay: case evPlaySwitchToPause: // btnModif