comparison gui/ui/playbar.c @ 34697:ac6b38cd0d45

Rename sub window video window. It was a bad idea to name the video window "sub window" at the time the GUI was written. The term "sub window" does make sense from the programmer's point of view, but it doesn't make any sense at all from the user's point of view, because the sub window simply is the window where the video will be displayed. Moreover, since the term "sub" is generally short for "subtitles", the renaming makes the code much easier to understand.
author ib
date Sat, 03 Mar 2012 16:45:15 +0000
parents b03481253518
children ed0e00db4306
comparison
equal deleted inserted replaced
34696:f2c90c9dd61c 34697:ac6b38cd0d45
60 60
61 static void uiPlaybarDraw( void ) 61 static void uiPlaybarDraw( void )
62 { 62 {
63 int x; 63 int x;
64 64
65 if ( !guiApp.subWindow.isFullScreen ) return; 65 if ( !guiApp.videoWindow.isFullScreen ) return;
66 if ( !playbarVisible || !guiApp.playbarIsPresent ) return; 66 if ( !playbarVisible || !guiApp.playbarIsPresent ) return;
67 67
68 // guiApp.playbar.x=( guiApp.subWindow.Width - guiApp.playbar.width ) / 2; 68 // guiApp.playbar.x=( guiApp.videoWindow.Width - guiApp.playbar.width ) / 2;
69 switch( guiApp.playbar.x ) 69 switch( guiApp.playbar.x )
70 { 70 {
71 case -1: x=( guiApp.subWindow.Width - guiApp.playbar.width ) / 2; break; 71 case -1: x=( guiApp.videoWindow.Width - guiApp.playbar.width ) / 2; break;
72 case -2: x=( guiApp.subWindow.Width - guiApp.playbar.width ); break; 72 case -2: x=( guiApp.videoWindow.Width - guiApp.playbar.width ); break;
73 default: x=guiApp.playbar.x; 73 default: x=guiApp.playbar.x;
74 } 74 }
75 75
76 switch ( uiPlaybarFade ) 76 switch ( uiPlaybarFade )
77 { 77 {
78 case 1: // fade in 78 case 1: // fade in
79 playbarLength--; 79 playbarLength--;
80 if ( guiApp.subWindow.Height - guiApp.playbar.height >= playbarLength ) 80 if ( guiApp.videoWindow.Height - guiApp.playbar.height >= playbarLength )
81 { 81 {
82 playbarLength=guiApp.subWindow.Height - guiApp.playbar.height; 82 playbarLength=guiApp.videoWindow.Height - guiApp.playbar.height;
83 uiPlaybarFade=0; 83 uiPlaybarFade=0;
84 vo_mouse_autohide=0; 84 vo_mouse_autohide=0;
85 } 85 }
86 wsMoveWindow( &guiApp.playbarWindow,True,x,playbarLength ); 86 wsMoveWindow( &guiApp.playbarWindow,True,x,playbarLength );
87 break; 87 break;
88 case 2: // fade out 88 case 2: // fade out
89 playbarLength+=10; 89 playbarLength+=10;
90 if ( playbarLength > guiApp.subWindow.Height ) 90 if ( playbarLength > guiApp.videoWindow.Height )
91 { 91 {
92 playbarLength=guiApp.subWindow.Height; 92 playbarLength=guiApp.videoWindow.Height;
93 uiPlaybarFade=playbarVisible=0; 93 uiPlaybarFade=playbarVisible=0;
94 vo_mouse_autohide=1; 94 vo_mouse_autohide=1;
95 wsVisibleWindow( &guiApp.playbarWindow,wsHideWindow ); 95 wsVisibleWindow( &guiApp.playbarWindow,wsHideWindow );
96 return; 96 return;
97 } 97 }
228 } 228 }
229 229
230 void uiPlaybarShow( int y ) 230 void uiPlaybarShow( int y )
231 { 231 {
232 if ( !guiApp.playbarIsPresent || !gtkEnablePlayBar ) return; 232 if ( !guiApp.playbarIsPresent || !gtkEnablePlayBar ) return;
233 if ( !guiApp.subWindow.isFullScreen ) return; 233 if ( !guiApp.videoWindow.isFullScreen ) return;
234 234
235 if ( y > guiApp.subWindow.Height - guiApp.playbar.height ) 235 if ( y > guiApp.videoWindow.Height - guiApp.playbar.height )
236 { 236 {
237 if ( !uiPlaybarFade ) wsVisibleWindow( &guiApp.playbarWindow,wsShowWindow ); 237 if ( !uiPlaybarFade ) wsVisibleWindow( &guiApp.playbarWindow,wsShowWindow );
238 uiPlaybarFade=1; playbarVisible=1; wsPostRedisplay( &guiApp.playbarWindow ); 238 uiPlaybarFade=1; playbarVisible=1; wsPostRedisplay( &guiApp.playbarWindow );
239 } 239 }
240 else if ( !uiPlaybarFade ) uiPlaybarFade=2; 240 else if ( !uiPlaybarFade ) uiPlaybarFade=2;
250 { 250 {
251 gmp_msg( MSGT_GPLAYER,MSGL_FATAL,MSGTR_NEMDB ); 251 gmp_msg( MSGT_GPLAYER,MSGL_FATAL,MSGTR_NEMDB );
252 mplayer( MPLAYER_EXIT_GUI, EXIT_ERROR, 0 ); 252 mplayer( MPLAYER_EXIT_GUI, EXIT_ERROR, 0 );
253 } 253 }
254 254
255 guiApp.playbarWindow.Parent=guiApp.subWindow.WindowID; 255 guiApp.playbarWindow.Parent=guiApp.videoWindow.WindowID;
256 wsCreateWindow( &guiApp.playbarWindow, 256 wsCreateWindow( &guiApp.playbarWindow,
257 guiApp.playbar.x,guiApp.playbar.y,guiApp.playbar.width,guiApp.playbar.height, 257 guiApp.playbar.x,guiApp.playbar.y,guiApp.playbar.width,guiApp.playbar.height,
258 wsNoBorder,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,wsHideFrame|wsHideWindow,"PlayBar" ); 258 wsNoBorder,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,wsHideFrame|wsHideWindow,"PlayBar" );
259 259
260 wsSetShape( &guiApp.playbarWindow,guiApp.playbar.Mask.Image ); 260 wsSetShape( &guiApp.playbarWindow,guiApp.playbar.Mask.Image );
261 261
262 guiApp.playbarWindow.ReDraw=(void *)uiPlaybarDraw; 262 guiApp.playbarWindow.ReDraw=(void *)uiPlaybarDraw;
263 guiApp.playbarWindow.MouseHandler=uiPlaybarMouseHandle; 263 guiApp.playbarWindow.MouseHandler=uiPlaybarMouseHandle;
264 guiApp.playbarWindow.KeyHandler=uiMainKeyHandle; 264 guiApp.playbarWindow.KeyHandler=uiMainKeyHandle;
265 265
266 playbarLength=guiApp.subWindow.Height; 266 playbarLength=guiApp.videoWindow.Height;
267 } 267 }