Mercurial > mplayer.hg
annotate Gui/mplayer/play.c @ 1765:29913c011d50
normal size
author | pontscho |
---|---|
date | Thu, 30 Aug 2001 10:55:17 +0000 |
parents | 6f35d37af91c |
children | 7e3136adcfb1 |
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 | |
1765 | 10 int moviex,moviey,moviewidth,movieheight; |
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 { | |
1765 | 40 // if ( appMPlayer.subWindow.isFullScreen ) |
41 // { | |
42 // } | |
43 wsFullScreen( &appMPlayer.subWindow ); | |
1756 | 44 mplResize( 0,0,appMPlayer.subWindow.Width,appMPlayer.subWindow.Height ); |
1693 | 45 } |
46 | |
47 extern int mplSubRender; | |
48 | |
49 void mplStop() | |
50 { | |
51 if ( !mplShMem->Playing ) return; | |
52 // --- | |
53 printf("%%%%%% STOP \n"); | |
54 // --- | |
55 mplShMem->Playing=0; | |
56 } | |
57 | |
58 void mplPlay( void ) | |
59 { | |
60 if ( !Filename ) return; | |
61 if ( mplShMem->Playing ) mplStop(); | |
62 // --- | |
63 printf("%%%%%% PLAY \n"); | |
64 // --- | |
65 mplShMem->Playing=1; | |
66 } | |
67 | |
68 void mplPause( void ) | |
69 { | |
70 if ( mplShMem->Playing != 1 ) return; | |
71 // --- | |
72 printf("%%%%%% PAUSE \n"); | |
73 // --- | |
74 mplShMem->Playing=2; | |
75 } | |
76 | |
77 void mplResize( unsigned int X,unsigned int Y,unsigned int width,unsigned int height ) | |
78 { | |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1693
diff
changeset
|
79 |
1756 | 80 printf("mplResize(%d,%d,%d,%d) \n",X,Y,width,height); |
1747 | 81 vo_setwindowsize( width,height ); |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1693
diff
changeset
|
82 vo_resize=1; |
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1693
diff
changeset
|
83 |
1693 | 84 } |
85 | |
86 void mplMPlayerInit( int argc,char* argv[], char *envp[] ) | |
87 { | |
1729 | 88 #if 0 |
1693 | 89 mplShMem=shmem_alloc( ShMemSize ); |
1729 | 90 #else |
91 mplShMem=calloc( 1,ShMemSize ); | |
92 #endif | |
1693 | 93 signal( SIGTYPE,mplMainSigHandler ); |
1743 | 94 // signal( SIGCHLD,SIG_IGN ); |
1693 | 95 |
96 mplShMem->Playing=0; | |
97 mplShMem->Volume=0.0f; | |
98 mplShMem->Position=0.0f; | |
99 mplShMem->Balance=50.0f; | |
100 mplShMem->Track=0; | |
101 mplShMem->AudioType=0; | |
102 mplShMem->StreamType=0; | |
103 mplShMem->TimeSec=0; | |
104 mplShMem->LengthInSec=0; | |
105 | |
106 // --- | |
107 // --- | |
108 } | |
109 | |
110 float mplGetPosition( void ) | |
111 { // return 0.0 ... 100.0 | |
1729 | 112 return mplShMem->Position; |
1693 | 113 } |
114 | |
115 void mplRelSeek( float s ) | |
116 { // -+s | |
117 // --- | |
1743 | 118 //printf("%%%%%% RelSEEK=%5.3f \n",s); |
1693 | 119 // --- |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1693
diff
changeset
|
120 rel_seek_secs=s; abs_seek_pos=0; |
1693 | 121 } |
122 | |
123 void mplAbsSeek( float s ) | |
124 { // 0.0 ... 100.0 | |
125 // --- | |
1743 | 126 //printf("%%%%%% AbsSEEK=%5.3f \n",s); |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1693
diff
changeset
|
127 rel_seek_secs=0.01*s; abs_seek_pos=3; |
1693 | 128 // --- |
129 } | |
130 | |
131 void mplIncAudioBufDelay( void ) | |
132 { | |
133 } | |
134 | |
135 void mplDecAudioBufDelay( void ) | |
136 { | |
137 } |