annotate gui/mplayer/pb.c @ 25984:7df9448678d2

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