Mercurial > mplayer.hg
annotate Gui/mplayer/play.c @ 1747:e955ee46d3e0
fix fullscreen
author | pontscho |
---|---|
date | Wed, 29 Aug 2001 15:43:29 +0000 |
parents | b266f763cad3 |
children | 9621e4d14c6d |
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 } | |
57 wsFullScreen( &appMPlayer.subWindow ); | |
58 wsMoveTopWindow( &appMPlayer.subWindow ); | |
59 } | |
60 | |
61 extern int mplSubRender; | |
62 | |
63 void mplStop() | |
64 { | |
65 if ( !mplShMem->Playing ) return; | |
66 // --- | |
67 printf("%%%%%% STOP \n"); | |
68 // --- | |
69 mplShMem->Playing=0; | |
70 } | |
71 | |
72 void mplPlay( void ) | |
73 { | |
74 if ( !Filename ) return; | |
75 if ( mplShMem->Playing ) mplStop(); | |
76 // --- | |
77 printf("%%%%%% PLAY \n"); | |
78 // --- | |
79 mplShMem->Playing=1; | |
80 } | |
81 | |
82 void mplPause( void ) | |
83 { | |
84 if ( mplShMem->Playing != 1 ) return; | |
85 // --- | |
86 printf("%%%%%% PAUSE \n"); | |
87 // --- | |
88 mplShMem->Playing=2; | |
89 } | |
90 | |
91 void mplResize( unsigned int X,unsigned int Y,unsigned int width,unsigned int height ) | |
92 { | |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1693
diff
changeset
|
93 |
1747 | 94 //printf("mplResize(%d,%d,%d,%d) \n",X,Y,width,height); |
95 vo_setwindowsize( width,height ); | |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1693
diff
changeset
|
96 vo_resize=1; |
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1693
diff
changeset
|
97 |
1693 | 98 } |
99 | |
100 void mplMPlayerInit( int argc,char* argv[], char *envp[] ) | |
101 { | |
1729 | 102 #if 0 |
1693 | 103 mplShMem=shmem_alloc( ShMemSize ); |
1729 | 104 #else |
105 mplShMem=calloc( 1,ShMemSize ); | |
106 #endif | |
1693 | 107 signal( SIGTYPE,mplMainSigHandler ); |
1743 | 108 // signal( SIGCHLD,SIG_IGN ); |
1693 | 109 |
110 mplShMem->Playing=0; | |
111 mplShMem->Volume=0.0f; | |
112 mplShMem->Position=0.0f; | |
113 mplShMem->Balance=50.0f; | |
114 mplShMem->Track=0; | |
115 mplShMem->AudioType=0; | |
116 mplShMem->StreamType=0; | |
117 mplShMem->TimeSec=0; | |
118 mplShMem->LengthInSec=0; | |
119 | |
120 // --- | |
121 // --- | |
122 } | |
123 | |
124 float mplGetPosition( void ) | |
125 { // return 0.0 ... 100.0 | |
1729 | 126 return mplShMem->Position; |
1693 | 127 } |
128 | |
129 void mplRelSeek( float s ) | |
130 { // -+s | |
131 // --- | |
1743 | 132 //printf("%%%%%% RelSEEK=%5.3f \n",s); |
1693 | 133 // --- |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1693
diff
changeset
|
134 rel_seek_secs=s; abs_seek_pos=0; |
1693 | 135 } |
136 | |
137 void mplAbsSeek( float s ) | |
138 { // 0.0 ... 100.0 | |
139 // --- | |
1743 | 140 //printf("%%%%%% AbsSEEK=%5.3f \n",s); |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1693
diff
changeset
|
141 rel_seek_secs=0.01*s; abs_seek_pos=3; |
1693 | 142 // --- |
143 } | |
144 | |
145 void mplIncAudioBufDelay( void ) | |
146 { | |
147 } | |
148 | |
149 void mplDecAudioBufDelay( void ) | |
150 { | |
151 } |