annotate Gui/mplayer/pb.c @ 20628:782c697bd4c2

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