comparison Gui/mplayer/play.c @ 1729:d6c99f70449e

fix hprogressbar
author pontscho
date Tue, 28 Aug 2001 15:55:02 +0000
parents 5e4214a7540e
children b266f763cad3
comparison
equal deleted inserted replaced
1728:014b29286ec4 1729:d6c99f70449e
5 #include <unistd.h> 5 #include <unistd.h>
6 #include <signal.h> 6 #include <signal.h>
7 7
8 int mplParent = 1; 8 int mplParent = 1;
9 9
10 float gui_position=-1;
11
10 int mplx,mply,mplwidth,mplheight; 12 int mplx,mply,mplwidth,mplheight;
11
12 float gui_position=-1;
13 13
14 #include "../app.h" 14 #include "../app.h"
15 15
16 #include "../wm/ws.h" 16 #include "../wm/ws.h"
17 #include "../wm/wskeys.h" 17 #include "../wm/wskeys.h"
98 98
99 } 99 }
100 100
101 void mplMPlayerInit( int argc,char* argv[], char *envp[] ) 101 void mplMPlayerInit( int argc,char* argv[], char *envp[] )
102 { 102 {
103 #if 0
103 mplShMem=shmem_alloc( ShMemSize ); 104 mplShMem=shmem_alloc( ShMemSize );
105 #else
106 mplShMem=calloc( 1,ShMemSize );
107 #endif
104 signal( SIGTYPE,mplMainSigHandler ); 108 signal( SIGTYPE,mplMainSigHandler );
105 signal( SIGCHLD,SIG_IGN ); 109 signal( SIGCHLD,SIG_IGN );
106 110
107 mplShMem->Playing=0; 111 mplShMem->Playing=0;
108 mplShMem->Volume=0.0f; 112 mplShMem->Volume=0.0f;
118 // --- 122 // ---
119 } 123 }
120 124
121 float mplGetPosition( void ) 125 float mplGetPosition( void )
122 { // return 0.0 ... 100.0 126 { // return 0.0 ... 100.0
123 return (gui_position<0)?(mplShMem->Position):(gui_position*100.0); 127 // return (gui_position<0)?(mplShMem->Position):(gui_position*100.0);
128 return mplShMem->Position;
124 } 129 }
125 130
126 void mplRelSeek( float s ) 131 void mplRelSeek( float s )
127 { // -+s 132 { // -+s
128 // --- 133 // ---
129 printf("%%%%%% RelSEEK=%5.3f \n",s); 134 printf("%%%%%% RelSEEK=%5.3f \n",s);
130 // --- 135 // ---
131 mplShMem->Position=mplGetPosition() + s;
132 rel_seek_secs=s; abs_seek_pos=0; 136 rel_seek_secs=s; abs_seek_pos=0;
133 } 137 }
134 138
135 void mplAbsSeek( float s ) 139 void mplAbsSeek( float s )
136 { // 0.0 ... 100.0 140 { // 0.0 ... 100.0
137 // --- 141 // ---
138 printf("%%%%%% AbsSEEK=%5.3f \n",s); 142 printf("%%%%%% AbsSEEK=%5.3f \n",s);
139 rel_seek_secs=0.01*s; abs_seek_pos=3; 143 rel_seek_secs=0.01*s; abs_seek_pos=3;
140 // --- 144 // ---
141 mplShMem->Position=s;
142 mplShMem->TimeSec=s;
143 } 145 }
144 146
145 void mplIncAudioBufDelay( void ) 147 void mplIncAudioBufDelay( void )
146 { 148 {
147 } 149 }