Mercurial > mplayer.hg
comparison Gui/mplayer/play.c @ 1812:d2d6a26ddb02
majd fix play&stop&pause&redraw
author | pontscho |
---|---|
date | Fri, 31 Aug 2001 21:19:52 +0000 |
parents | 76b4f7bcd087 |
children | eff8f3c200fa |
comparison
equal
deleted
inserted
replaced
1811:0483b88482f5 | 1812:d2d6a26ddb02 |
---|---|
31 mplCommStruct * mplShMem; | 31 mplCommStruct * mplShMem; |
32 char * Filename = NULL; | 32 char * Filename = NULL; |
33 | 33 |
34 extern float rel_seek_secs; | 34 extern float rel_seek_secs; |
35 extern int abs_seek_pos; | 35 extern int abs_seek_pos; |
36 | |
37 | |
38 void mplPlayerThread( void ) | |
39 { | |
40 // mplayer( 0,NULL,NULL ); | |
41 } | |
42 | 36 |
43 void mplFullScreen( void ) | 37 void mplFullScreen( void ) |
44 { | 38 { |
45 // if ( appMPlayer.subWindow.isFullScreen ) | 39 // if ( appMPlayer.subWindow.isFullScreen ) |
46 // { | 40 // { |
53 | 47 |
54 void mplStop() | 48 void mplStop() |
55 { | 49 { |
56 if ( !mplShMem->Playing ) return; | 50 if ( !mplShMem->Playing ) return; |
57 // --- | 51 // --- |
58 //printf("%%%%%% STOP \n"); | 52 printf("%%%%%% STOP \n"); |
59 // --- | 53 // --- |
60 mplShMem->Playing=0; | 54 mplShMem->Playing=0; |
55 mplShMem->TimeSec=0; | |
61 if ( !appMPlayer.subWindow.isFullScreen ) | 56 if ( !appMPlayer.subWindow.isFullScreen ) |
62 { | 57 { |
63 wsMoveWindow( &appMPlayer.subWindow,appMPlayer.sub.x,appMPlayer.sub.y ); | 58 wsMoveWindow( &appMPlayer.subWindow,appMPlayer.sub.x,appMPlayer.sub.y ); |
64 wsResizeWindow( &appMPlayer.subWindow,appMPlayer.sub.width,appMPlayer.sub.height ); | 59 wsResizeWindow( &appMPlayer.subWindow,appMPlayer.sub.width,appMPlayer.sub.height ); |
65 } | 60 } |
67 wsPostRedisplay( &appMPlayer.subWindow ); | 62 wsPostRedisplay( &appMPlayer.subWindow ); |
68 } | 63 } |
69 | 64 |
70 void mplPlay( void ) | 65 void mplPlay( void ) |
71 { | 66 { |
72 if ( ( mplShMem->Filename[0] == 0 )&& | 67 if ( ( mplShMem->Filename[0] == 0 )|| |
73 ( mplShMem->Playing == 1 ) ) return; | 68 ( mplShMem->Playing == 1 ) ) return; |
74 if ( mplShMem->Playing == 2 ) { mplPause(); return; } | 69 if ( mplShMem->Playing == 2 ) { mplPause(); return; } |
75 // --- | 70 // --- |
76 //printf("%%%%%% PLAY \n"); | 71 //printf("%%%%%% PLAY \n"); |
77 // --- | 72 // --- |
78 mplShMem->Playing=1; | 73 mplShMem->Playing=1; |
74 // wsPostRedisplay( &appMPlayer.subWindow ); | |
79 mplSubRender=0; | 75 mplSubRender=0; |
80 } | 76 } |
81 | 77 |
82 void mplPause( void ) | 78 void mplPause( void ) |
83 { | 79 { |
101 } | 97 } |
102 } | 98 } |
103 | 99 |
104 void mplResize( unsigned int X,unsigned int Y,unsigned int width,unsigned int height ) | 100 void mplResize( unsigned int X,unsigned int Y,unsigned int width,unsigned int height ) |
105 { | 101 { |
102 printf( "----resize---> %dx%d --- \n",width,height ); | |
106 vo_setwindowsize( width,height ); | 103 vo_setwindowsize( width,height ); |
107 vo_resize=1; | 104 vo_resize=1; |
108 } | 105 } |
109 | 106 |
110 void mplMPlayerInit( int argc,char* argv[], char *envp[] ) | 107 void mplMPlayerInit( int argc,char* argv[], char *envp[] ) |
113 mplShMem=shmem_alloc( ShMemSize ); | 110 mplShMem=shmem_alloc( ShMemSize ); |
114 #else | 111 #else |
115 mplShMem=calloc( 1,ShMemSize ); | 112 mplShMem=calloc( 1,ShMemSize ); |
116 #endif | 113 #endif |
117 signal( SIGTYPE,mplMainSigHandler ); | 114 signal( SIGTYPE,mplMainSigHandler ); |
118 // signal( SIGCHLD,SIG_IGN ); | 115 |
119 | 116 memset( mplShMem,0,ShMemSize ); |
120 mplShMem->Playing=0; | |
121 mplShMem->Volume=0.0f; | |
122 mplShMem->Position=0.0f; | |
123 mplShMem->Balance=50.0f; | 117 mplShMem->Balance=50.0f; |
124 mplShMem->Track=0; | |
125 mplShMem->AudioType=0; | |
126 mplShMem->StreamType=0; | |
127 mplShMem->TimeSec=0; | |
128 mplShMem->LengthInSec=0; | |
129 | |
130 // --- | |
131 // --- | |
132 } | 118 } |
133 | 119 |
134 float mplGetPosition( void ) | 120 float mplGetPosition( void ) |
135 { // return 0.0 ... 100.0 | 121 { // return 0.0 ... 100.0 |
136 return mplShMem->Position; | 122 return mplShMem->Position; |