annotate gui/mplayer/pb.c @ 23185:3d2aedade36f

dvdnav:// depends on our fork of libdvdnav
author nicodvb
date Tue, 01 May 2007 20:02:05 +0000
parents 17bf4f4b0715
children 22d3d12c6dfb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
2 // main window
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
3
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
4 #include <stdlib.h>
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
5 #include <stdio.h>
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
6 #include <inttypes.h>
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
7 #include <sys/stat.h>
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
8 #include <unistd.h>
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
9
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
10 #include "app.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
11 #include "skin/font.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
12 #include "skin/skin.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
13 #include "wm/ws.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
14
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
15 #include "../config.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
16 #include "../help_mp.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
17 #include "../libvo/x11_common.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
18 #include "../libvo/fastmemcpy.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
19
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
20 #include "../stream/stream.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
21 #include "../mixer.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
22 #include "../libvo/sub.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
23
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
24 #include "../libmpdemux/demuxer.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
25 #include "../libmpdemux/stheader.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
26 #include "../codec-cfg.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
27
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
28 #include "gmplayer.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
29 #include "play.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
30 #include "widgets.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
31 #include "common.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
32
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
33 extern unsigned int GetTimerMS( void );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
34 extern unsigned int GetTimer( void );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
35
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
36 unsigned char * mplPBDrawBuffer = NULL;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
37 int mplPBVisible = 0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
38 int mplPBLength = 0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
39 int mplPBFade = 0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
40
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
41 void mplPBDraw( void )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
42 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
43 int x;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
44
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
45 if ( !appMPlayer.subWindow.isFullScreen ) return;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
46 if ( !mplPBVisible || !appMPlayer.barIsPresent ) return;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
47
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
48 // appMPlayer.bar.x=( appMPlayer.subWindow.Width - appMPlayer.bar.width ) / 2;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
49 switch( appMPlayer.bar.x )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
50 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
51 case -1: x=( appMPlayer.subWindow.Width - appMPlayer.bar.width ) / 2; break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
52 case -2: x=( appMPlayer.subWindow.Width - appMPlayer.bar.width ); break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
53 default: x=appMPlayer.bar.x;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
54 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
55
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
56 switch ( mplPBFade )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
57 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
58 case 1: // fade in
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
59 mplPBLength--;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
60 if ( appMPlayer.subWindow.Height - appMPlayer.bar.height >= mplPBLength )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
61 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
62 mplPBLength=appMPlayer.subWindow.Height - appMPlayer.bar.height;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
63 mplPBFade=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
64 vo_mouse_autohide=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
65 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
66 wsMoveWindow( &appMPlayer.barWindow,0,x,mplPBLength );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
67 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
68 case 2: // fade out
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
69 mplPBLength+=10;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
70 if ( mplPBLength > appMPlayer.subWindow.Height )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
71 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
72 mplPBLength=appMPlayer.subWindow.Height;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
73 mplPBFade=mplPBVisible=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
74 vo_mouse_autohide=1;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
75 wsVisibleWindow( &appMPlayer.barWindow,wsHideWindow );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
76 return;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
77 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
78 wsMoveWindow( &appMPlayer.barWindow,0,x,mplPBLength );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
79 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
80 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
81
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
82 // --- render
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
83 if ( appMPlayer.barWindow.State == wsWindowExpose )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
84 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
85 btnModify( evSetMoviePosition,guiIntfStruct.Position );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
86 btnModify( evSetVolume,guiIntfStruct.Volume );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
87
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
88 vo_mouse_autohide=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
89
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
90 memcpy( mplPBDrawBuffer,appMPlayer.bar.Bitmap.Image,appMPlayer.bar.Bitmap.ImageSize );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
91 Render( &appMPlayer.barWindow,appMPlayer.barItems,appMPlayer.NumberOfBarItems,mplPBDrawBuffer,appMPlayer.bar.Bitmap.ImageSize );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
92 wsConvert( &appMPlayer.barWindow,mplPBDrawBuffer,appMPlayer.bar.Bitmap.ImageSize );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
93 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
94 wsPutImage( &appMPlayer.barWindow );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
95 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
96
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
97 #define itPLMButton (itNULL - 1)
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
98 #define itPRMButton (itNULL - 2)
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
99
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
100 void mplPBMouseHandle( int Button,int X,int Y,int RX,int RY )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
101 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
102 static int itemtype = 0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
103 int i;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
104 wItem * item = NULL;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
105 float value = 0.0f;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
106
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
107 static int SelectedItem = -1;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
108 int currentselected = -1;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
109
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
110 for ( i=0;i < appMPlayer.NumberOfBarItems + 1;i++ )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
111 if ( ( appMPlayer.barItems[i].pressed != btnDisabled )&&
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
112 ( wgIsRect( X,Y,appMPlayer.barItems[i].x,appMPlayer.barItems[i].y,appMPlayer.barItems[i].x+appMPlayer.barItems[i].width,appMPlayer.barItems[i].y+appMPlayer.barItems[i].height ) ) )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
113 { currentselected=i; break; }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
114
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
115 switch ( Button )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
116 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
117 case wsPMMouseButton:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
118 gtkShow( evHidePopUpMenu,NULL );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
119 mplShowMenu( RX,RY );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
120 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
121 case wsRMMouseButton:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
122 mplHideMenu( RX,RY,0 );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
123 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
124 case wsRRMouseButton:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
125 gtkShow( evShowPopUpMenu,NULL );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
126 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
127 // ---
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
128 case wsPLMouseButton:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
129 gtkShow( evHidePopUpMenu,NULL );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
130 SelectedItem=currentselected;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
131 if ( SelectedItem == -1 ) break; // yeees, i'm move the fucking window
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
132 item=&appMPlayer.barItems[SelectedItem];
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
133 itemtype=item->type;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
134 item->pressed=btnPressed;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
135
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
136 switch( item->type )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
137 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
138 case itButton:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
139 if ( ( SelectedItem > -1 ) &&
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
140 ( ( ( item->msg == evPlaySwitchToPause && item->msg == evPauseSwitchToPlay ) ) ||
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
141 ( ( item->msg == evPauseSwitchToPlay && item->msg == evPlaySwitchToPause ) ) ) )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
142 { item->pressed=btnDisabled; }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
143 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
144 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
145
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
146 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
147 case wsRLMouseButton:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
148 item=&appMPlayer.barItems[SelectedItem];
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
149 item->pressed=btnReleased;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
150 SelectedItem=-1;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
151 if ( currentselected == - 1 ) { itemtype=0; break; }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
152 value=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
153
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
154 switch( itemtype )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
155 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
156 case itPotmeter:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
157 case itHPotmeter:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
158 btnModify( item->msg,(float)( X - item->x ) / item->width * 100.0f );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
159 mplEventHandling( item->msg,item->value );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
160 value=item->value;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
161 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
162 case itVPotmeter:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
163 btnModify( item->msg, ( 1. - (float)( Y - item->y ) / item->height) * 100.0f );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
164 mplEventHandling( item->msg,item->value );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
165 value=item->value;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
166 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
167 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
168 mplEventHandling( item->msg,value );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
169
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
170 itemtype=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
171 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
172 // ---
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
173 case wsP5MouseButton: value=-2.5f; goto rollerhandled;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
174 case wsP4MouseButton: value= 2.5f;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
175 rollerhandled:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
176 item=&appMPlayer.barItems[currentselected];
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
177 if ( ( item->type == itHPotmeter )||( item->type == itVPotmeter )||( item->type == itPotmeter ) )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
178 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
179 item->value+=value;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
180 btnModify( item->msg,item->value );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
181 mplEventHandling( item->msg,item->value );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
182 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
183 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
184 // ---
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
185 case wsMoveMouse:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
186 item=&appMPlayer.barItems[SelectedItem];
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
187 switch ( itemtype )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
188 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
189 case itPRMButton:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
190 mplMenuMouseHandle( X,Y,RX,RY );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
191 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
192 case itPotmeter:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
193 item->value=(float)( X - item->x ) / item->width * 100.0f;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
194 goto potihandled;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
195 case itVPotmeter:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
196 item->value=(1. - (float)( Y - item->y ) / item->height) * 100.0f;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
197 goto potihandled;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
198 case itHPotmeter:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
199 item->value=(float)( X - item->x ) / item->width * 100.0f;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
200 potihandled:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
201 if ( item->value > 100.0f ) item->value=100.0f;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
202 if ( item->value < 0.0f ) item->value=0.0f;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
203 mplEventHandling( item->msg,item->value );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
204 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
205 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
206 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
207 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
208 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
209
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
210 void mplPBShow( int x, int y )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
211 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
212 if ( !appMPlayer.barIsPresent || !gtkEnablePlayBar ) return;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
213 if ( !appMPlayer.subWindow.isFullScreen ) return;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
214
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
215 if ( y > appMPlayer.subWindow.Height - appMPlayer.bar.height )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
216 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
217 if ( !mplPBFade ) wsVisibleWindow( &appMPlayer.barWindow,wsShowWindow );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
218 mplPBFade=1; mplPBVisible=1; wsPostRedisplay( &appMPlayer.barWindow );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
219 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
220 else if ( !mplPBFade ) mplPBFade=2;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
221 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
222
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
223 void mplPBInit( void )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
224 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
225 if ( !appMPlayer.barIsPresent ) return;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
226
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
227 gfree( (void**)&mplPBDrawBuffer );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
228
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
229 if ( ( mplPBDrawBuffer = malloc( appMPlayer.bar.Bitmap.ImageSize ) ) == NULL )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
230 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
231 mp_msg( MSGT_GPLAYER,MSGL_FATAL,MSGTR_NEMDB );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
232 exit( 0 );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
233 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
234
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
235 appMPlayer.barWindow.Parent=appMPlayer.subWindow.WindowID;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
236 wsCreateWindow( &appMPlayer.barWindow,
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
237 appMPlayer.bar.x,appMPlayer.bar.y,appMPlayer.bar.width,appMPlayer.bar.height,
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
238 wsNoBorder,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,wsHideFrame|wsHideWindow,"PlayBar" );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
239
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
240 wsSetShape( &appMPlayer.barWindow,appMPlayer.bar.Mask.Image );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
241
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
242 appMPlayer.barWindow.ReDraw=(void *)mplPBDraw;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
243 appMPlayer.barWindow.MouseHandler=mplPBMouseHandle;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
244 appMPlayer.barWindow.KeyHandler=mplMainKeyHandle;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
245
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
246 mplPBLength=appMPlayer.subWindow.Height;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
247 }