Mercurial > mplayer.hg
annotate Gui/interface.c @ 5672:1f8b34f1e7c0
ifdef reading dvd args, without it non-dvd compilation fails.
(correct me if i'm wrong)
author | eyck |
---|---|
date | Thu, 18 Apr 2002 14:03:50 +0000 |
parents | 3e7f39c4110c |
children | 0132c5747e8a |
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" |
5665 | 17 #include "../libmpdemux/stream.h" |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
18 |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
19 guiInterface_t guiIntfStruct; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
20 |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
21 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
|
22 { |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
23 memset( &guiIntfStruct,0,sizeof( guiIntfStruct ) ); |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
24 appInit( argc,argv,envp,(void*)mDisplay ); |
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 |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
27 void guiDone( void ) |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
28 { |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
29 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
|
30 mplStop(); |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
31 gtkDone(); |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
32 wsXDone(); |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
33 } |
4798 | 34 |
4858 | 35 int guiCMDArray[] = |
36 { | |
37 evLoad, | |
38 evLoadSubtitle, | |
39 evAbout, | |
40 evPlay, | |
41 evStop, | |
42 evPlayList, | |
43 evPreferences, | |
44 evFullScreen, | |
45 evSkinBrowser | |
46 }; | |
47 | |
4798 | 48 void guiGetEvent( int type,char * arg ) |
49 { | |
5672
1f8b34f1e7c0
ifdef reading dvd args, without it non-dvd compilation fails.
eyck
parents:
5665
diff
changeset
|
50 #ifdef USE_DVDREAD |
5665 | 51 dvd_priv_t * dvdp = (dvd_priv_t *) arg; |
5672
1f8b34f1e7c0
ifdef reading dvd args, without it non-dvd compilation fails.
eyck
parents:
5665
diff
changeset
|
52 #endif |
4798 | 53 switch ( type ) |
54 { | |
55 case guiXEvent: | |
56 wsEvents( wsDisplay,(XEvent *)arg,NULL ); | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
57 gtkEventHandling(); |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
58 break; |
4798 | 59 case guiCEvent: |
4963 | 60 switch ( (int)arg ) |
61 { | |
62 case guiSetPlay: guiIntfStruct.Playing=1; mplState(); break; | |
63 case guiSetStop: guiIntfStruct.Playing=0; mplState(); break; | |
64 case guiSetPause: guiIntfStruct.Playing=2; mplState(); break; | |
65 } | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
66 break; |
5665 | 67 case guiSetState: |
68 mplState(); | |
69 break; | |
70 case guiSetFileName: | |
71 if ( arg ) guiSetFilename( guiIntfStruct.Filename,arg ); | |
72 break; | |
73 #ifdef USE_DVDREAD | |
74 case guiSetDVD: | |
75 guiIntfStruct.DVD.titles=dvdp->vmg_file->tt_srpt->nr_of_srpts; | |
76 guiIntfStruct.DVD.chapters=dvdp->vmg_file->tt_srpt->title[dvd_title].nr_of_ptts; | |
77 guiIntfStruct.DVD.angles=dvdp->vmg_file->tt_srpt->title[dvd_title].nr_of_angles; | |
78 guiIntfStruct.DVD.nr_of_audio_channels=dvdp->nr_of_channels; | |
79 memcpy( guiIntfStruct.DVD.audio_streams,dvdp->audio_streams,sizeof( dvdp->audio_streams ) ); | |
80 guiIntfStruct.DVD.nr_of_subtitles=dvdp->nr_of_subtitles; | |
81 memcpy( guiIntfStruct.DVD.subtitles,dvdp->subtitles,sizeof( dvdp->subtitles ) ); | |
82 guiIntfStruct.DVD.current_title=dvd_title + 1; | |
83 guiIntfStruct.DVD.current_chapter=dvd_chapter + 1; | |
84 guiIntfStruct.DVD.current_angle=dvd_angle + 1; | |
85 guiIntfStruct.Track=dvd_title + 1; | |
86 break; | |
87 #endif | |
5120 | 88 #ifdef HAVE_NEW_INPUT |
4858 | 89 case guiIEvent: |
90 printf( "cmd: %d\n",(int)arg ); | |
91 switch( (int)arg ) | |
92 { | |
93 case MP_CMD_QUIT: | |
94 mplEventHandling( evExit,0 ); | |
95 break; | |
96 case MP_CMD_VO_FULLSCREEN: | |
97 mplEventHandling( evFullScreen,0 ); | |
98 break; | |
99 default: | |
100 mplEventHandling( guiCMDArray[ (int)arg - MP_CMD_GUI_EVENTS - 1 ],0 ); | |
101 } | |
102 break; | |
5120 | 103 #endif |
4798 | 104 } |
105 } | |
106 | |
107 void guiEventHandling( void ) | |
108 { | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
109 if ( use_gui && !guiIntfStruct.Playing ) wsHandleEvents(); |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
110 gtkEventHandling(); |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
111 mplTimerHandler(); // handle GUI timer events |
4798 | 112 } |