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