1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-28 01:52:19 +00:00

fix some bug.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1824 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
pontscho 2001-09-01 17:53:07 +00:00
parent 5c21ed495f
commit 8d3a427378
12 changed files with 53 additions and 35 deletions

View File

@ -72,8 +72,9 @@ void appInitStruct( listItems * item )
appClearItem( &item->main );
appClearItem( &item->sub );
item->sub.Bitmap.Width=256; item->sub.Bitmap.Height=256;
item->sub.width=256; item->sub.height=256;
item->sub.Bitmap.Width=384; item->sub.Bitmap.Height=384;
item->sub.width=384; item->sub.height=384;
item->sub.x=-1; item->sub.y=-1;
appClearItem( &item->menuBase );
appClearItem( &item->menuSelected );
item->subR=0;
@ -104,27 +105,14 @@ void appInit( int argc,char* argv[], char *envp[], void* disp )
printf("SKIN dir 1: '%s'\n",skinDirInHome);
printf("SKIN dir 2: '%s'\n",skinMPlayerDir);
// if ( ( appMPlayerDirInHome=(char *)calloc( 1,strlen( getenv( "HOME" ) ) + 9 ) ) != NULL )
// { strcpy( appMPlayerDirInHome,getenv( "HOME" ) ); strcat( appMPlayerDirInHome,"/.mplayer" ); }
// if ( ( skinDirInHome=(char *)calloc( 1,strlen( appMPlayerDirInHome ) + 5 ) ) != NULL )
// { strcpy( skinDirInHome,appMPlayerDirInHome ); strcat( skinDirInHome,"/Skin" ); }
// if ( ( appMPlayerDir=(char *)calloc( 1,strlen( PREFIX ) + 14 ) ) != NULL )
// { strcpy( appMPlayerDir,PREFIX ); strcat( appMPlayerDir,"/share/mplayer" ); }
// if ( ( skinMPlayerDir=(char *)calloc( 1,strlen( appMPlayerDir ) + 5 ) ) != NULL )
// { strcpy( skinMPlayerDir,appMPlayerDir ); strcat( skinMPlayerDir,"/Skin" ); }
initDebug(NULL); // write messages to stderr
cfgDefaults(); // set skin to "default"
cfgRead(); // empty function - NOP
// if ( !strcmp( cfgAppName,"movieplayer" ) )
// {
appMPlayer.sub.x=-1; appMPlayer.sub.y=-1; appMPlayer.sub.width=512; appMPlayer.sub.height=256;
switch ( skinRead( cfgSkin ) )
{
case -1: dbprintf( 0,"[app] skin configfile not found.\n" ); exit( 0 );
case -2: dbprintf( 0,"[app] skin configfile read error.\n" ); exit( 0 );
}
mplInit( argc,argv,envp,disp ); // does gtk & ws initialization, create windows
// }
switch ( skinRead( cfgSkin ) )
{
case -1: dbprintf( 0,"[app] skin configfile not found.\n" ); exit( 0 );
case -2: dbprintf( 0,"[app] skin configfile read error.\n" ); exit( 0 );
}
mplInit( argc,argv,envp,disp ); // does gtk & ws initialization, create windows
}

View File

@ -40,7 +40,8 @@ evName evNames[] =
{ evDoubleSize, "evDoubleSize" }, // 38
{ evSetMoviePosition, "evSetMoviePosition" }, // 39
{ evSetVolume, "evSetVolume" }, // 40
{ evSetBalance, "evSetBalance" } // 41
{ evSetBalance, "evSetBalance" }, // 41
{ evHelp, "evHelp" }
};
const int evBoxs = sizeof( evNames ) / sizeof( evName );

View File

@ -41,6 +41,8 @@
#define evSetVolume 36
#define evSetBalance 37
#define evHelp 38
#define evExit 1000
// --- General events ---

View File

@ -257,6 +257,7 @@ void fs_Ok_released( GtkButton * button,gpointer user_data )
break;
}
strcpy( gtkShMem->fs.dir,fsSelectedDirectory );
printf( "----gtk---> filname: %s\n",fsSelectedFile );
strcpy( gtkShMem->fs.filename,fsSelectedFile );
item=fsTopList_items;
while( item )

View File

@ -55,11 +55,11 @@ void mplMenuMouseHandle( int X,int Y,int RX,int RY )
return;
}
for( i=0;i<appMPlayer.NumberOfMenuItems+1;i++ )
for( i=0;i<=appMPlayer.NumberOfMenuItems;i++ )
{
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 ) ) mplMenuItem=i;
appMPlayer.MenuItems[i].x+appMPlayer.MenuItems[i].width,appMPlayer.MenuItems[i].y+appMPlayer.MenuItems[i].height ) ) { mplMenuItem=i; break; }
}
wsPostRedisplay( &appMPlayer.menuWindow );
}
@ -92,11 +92,15 @@ void mplHideMenu( int mx,int my )
x=mx-mplMenuX;
y=my-mplMenuY;
// x=RX - appMPlayer.menuWindow.X;
// y=RY - appMPlayer.menuWindow.Y;
wsVisibleWindow( &appMPlayer.menuWindow,wsHideWindow );
if ( ( x < 0 ) || ( y < 0 ) ) return;
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,

View File

