annotate Gui/interface.c @ 5408:f9cd6381e327

reworked ADPCM decoders; changes include: * fixed MS IMA ADPCM * dissolved adpcm.c/.h into appropriate ad_* decoders * DK4 audio is handled directly by IMA ADPCM decoder (this obsoletes ad_dk4adpcm.c)
author melanson
date Sat, 30 Mar 2002 22:27:45 +0000
parents ce054c1eabdc
children 3e7f39c4110c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4798
c39affa2b376 new interface ? :)
pontscho
parents:
diff changeset
1
4845
ed5aa118e142 inttypes.h bug fix. 10l
pontscho
parents: 4818
diff changeset
2 #include <inttypes.h>
ed5aa118e142 inttypes.h bug fix. 10l
pontscho
parents: 4818
diff changeset
3 #include <stdlib.h>
ed5aa118e142 inttypes.h bug fix. 10l
pontscho
parents: 4818
diff changeset
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
c39affa2b376 new interface ? :)
pontscho
parents:
diff changeset
6
c39affa2b376 new interface ? :)
pontscho
parents:
diff changeset
7 #include "ws.h"
c39affa2b376 new interface ? :)
pontscho
parents:
diff changeset
8 #include "mplayer/play.h"
c39affa2b376 new interface ? :)
pontscho
parents:
diff changeset
9 #include "interface.h"
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4798
diff changeset
10
4798
c39affa2b376 new interface ? :)
pontscho
parents:
diff changeset
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
65730cea02e7 add half new input support for gui
pontscho
parents: 4845
diff changeset
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
c39affa2b376 new interface ? :)
pontscho
parents:
diff changeset
33
4858
65730cea02e7 add half new input support for gui
pontscho
parents: 4845
diff changeset
34 int guiCMDArray[] =
65730cea02e7 add half new input support for gui
pontscho
parents: 4845
diff changeset
35 {
65730cea02e7 add half new input support for gui
pontscho
parents: 4845
diff changeset
36 evLoad,
65730cea02e7 add half new input support for gui
pontscho
parents: 4845
diff changeset
37 evLoadSubtitle,
65730cea02e7 add half new input support for gui
pontscho
parents: 4845
diff changeset
38 evAbout,
65730cea02e7 add half new input support for gui
pontscho
parents: 4845
diff changeset
39 evPlay,
65730cea02e7 add half new input support for gui
pontscho
parents: 4845
diff changeset
40 evStop,
65730cea02e7 add half new input support for gui
pontscho
parents: 4845
diff changeset
41 evPlayList,
65730cea02e7 add half new input support for gui
pontscho
parents: 4845
diff changeset
42 evPreferences,
65730cea02e7 add half new input support for gui
pontscho
parents: 4845
diff changeset
43 evFullScreen,
65730cea02e7 add half new input support for gui
pontscho
parents: 4845
diff changeset
44 evSkinBrowser
65730cea02e7 add half new input support for gui
pontscho
parents: 4845
diff changeset
45 };
65730cea02e7 add half new input support for gui
pontscho
parents: 4845
diff changeset
46
4798
c39affa2b376 new interface ? :)
pontscho
parents:
diff changeset
47 void guiGetEvent( int type,char * arg )
c39affa2b376 new interface ? :)
pontscho
parents:
diff changeset
48 {
c39affa2b376 new interface ? :)
pontscho
parents:
diff changeset
49 switch ( type )
c39affa2b376 new interface ? :)
pontscho
parents:
diff changeset
50 {
c39affa2b376 new interface ? :)
pontscho
parents:
diff changeset
51 case guiXEvent:
c39affa2b376 new interface ? :)
pontscho
parents:
diff changeset
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
c39affa2b376 new interface ? :)
pontscho
parents:
diff changeset
55 case guiCEvent:
4963
13262bd21965 small changes
pontscho
parents: 4858
diff changeset
56 switch ( (int)arg )
13262bd21965 small changes
pontscho
parents: 4858
diff changeset
57 {
13262bd21965 small changes
pontscho
parents: 4858
diff changeset
58 case guiSetPlay: guiIntfStruct.Playing=1; mplState(); break;
13262bd21965 small changes
pontscho
parents: 4858
diff changeset
59 case guiSetStop: guiIntfStruct.Playing=0; mplState(); break;
13262bd21965 small changes
pontscho
parents: 4858
diff changeset
60 case guiSetPause: guiIntfStruct.Playing=2; mplState(); break;
13262bd21965 small changes
pontscho
parents: 4858
diff changeset
61 }
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4798
diff changeset
62 break;
5120
ce054c1eabdc workaround to compile without new-input support
alex
parents: 4965
diff changeset
63 #ifdef HAVE_NEW_INPUT
4858
65730cea02e7 add half new input support for gui
pontscho
parents: 4845
diff changeset
64 case guiIEvent:
65730cea02e7 add half new input support for gui
pontscho
parents: 4845
diff changeset
65 printf( "cmd: %d\n",(int)arg );
65730cea02e7 add half new input support for gui
pontscho
parents: 4845
diff changeset
66 switch( (int)arg )
65730cea02e7 add half new input support for gui
pontscho
parents: 4845
diff changeset
67 {
65730cea02e7 add half new input support for gui
pontscho
parents: 4845
diff changeset
68 case MP_CMD_QUIT:
65730cea02e7 add half new input support for gui
pontscho
parents: 4845
diff changeset
69 mplEventHandling( evExit,0 );
65730cea02e7 add half new input support for gui
pontscho
parents: 4845
diff changeset
70 break;
65730cea02e7 add half new input support for gui
pontscho
parents: 4845
diff changeset
71 case MP_CMD_VO_FULLSCREEN:
65730cea02e7 add half new input support for gui
pontscho
parents: 4845
diff changeset
72 mplEventHandling( evFullScreen,0 );
65730cea02e7 add half new input support for gui
pontscho
parents: 4845
diff changeset
73 break;
65730cea02e7 add half new input support for gui
pontscho
parents: 4845
diff changeset
74 default:
65730cea02e7 add half new input support for gui
pontscho
parents: 4845
diff changeset
75 mplEventHandling( guiCMDArray[ (int)arg - MP_CMD_GUI_EVENTS - 1 ],0 );
65730cea02e7 add half new input support for gui
pontscho
parents: 4845
diff changeset
76 }
65730cea02e7 add half new input support for gui
pontscho
parents: 4845
diff changeset
77 break;
5120
ce054c1eabdc workaround to compile without new-input support
alex
parents: 4965
diff changeset
78 #endif
4798
c39affa2b376 new interface ? :)
pontscho
parents:
diff changeset
79 }
c39affa2b376 new interface ? :)
pontscho
parents:
diff changeset
80 }
c39affa2b376 new interface ? :)
pontscho
parents:
diff changeset
81
c39affa2b376 new interface ? :)
pontscho
parents:
diff changeset
82 void guiEventHandling( void )
c39affa2b376 new interface ? :)
pontscho
parents:
diff changeset
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
c39affa2b376 new interface ? :)
pontscho
parents:
diff changeset
87 }