Mercurial > mplayer.hg
annotate Gui/mplayer/play.c @ 1780:2e406cbf4f4b
optim fix ;))))))
author | pontscho |
---|---|
date | Thu, 30 Aug 2001 16:52:57 +0000 |
parents | fcba80a2e79f |
children | e9ea2e9cf854 |
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 { | |
1780 | 60 if ( mplShMem->Filename[0] == 0 ) return; |
1693 | 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 { | |
1770 | 79 vo_setwindowsize( width,height ); |
80 vo_resize=1; | |
1693 | 81 } |
82 | |
83 void mplMPlayerInit( int argc,char* argv[], char *envp[] ) | |
84 { | |
1729 | 85 #if 0 |
1693 | 86 mplShMem=shmem_alloc( ShMemSize ); |
1729 | 87 #else |
88 mplShMem=calloc( 1,ShMemSize ); | |
89 #endif | |
1693 | 90 signal( SIGTYPE,mplMainSigHandler ); |
1743 | 91 // signal( SIGCHLD,SIG_IGN ); |
1693 | 92 |
93 mplShMem->Playing=0; | |
94 mplShMem->Volume=0.0f; | |
95 mplShMem->Position=0.0f; | |
96 mplShMem->Balance=50.0f; | |
97 mplShMem->Track=0; | |
98 mplShMem->AudioType=0; | |
99 mplShMem->StreamType=0; | |
100 mplShMem->TimeSec=0; | |
101 mplShMem->LengthInSec=0; | |
102 | |
103 // --- | |
104 // --- | |
105 } | |
106 | |
107 float mplGetPosition( void ) | |
108 { // return 0.0 ... 100.0 | |
1729 | 109 return mplShMem->Position; |
1693 | 110 } |
111 | |
112 void mplRelSeek( float s ) | |
113 { // -+s | |
114 // --- | |
1743 | 115 //printf("%%%%%% RelSEEK=%5.3f \n",s); |
1693 | 116 // --- |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1693
diff
changeset
|
117 rel_seek_secs=s; abs_seek_pos=0; |
1693 | 118 } |
119 | |
120 void mplAbsSeek( float s ) | |
121 { // 0.0 ... 100.0 | |
122 // --- | |
1743 | 123 //printf("%%%%%% AbsSEEK=%5.3f \n",s); |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1693
diff
changeset
|
124 rel_seek_secs=0.01*s; abs_seek_pos=3; |
1693 | 125 // --- |
126 } | |
127 | |
128 void mplIncAudioBufDelay( void ) | |
129 { | |
130 } | |
131 | |
132 void mplDecAudioBufDelay( void ) | |
133 { | |
134 } |