@ -10,7 +10,7 @@
float mixerGetVolume( void )
{
mplShMem->Volume=mixer_getbothvolume();
// mplShMem->Volume=(float)mixer_getbothvolume();
return mplShMem->Volume;
}
@ -22,13 +22,13 @@ void mixerSetVolume( float v )
void mixerIncVolume( void )
{
mixer_incvolume();
// mixer_incvolume();
mixerGetVolume();
}
void mixerDecVolume( void )
{
mixer_decvolume();
// mixer_decvolume();
mixerGetVolume();
}

View File

@ -52,8 +52,6 @@ void mplTimerHandler( int signum )
void mplInit( int argc,char* argv[], char *envp[], void* disp )
{
// parse_cfgfiles( argc,argv,envp );
// allocates shmem to gtkShMem
// fork() a process which runs gtkThreadProc() [gtkPID]
gtkInit( argc,argv,envp );

View File

@ -91,6 +91,7 @@ calclengthmmmmss:
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;

View File

@ -46,6 +46,7 @@ typedef struct
int StreamType;
int TimeSec;
int LengthInSec;
int FrameDrop;
char Filename[4096];
int FilenameChanged;

View File

@ -35,7 +35,6 @@ int VisibleMainWindow( void )
for (i=0; i < nchilds; i++) if ( childs[i]==me ) break;
for ( ;i<nchilds;i++ ) if ( childs[i] == mainw ) visible=1;
// printf( "-----------> visible main vindov: %d ---\n",visible );
return visible;
}
@ -45,6 +44,10 @@ int count = 0;
void mplSubDraw( wsParamDisplay )
{
// mainisvisible1=VisibleMainWindow();
// printf( "--------> main: %d ---\n",mainisvisible1 );
// if ( ( appMPlayer.subWindow.Visible == wsWindowNotVisible )||
// ( appMPlayer.subWindow.State != wsWindowExpose ) ) return;
@ -67,6 +70,7 @@ void mplSubDraw( wsParamDisplay )
XFlush( wsDisplay );
}
appMPlayer.subWindow.State=0;
// mainis=0;
}
void mplSubMouseHandle( int Button,int X,int Y,int RX,int RY )
@ -89,9 +93,7 @@ void mplSubMouseHandle( int Button,int X,int Y,int RX,int RY )
break;
// ---
case wsPLMouseButton:
oldmainisvisible=VisibleMainWindow();
printf( "----> %d %d\n",mainisvisible1,mainisvisible2 );
//=mainisvisible;
//mainis=0;
sx=X; sy=Y;
msButton=wsPLMouseButton;
mplSubMoved=0;
@ -110,6 +112,15 @@ void mplSubMouseHandle( int Button,int X,int Y,int RX,int RY )
}
break;
case wsRLMouseButton:
// if ( ( appMPlayer.subWindow.Focused == 0 && appMPlayer.subWindow.OFocused == 2 ) )
// ( appMPlayer.mainWindow.Focused == 0 && appMPlayer.mainWindow.OFocused == 2 ) )
// if ( ( !mplSubMoved )&&( !appMPlayer.mainWindow.Focused ) )
printf( "-----> mainis: %d ---- \n",mainis );
if ( !mainis )
{
wsMoveTopWindow( &appMPlayer.mainWindow );
}
/*
if ( ( !mplSubMoved )&&
( appMPlayer.subWindow.isFullScreen )&&
( !VisibleMainWindow() ) )
@ -117,6 +128,7 @@ void mplSubMouseHandle( int Button,int X,int Y,int RX,int RY )
wsMoveTopWindow( &appMPlayer.mainWindow );
// else wsMoveTopWindow( &appMPlayer.mainWindow );
}
*/
msButton=0;
mplSubMoved=0;
break;

View File

@ -439,6 +439,7 @@ void wsCreateWindow( wsTWindow * win,int X,int Y,int wX,int hY,int bW,int cV,uns
win->Visible=0;
win->Focused=0;
win->OFocused=0;
win->Mapped=0;
win->Rolled=0;
if ( D & wsShowWindow ) XMapWindow( wsDisplay,win->WindowID );
@ -481,6 +482,7 @@ void wsDestroyWindow( wsTWindow * win )
win->KeyHandler=NULL;
win->Visible=0;
win->Focused=0;
win->OFocused=0;
win->Mapped=0;
win->Rolled=0;
}
@ -528,10 +530,16 @@ Bool wsEvents( Display * display,XEvent * Event,XPointer arg )
case UnmapNotify: i=wsWindowUnmapped; wsWindowList[l]->Mapped=wsNone; goto expose;
case FocusIn:
if ( wsWindowList[l]->Focused == wsFocused ) break;
i=wsWindowFocusIn; wsWindowList[l]->Focused=wsFocused; goto expose;
i=wsWindowFocusIn;
wsWindowList[l]->OFocused=wsWindowList[l]->Focused;
wsWindowList[l]->Focused=wsFocused;
goto expose;
case FocusOut:
if ( wsWindowList[l]->Focused == wsNone ) break;
i=wsWindowFocusOut; wsWindowList[l]->Focused=wsNone; goto expose;
i=wsWindowFocusOut;
wsWindowList[l]->OFocused=wsWindowList[l]->Focused;
wsWindowList[l]->Focused=wsNone;
goto expose;
case VisibilityNotify:
switch( Event->xvisibility.state )
{

View File

@ -124,6 +124,8 @@ typedef struct
int CapsLock;
// --- Misc -------------------------------------------------------------------------------------
int OFocused;
Atom AtomDeleteWindow;
Atom AtomTakeFocus;
Atom AtomRolle;