comparison Gui/mplayer/play.c @ 1693:d237c5d4b216

GUI version n-1
author arpi
date Sat, 25 Aug 2001 21:04:29 +0000
parents
children 5e4214a7540e
comparison
equal deleted inserted replaced
1692:6c98e425c091 1693:d237c5d4b216
1
2 #include <stdlib.h>
3 #include <stdio.h>
4
5 #include <unistd.h>
6 #include <signal.h>
7
8 int mplParent = 1;
9
10 int mplx,mply,mplwidth,mplheight;
11
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"
19
20 #include "widgets.h"
21 #include "./mplayer.h"
22 #include "psignal.h"
23 #include "play.h"
24
25 mplCommStruct * mplShMem;
26 char * Filename = NULL;
27
28 void mplPlayerThread( void )
29 {
30 // mplayer( 0,NULL,NULL );
31 }
32
33 void mplFullScreen( void )
34 {
35 if ( appMPlayer.subWindow.isFullScreen )
36 {
37 if ( mplShMem->Playing )
38 {
39 appMPlayer.subWindow.OldX=mplx;
40 appMPlayer.subWindow.OldY=mply;
41 appMPlayer.subWindow.OldWidth=mplwidth;
42 appMPlayer.subWindow.OldHeight=mplheight;
43 }
44 else
45 {
46 appMPlayer.subWindow.OldWidth=appMPlayer.sub.width;
47 appMPlayer.subWindow.OldHeight=appMPlayer.sub.height;
48 appMPlayer.subWindow.OldX=( wsMaxX - appMPlayer.sub.width ) / 2;
49 appMPlayer.subWindow.OldY=( wsMaxY - appMPlayer.sub.height ) / 2;
50 }
51 }
52 wsFullScreen( &appMPlayer.subWindow );
53 wsMoveTopWindow( &appMPlayer.subWindow );
54 }
55
56 extern int mplSubRender;
57
58 void mplStop()
59 {
60 if ( !mplShMem->Playing ) return;
61 // ---
62 printf("%%%%%% STOP \n");
63 // ---
64 mplShMem->Playing=0;
65 }
66
67 void mplPlay( void )
68 {
69 if ( !Filename ) return;
70 if ( mplShMem->Playing ) mplStop();
71 // ---
72 printf("%%%%%% PLAY \n");
73 // ---
74 mplShMem->Playing=1;
75 }
76
77 void mplPause( void )
78 {
79 if ( mplShMem->Playing != 1 ) return;
80 // ---
81 printf("%%%%%% PAUSE \n");
82 // ---
83 mplShMem->Playing=2;
84 }
85
86 void mplResize( unsigned int X,unsigned int Y,unsigned int width,unsigned int height )
87 {
88 }
89
90 void mplMPlayerInit( int argc,char* argv[], char *envp[] )
91 {
92 mplShMem=shmem_alloc( ShMemSize );
93 signal( SIGTYPE,mplMainSigHandler );
94 signal( SIGCHLD,SIG_IGN );
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
112 return mplShMem->Position;
113 }
114
115 void mplRelSeek( float s )
116 { // -+s
117 // ---
118 printf("%%%%%% RelSEEK=%5.3f \n",s);
119 // ---
120 mplShMem->Position=mplGetPosition() + s;
121 }
122
123 void mplAbsSeek( float s )
124 { // 0.0 ... 100.0
125 // ---
126 printf("%%%%%% AbsSEEK=%5.3f \n",s);
127 // ---
128 mplShMem->Position=s;
129 mplShMem->TimeSec=s;
130 }
131
132 void mplIncAudioBufDelay( void )
133 {
134 }
135
136 void mplDecAudioBufDelay( void )
137 {
138 }