Mercurial > mplayer.hg
annotate Gui/mplayer/play.c @ 1756:9621e4d14c6d
fullscreen fixed
author | pontscho |
---|---|
date | Wed, 29 Aug 2001 17:48:06 +0000 |
parents | e955ee46d3e0 |
children | 6f35d37af91c |
rev | line source |
---|---|
1693 | 1 |
2 #include <stdlib.h> | |
3 #include <stdio.h> | |
4 | |
5 #include <unistd.h> | |
6 #include <signal.h> | |
7 | |
8 int mplParent = 1; | |
9 | |
1729 | 10 int mplx,mply,mplwidth,mplheight; |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1693
diff
changeset
|
11 |
1693 | 12 #include "../app.h" |
13 | |
14 #include "../wm/ws.h" | |
15 #include "../wm/wskeys.h" | |
16 #include "../wm/widget.h" | |
17 | |
18 #include "../../config.h" | |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1693
diff
changeset
|
19 #include "../../libvo/x11_common.h" |
1693 | 20 |
21 #include "widgets.h" | |
22 #include "./mplayer.h" | |
23 #include "psignal.h" | |
24 #include "play.h" | |
25 | |
26 mplCommStruct * mplShMem; | |
27 char * Filename = NULL; | |
28 | |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1693
diff
changeset
|
29 extern float rel_seek_secs; |
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1693
diff
changeset
|
30 extern int abs_seek_pos; |
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1693
diff
changeset
|
31 |
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1693
diff
changeset
|
32 |
1693 | 33 void mplPlayerThread( void ) |
34 { | |
35 // mplayer( 0,NULL,NULL ); | |
36 } | |
37 | |
38 void mplFullScreen( void ) | |
39 { | |
40 if ( appMPlayer.subWindow.isFullScreen ) | |
41 { | |
42 if ( mplShMem->Playing ) | |
43 { | |
44 appMPlayer.subWindow.OldX=mplx; | |
45 appMPlayer.subWindow.OldY=mply; | |
46 appMPlayer.subWindow.OldWidth=mplwidth; | |
47 appMPlayer.subWindow.OldHeight=mplheight; | |
48 } | |
49 else | |
50 { | |
51 appMPlayer.subWindow.OldWidth=appMPlayer.sub.width; | |
52 appMPlayer.subWindow.OldHeight=appMPlayer.sub.height; | |
53 appMPlayer.subWindow.OldX=( wsMaxX - appMPlayer.sub.width ) / 2; | |
54 appMPlayer.subWindow.OldY=( wsMaxY - appMPlayer.sub.height ) / 2; | |
55 } | |
56 } | |
1756 | 57 else |
58 { | |
59 mplx=appMPlayer.subWindow.OldX; | |
60 mply=appMPlayer.subWindow.OldY; | |
61 mplwidth=appMPlayer.subWindow.OldWidth; | |
62 mplheight=appMPlayer.subWindow.OldHeight; | |
63 } | |
1693 | 64 wsFullScreen( &appMPlayer.subWindow ); |
1756 | 65 // wsMoveTopWindow( &appMPlayer.subWindow ); |
66 mplResize( 0,0,appMPlayer.subWindow.Width,appMPlayer.subWindow.Height ); | |
1693 | 67 } |
68 | |
69 extern int mplSubRender; | |
70 | |
71 void mplStop() | |
72 { | |
73 if ( !mplShMem->Playing ) return; | |
74 // --- | |
75 printf("%%%%%% STOP \n"); | |
76 // --- | |
77 mplShMem->Playing=0; | |
78 } | |
79 | |
80 void mplPlay( void ) | |
81 { | |
82 if ( !Filename ) return; | |
83 if ( mplShMem->Playing ) mplStop(); | |
84 // --- | |
85 printf("%%%%%% PLAY \n"); | |
86 // --- | |
87 mplShMem->Playing=1; | |
88 } | |
89 | |
90 void mplPause( void ) | |
91 { | |
92 if ( mplShMem->Playing != 1 ) return; | |
93 // --- | |
94 printf("%%%%%% PAUSE \n"); | |
95 // --- | |
96 mplShMem->Playing=2; | |
97 } | |
98 | |
99 void mplResize( unsigned int X,unsigned int Y,unsigned int width,unsigned int height ) | |
100 { | |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1693
diff
changeset
|
101 |
1756 | 102 printf("mplResize(%d,%d,%d,%d) \n",X,Y,width,height); |
1747 | 103 vo_setwindowsize( width,height ); |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1693
diff
changeset
|
104 vo_resize=1; |
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1693
diff
changeset
|
105 |
1693 | 106 } |
107 | |
108 void mplMPlayerInit( int argc,char* argv[], char *envp[] ) | |
109 { | |
1729 | 110 #if 0 |
1693 | 111 mplShMem=shmem_alloc( ShMemSize ); |
1729 | 112 #else |
113 mplShMem=calloc( 1,ShMemSize ); | |
114 #endif | |
1693 | 115 signal( SIGTYPE,mplMainSigHandler ); |
1743 | 116 // signal( SIGCHLD,SIG_IGN ); |
1693 | 117 |
118 mplShMem->Playing=0; | |
119 mplShMem->Volume=0.0f; | |
120 mplShMem->Position=0.0f; | |
121 mplShMem->Balance=50.0f; | |
122 mplShMem->Track=0; | |
123 mplShMem->AudioType=0; | |
124 mplShMem->StreamType=0; | |
125 mplShMem->TimeSec=0; | |
126 mplShMem->LengthInSec=0; | |
127 | |
128 // --- | |
129 // --- | |
130 } | |
131 | |
132 float mplGetPosition( void ) | |
133 { // return 0.0 ... 100.0 | |
1729 | 134 return mplShMem->Position; |
1693 | 135 } |
136 | |
137 void mplRelSeek( float s ) | |
138 { // -+s | |
139 // --- | |
1743 | 140 //printf("%%%%%% RelSEEK=%5.3f \n",s); |
1693 | 141 // --- |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1693
diff
changeset
|
142 rel_seek_secs=s; abs_seek_pos=0; |
1693 | 143 } |
144 | |
145 void mplAbsSeek( float s ) | |
146 { // 0.0 ... 100.0 | |
147 // --- | |
1743 | 148 //printf("%%%%%% AbsSEEK=%5.3f \n",s); |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1693
diff
changeset
|
149 rel_seek_secs=0.01*s; abs_seek_pos=3; |
1693 | 150 // --- |
151 } | |
152 | |
153 void mplIncAudioBufDelay( void ) | |
154 { | |
155 } | |
156 | |
157 void mplDecAudioBufDelay( void ) | |
158 { | |
159 } |