Mercurial > mplayer.hg
annotate gui/ui/sub.c @ 34636:fde1a35cf043
Simplify codec id <-> tag mapping using avformat_get_riff_*_tags.
This also ensures that again only audio mappings will be used for
audio and video mappings for video.
This fixes bug #2038.
Based on patch by Andrew Wason [rectalogic rectalogic com].
author | reimar |
---|---|
date | Tue, 14 Feb 2012 19:22:22 +0000 |
parents | f866092d51cd |
children | b03481253518 |
rev | line source |
---|---|
26458 | 1 /* |
2 * sub window | |
3 * | |
4 * This file is part of MPlayer. | |
5 * | |
6 * MPlayer is free software; you can redistribute it and/or modify | |
7 * it under the terms of the GNU General Public License as published by | |
8 * the Free Software Foundation; either version 2 of the License, or | |
9 * (at your option) any later version. | |
10 * | |
11 * MPlayer is distributed in the hope that it will be useful, | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 * GNU General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU General Public License along | |
17 * with MPlayer; if not, write to the Free Software Foundation, Inc., | |
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
19 */ | |
23077 | 20 |
23305
22d3d12c6dfb
Include string.h for memcpy, fastmemcpy.h alone is not enough.
reimar
parents:
23154
diff
changeset
|
21 #include <string.h> |
23077 | 22 |
26382
b2f4abcf20ed
Make include paths consistent; do not use ../ in them.
diego
parents:
26365
diff
changeset
|
23 #include "config.h" |
b2f4abcf20ed
Make include paths consistent; do not use ../ in them.
diego
parents:
26365
diff
changeset
|
24 #include "libvo/x11_common.h" |
b2f4abcf20ed
Make include paths consistent; do not use ../ in them.
diego
parents:
26365
diff
changeset
|
25 #include "help_mp.h" |
30516 | 26 #include "mp_core.h" |
23077 | 27 |
23154
e564b9cd7290
Fix several implicit declarations of functions warnings.
diego
parents:
23077
diff
changeset
|
28 #include "gmplayer.h" |
26365
10dfbc523184
Add gui/ prefix to some #include paths so that compilation from the
diego
parents:
23374
diff
changeset
|
29 #include "gui/app.h" |
10dfbc523184
Add gui/ prefix to some #include paths so that compilation from the
diego
parents:
23374
diff
changeset
|
30 #include "gui/interface.h" |
23077 | 31 #include "widgets.h" |
32 | |
33555 | 33 int uiSubRender = 0; |
34 int subVisible = 0; | |
23077 | 35 |
33555 | 36 void uiSubDraw( void ) |
23077 | 37 { |
33768 | 38 if ( guiApp.subWindow.State == wsWindowClosed ) mplayer( MPLAYER_EXIT_GUI, EXIT_QUIT, 0 ); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26458
diff
changeset
|
39 |
33555 | 40 if ( guiApp.subWindow.State == wsWindowFocusIn ) subVisible++; |
41 if ( guiApp.subWindow.State == wsWindowFocusOut && metacity_hack != 3 ) subVisible--; | |
23077 | 42 |
33555 | 43 if ( !guiApp.subWindow.Mapped || |
44 guiApp.subWindow.Visible == wsWindowNotVisible ) return; | |
23077 | 45 |
33555 | 46 if ( guiInfo.Playing ) uiSubRender=0; |
23077 | 47 |
33555 | 48 if ( uiSubRender && guiApp.subWindow.State == wsWindowExpose ) |
23077 | 49 { |
33555 | 50 if ( guiApp.sub.Bitmap.Image ) wsPutImage( &guiApp.subWindow ); |
23077 | 51 } |
33555 | 52 guiApp.subWindow.State=0; |
23077 | 53 } |
54 | |
33555 | 55 void uiSubMouseHandle( int Button,int X,int Y,int RX,int RY ) |
23077 | 56 { |
57 static int mplSubMoved = 0; | |
58 static int msButton = 0; | |
59 | |
34471 | 60 uiPlaybarShow( Y ); |
23077 | 61 |
62 switch( Button ) | |
63 { | |
64 case wsRRMouseButton: | |
34333 | 65 gtkShow( ivShowPopUpMenu,NULL ); |
23077 | 66 break; |
67 case wsPMMouseButton: | |
34333 | 68 gtkShow( ivHidePopUpMenu,NULL ); |
33555 | 69 uiShowMenu( RX,RY ); |
23077 | 70 msButton=wsPMMouseButton; |
71 break; | |
72 case wsRMMouseButton: | |
33555 | 73 uiHideMenu( RX,RY,1 ); |
23077 | 74 msButton=0; |
75 break; | |
76 // --- | |
77 case wsPLMouseButton: | |
34333 | 78 gtkShow( ivHidePopUpMenu,NULL ); |
23077 | 79 sx=X; sy=Y; |
80 msButton=wsPLMouseButton; | |
81 mplSubMoved=0; | |
82 break; | |
83 case wsMoveMouse: | |
84 switch ( msButton ) | |
85 { | |
86 case wsPLMouseButton: | |
87 mplSubMoved=1; | |
33942
afede91f9d5f
Don't use current x and y position of video window for saving.
ib
parents:
33768
diff
changeset
|
88 if ( !guiApp.subWindow.isFullScreen ) |
afede91f9d5f
Don't use current x and y position of video window for saving.
ib
parents:
33768
diff
changeset
|
89 { |
33993 | 90 wsMoveWindow( &guiApp.subWindow,True,RX - sx,RY - sy ); |
33942
afede91f9d5f
Don't use current x and y position of video window for saving.
ib
parents:
33768
diff
changeset
|
91 guiApp.sub.x = guiApp.subWindow.X; |
afede91f9d5f
Don't use current x and y position of video window for saving.
ib
parents:
33768
diff
changeset
|
92 guiApp.sub.y = guiApp.subWindow.Y; |
afede91f9d5f
Don't use current x and y position of video window for saving.
ib
parents:
33768
diff
changeset
|
93 // NOTE TO MYSELF: dragging the title bar goes unnoticed? |
afede91f9d5f
Don't use current x and y position of video window for saving.
ib
parents:
33768
diff
changeset
|
94 } |
23077 | 95 break; |
96 case wsPMMouseButton: | |
34472 | 97 uiMenuMouseHandle( RX,RY ); |
23077 | 98 break; |
34471 | 99 default: uiPlaybarShow( Y ); break; |
23077 | 100 } |
101 break; | |
102 case wsRLMouseButton: | |
33555 | 103 if ( ( !mplSubMoved )&&( guiApp.subWindow.isFullScreen ) ) |
23077 | 104 { |
33990
3a93b9227b01
Cosmetic: Rename wsMoveTopWindow() wsRaiseWindowTop().
ib
parents:
33942
diff
changeset
|
105 if( subVisible++%2 ) wsRaiseWindowTop( wsDisplay,guiApp.mainWindow.WindowID ); |
3a93b9227b01
Cosmetic: Rename wsMoveTopWindow() wsRaiseWindowTop().
ib
parents:
33942
diff
changeset
|
106 else wsRaiseWindowTop( wsDisplay,guiApp.subWindow.WindowID ); |
23077 | 107 } |
108 msButton=0; | |
109 mplSubMoved=0; | |
110 break; | |
111 } | |
112 } |