Mercurial > mplayer.hg
annotate Gui/interface.c @ 5451:b716977c47d9
added vfw uninit
author | alex |
---|---|
date | Mon, 01 Apr 2002 13:26:38 +0000 |
parents | ce054c1eabdc |
children | 3e7f39c4110c |
rev | line source |
---|---|
4798 | 1 |
4845 | 2 #include <inttypes.h> |
3 #include <stdlib.h> | |
4 #include <stdio.h> | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
5 #include <string.h> |
4798 | 6 |
7 #include "ws.h" | |
8 #include "mplayer/play.h" | |
9 #include "interface.h" | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
10 |
4798 | 11 #include "../mplayer.h" |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
12 #include "mplayer/widgets.h" |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
13 #include "mplayer/mplayer.h" |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
14 #include "app.h" |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
15 #include "../libvo/x11_common.h" |
4858 | 16 #include "../input/input.h" |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
17 |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
18 guiInterface_t guiIntfStruct; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
19 |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
20 void guiInit( int argc,char* argv[], char *envp[] ) |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
21 { |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
22 memset( &guiIntfStruct,0,sizeof( guiIntfStruct ) ); |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
23 appInit( argc,argv,envp,(void*)mDisplay ); |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
24 } |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
25 |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
26 void guiDone( void ) |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
27 { |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
28 mp_msg( MSGT_GPLAYER,MSGL_V,"[mplayer] exit.\n" ); |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
29 mplStop(); |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
30 gtkDone(); |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
31 wsXDone(); |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
32 } |
4798 | 33 |
4858 | 34 int guiCMDArray[] = |
35 { | |
36 evLoad, | |
37 evLoadSubtitle, | |
38 evAbout, | |
39 evPlay, | |
40 evStop, | |
41 evPlayList, | |
42 evPreferences, | |
43 evFullScreen, | |
44 evSkinBrowser | |
45 }; | |
46 | |
4798 | 47 void guiGetEvent( int type,char * arg ) |
48 { | |
49 switch ( type ) | |
50 { | |
51 case guiXEvent: | |
52 wsEvents( wsDisplay,(XEvent *)arg,NULL ); | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
53 gtkEventHandling(); |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
54 break; |
4798 | 55 case guiCEvent: |
4963 | 56 switch ( (int)arg ) |
57 { | |
58 case guiSetPlay: guiIntfStruct.Playing=1; mplState(); break; | |
59 case guiSetStop: guiIntfStruct.Playing=0; mplState(); break; | |
60 case guiSetPause: guiIntfStruct.Playing=2; mplState(); break; | |
61 } | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
62 break; |
5120 | 63 #ifdef HAVE_NEW_INPUT |
4858 | 64 case guiIEvent: |
65 printf( "cmd: %d\n",(int)arg ); | |
66 switch( (int)arg ) | |
67 { | |
68 case MP_CMD_QUIT: | |
69 mplEventHandling( evExit,0 ); | |
70 break; | |
71 case MP_CMD_VO_FULLSCREEN: | |
72 mplEventHandling( evFullScreen,0 ); | |
73 break; | |
74 default: | |
75 mplEventHandling( guiCMDArray[ (int)arg - MP_CMD_GUI_EVENTS - 1 ],0 ); | |
76 } | |
77 break; | |
5120 | 78 #endif |
4798 | 79 } |
80 } | |
81 | |
82 void guiEventHandling( void ) | |
83 { | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
84 if ( use_gui && !guiIntfStruct.Playing ) wsHandleEvents(); |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
85 gtkEventHandling(); |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
86 mplTimerHandler(); // handle GUI timer events |
4798 | 87 } |