annotate Gui/mplayer/mplayer.c @ 5999:792d58595767

fix -fs and 'f'
author pontscho
date Mon, 06 May 2002 16:56:41 +0000
parents b8d8d72776f2
children 8cfddba867b4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
1
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
2 #include <stdlib.h>
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
3 #include <stdio.h>
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
4 #include <string.h>
4428
3e1378354c2e Compilation fixing
nick
parents: 3080
diff changeset
5 #include <inttypes.h>
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
6
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
7 #include "./mplayer.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
8 #include "../events.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
9 #include "../app.h"
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4797
diff changeset
10 #include "../interface.h"
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
11 #include "../skin/skin.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
12 #include "../skin/font.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
13 #include "../wm/ws.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
14 #include "../wm/wskeys.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
15 #include "../wm/widget.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
16 #include "../bitmap/bitmap.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
17
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
18 #include "../../config.h"
1884
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
19 #include "../../help_mp.h"
1776
48e6351f5714 add x11_common.h
pontscho
parents: 1742
diff changeset
20 #include "../../libvo/x11_common.h"
2970
4ecb26be6657 fix blackbox xshape bug
pontscho
parents: 2854
diff changeset
21 #include "../../libmpdemux/stream.h"
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4797
diff changeset
22 #include "../../mp_msg.h"
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
23
1697
0b881b5e9e7b commented, timer code disabled (see ws.c)
arpi
parents: 1693
diff changeset
24 #define mplRedrawTimerConst 5
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
25
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
26 int mplRedrawTimer = mplRedrawTimerConst;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
27 int mplTimer = 0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
28
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4797
diff changeset
29 void mplEventHandling( int msg,float param );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
30
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
31 #include "widgets.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
32 #include "play.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
33 #include "menu.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
34 #include "mw.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
35 #include "sw.h"
1801
e16646a140fd fix skin change
pontscho
parents: 1791
diff changeset
36 #include "widgets.h"
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
37
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4797
diff changeset
38 void mplTimerHandler( void )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
39 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
40 mplTimer++;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
41 mplRedrawTimer--;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4797
diff changeset
42 if ( mplRedrawTimer == 0 ) mplEventHandling( evRedraw,0 );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
43 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
44
1723
5e4214a7540e GUI stuff. now seeking works, and xmga renders to video window
arpi
parents: 1709
diff changeset
45 void mplInit( int argc,char* argv[], char *envp[], void* disp )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
46 {
1866
32b1bb50a0e8 some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents: 1860
diff changeset
47 int i;
2854
fd44ecf77f8d move bug meg fileload bug fixed asszem.
pontscho
parents: 2226
diff changeset
48
fd44ecf77f8d move bug meg fileload bug fixed asszem.
pontscho
parents: 2226
diff changeset
49 // init fields of this struct to default values
fd44ecf77f8d move bug meg fileload bug fixed asszem.
pontscho
parents: 2226
diff changeset
50 mplMPlayerInit( argc,argv,envp );
fd44ecf77f8d move bug meg fileload bug fixed asszem.
pontscho
parents: 2226
diff changeset
51
1742
0880718750d5 fix signalhandling
pontscho
parents: 1723
diff changeset
52 // fork() a process which runs gtkThreadProc() [gtkPID]
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
53 gtkInit( argc,argv,envp );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
54
1697
0b881b5e9e7b commented, timer code disabled (see ws.c)
arpi
parents: 1693
diff changeset
55 // opens X display, checks for extensions (XShape, DGA etc)
1723
5e4214a7540e GUI stuff. now seeking works, and xmga renders to video window
arpi
parents: 1709
diff changeset
56 wsXInit(disp);
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
57
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
58 if ( ( mplDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.main.Bitmap.ImageSize ) ) == NULL )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
59 {
1884
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
60 fprintf( stderr,MSGTR_NEMDB );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
61 exit( 0 );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
62 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
63
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
64 wsCreateWindow( &appMPlayer.subWindow,
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
65 appMPlayer.sub.x,appMPlayer.sub.y,appMPlayer.sub.width,appMPlayer.sub.height,
3080
182163807172 bug fixs
pontscho
parents: 2970
diff changeset
66 wsNoBorder,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,wsShowFrame|wsHideWindow,"ViDEO" );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
67
3080
182163807172 bug fixs
pontscho
parents: 2970
diff changeset
68 wsDestroyImage( &appMPlayer.subWindow );
182163807172 bug fixs
pontscho
parents: 2970
diff changeset
69 wsCreateImage( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Width,appMPlayer.sub.Bitmap.Height );
182163807172 bug fixs
pontscho
parents: 2970
diff changeset
70
182163807172 bug fixs
pontscho
parents: 2970
diff changeset
71 vo_setwindow( appMPlayer.subWindow.WindowID, appMPlayer.subWindow.wGC );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4797
diff changeset
72
2970
4ecb26be6657 fix blackbox xshape bug
pontscho
parents: 2854
diff changeset
73 i=wsHideFrame|wsMaxSize|wsHideWindow;
4ecb26be6657 fix blackbox xshape bug
pontscho
parents: 2854
diff changeset
74 if ( appMPlayer.mainDecoration ) i=wsShowFrame|wsMaxSize|wsHideWindow;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
75 wsCreateWindow( &appMPlayer.mainWindow,
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
76 appMPlayer.main.x,appMPlayer.main.y,appMPlayer.main.width,appMPlayer.main.height,
1866
32b1bb50a0e8 some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents: 1860
diff changeset
77 wsNoBorder,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,i,"MPlayer" ); //wsMinSize|
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
78
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
79 wsSetShape( &appMPlayer.mainWindow,appMPlayer.main.Mask.Image );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4797
diff changeset
80
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
81 mplMenuInit();
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
82
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
83 #ifdef DEBUG
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4797
diff changeset
84 mp_msg( MSGT_GPLAYER,MSGL_DBG2,"[main] Depth on screen: %d\n",wsDepthOnScreen );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4797
diff changeset
85 mp_msg( MSGT_GPLAYER,MSGL_DBG2,"[main] parent: 0x%x\n",(int)appMPlayer.mainWindow.WindowID );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4797
diff changeset
86 mp_msg( MSGT_GPLAYER,MSGL_DBG2,"[main] sub: 0x%x\n",(int)appMPlayer.subWindow.WindowID );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
87 #endif
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
88
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
89 appMPlayer.mainWindow.ReDraw=mplMainDraw;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
90 appMPlayer.mainWindow.MouseHandler=mplMainMouseHandle;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
91 appMPlayer.mainWindow.KeyHandler=mplMainKeyHandle;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
92
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
93 appMPlayer.subWindow.ReDraw=mplSubDraw;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
94 appMPlayer.subWindow.MouseHandler=mplSubMouseHandle;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
95 appMPlayer.subWindow.KeyHandler=mplMainKeyHandle;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
96
2029
41ed89701ece fix fucking icewm fullscreen bug.
pontscho
parents: 2025
diff changeset
97 wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.subR,appMPlayer.subG,appMPlayer.subB );
3080
182163807172 bug fixs
pontscho
parents: 2970
diff changeset
98 wsClearWindow( appMPlayer.subWindow );
2025
0653e90b3118 some bug fix, and sub window render speed up.. 10l kola ? :)
pontscho
parents: 1884
diff changeset
99 if ( appMPlayer.sub.Bitmap.Image ) wsConvert( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Image,appMPlayer.sub.Bitmap.ImageSize );
0653e90b3118 some bug fix, and sub window render speed up.. 10l kola ? :)
pontscho
parents: 1884
diff changeset
100
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
101 wsPostRedisplay( &appMPlayer.mainWindow );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
102 wsPostRedisplay( &appMPlayer.subWindow );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
103
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4797
diff changeset
104 btnModify( evSetVolume,guiIntfStruct.Volume );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4797
diff changeset
105 btnModify( evSetBalance,guiIntfStruct.Balance );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4797
diff changeset
106 btnModify( evSetMoviePosition,guiIntfStruct.Position );
5046
b3bd4b29a03b remove obsoleted function (mplResize)
pontscho
parents: 4818
diff changeset
107
b3bd4b29a03b remove obsoleted function (mplResize)
pontscho
parents: 4818
diff changeset
108 if ( fullscreen )
b3bd4b29a03b remove obsoleted function (mplResize)
pontscho
parents: 4818
diff changeset
109 {
b3bd4b29a03b remove obsoleted function (mplResize)
pontscho
parents: 4818
diff changeset
110 btnModify( evFullScreen,btnPressed );
b3bd4b29a03b remove obsoleted function (mplResize)
pontscho
parents: 4818
diff changeset
111 mplFullScreen();
b3bd4b29a03b remove obsoleted function (mplResize)
pontscho
parents: 4818
diff changeset
112 }
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
113
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4797
diff changeset
114 guiIntfStruct.Playing=0;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
115
3080
182163807172 bug fixs
pontscho
parents: 2970
diff changeset
116 wsVisibleWindow( &appMPlayer.mainWindow,wsShowWindow );
182163807172 bug fixs
pontscho
parents: 2970
diff changeset
117 wsVisibleWindow( &appMPlayer.subWindow,wsShowWindow );
1709
a4e0211455d8 GUI integration, step 1
arpi
parents: 1697
diff changeset
118 }
a4e0211455d8 GUI integration, step 1
arpi
parents: 1697
diff changeset
119