annotate Gui/mplayer/mw.h @ 5197:f0e3dcefb7af

Commentting session
author albeu
date Tue, 19 Mar 2002 13:29:28 +0000
parents b3bd4b29a03b
children 25c43bd75e4c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
1
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
2 // main window
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
3
2447
3248aabc6d1d add vcd,dvd,etcsymbol handling
pontscho
parents: 2045
diff changeset
4 #include "../../libmpdemux/stream.h"
3248aabc6d1d add vcd,dvd,etcsymbol handling
pontscho
parents: 2045
diff changeset
5
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
6 unsigned char * mplDrawBuffer = NULL;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
7 int mplMainRender = 1;
2940
1902b7ff9cdc middle menu is working
pontscho
parents: 2902
diff changeset
8
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
9 int mplMainAutoPlay = 0;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
10 int mplMiddleMenu = 0;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
11
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
12 int mainVisible = 1;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
13
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
14 int boxMoved = 0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
15 int sx = 0,sy = 0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
16 int i,pot = 0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
17
3054
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
18 inline void TranslateFilename( int c,char * tmp )
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
19 {
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
20 int i;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
21 switch ( guiIntfStruct.StreamType )
3054
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
22 {
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
23 case STREAMTYPE_FILE:
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
24 if ( ( guiIntfStruct.Filename )&&( guiIntfStruct.Filename[0] ) )
3054
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
25 {
4979
27980a844961 PlayToPause bug with mouse fixed
pontscho
parents: 4974
diff changeset
26 if ( strrchr( guiIntfStruct.Filename,'/' ) ) strcpy( tmp,strrchr( guiIntfStruct.Filename,'/' ) + 1 );
27980a844961 PlayToPause bug with mouse fixed
pontscho
parents: 4974
diff changeset
27 else strcpy( tmp,guiIntfStruct.Filename );
3054
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
28 if ( tmp[strlen( tmp ) - 4] == '.' ) tmp[strlen( tmp ) - 4]=0;
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
29 if ( tmp[strlen( tmp ) - 5] == '.' ) tmp[strlen( tmp ) - 5]=0;
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
30 } else strcpy( tmp,"no file loaded" );
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
31 break;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
32 #ifdef USE_DVDREAD
3054
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
33 case STREAMTYPE_DVD:
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
34 if ( guiIntfStruct.DVD.current_chapter ) sprintf( tmp,"chapter %d",guiIntfStruct.DVD.current_chapter );
3054
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
35 else strcat( tmp,"no chapter" );
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
36 break;
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
37 #endif
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
38 default: strcpy( tmp,"no media opened" );
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
39 }
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
40 if ( c )
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
41 {
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
42 for ( i=0;i < (int)strlen( tmp );i++ )
3054
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
43 {
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
44 int t=0;
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
45 if ( c == 1 ) { if ( ( tmp[i] >= 'A' )&&( tmp[i] <= 'Z' ) ) t=32; }
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
46 if ( c == 2 ) { if ( ( tmp[i] >= 'a' )&&( tmp[i] <= 'z' ) ) t=-32; }
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
47 tmp[i]=(char)( tmp[i] + t );
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
48 }
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
49 }
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
50 }
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
51
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
52 char * Translate( char * str )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
53 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
54 static char trbuf[512];
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
55 char tmp[512];
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
56 int i,c;
2045
deb4aff05c44 fix other bugs
pontscho
parents: 1888
diff changeset
57 int t;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
58 memset( trbuf,0,512 );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
59 memset( tmp,0,128 );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
60 for ( c=0,i=0;i < (int)strlen( str );i++ )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
61 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
62 if ( str[i] != '$' ) { trbuf[c++]=str[i]; trbuf[c]=0; }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
63 else
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
64 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
65 switch ( str[++i] )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
66 {
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
67 case 't': sprintf( tmp,"%02d",guiIntfStruct.Track ); strcat( trbuf,tmp ); break;
3054
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
68 case 'o': TranslateFilename( 0,tmp ); strcat( trbuf,tmp ); break;
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
69 case 'f': TranslateFilename( 1,tmp ); strcat( trbuf,tmp ); break;
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
70 case 'F': TranslateFilename( 2,tmp ); strcat( trbuf,tmp ); break;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
71 case '6': t=guiIntfStruct.LengthInSec; goto calclengthhhmmss;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
72 case '1': t=guiIntfStruct.TimeSec;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
73 calclengthhhmmss:
1888
1f1e98fbf3a7 add new sumbols
pontscho
parents: 1860
diff changeset
74 sprintf( tmp,"%02d:%02d:%02d",t/3600,t/60%60,t%60 ); strcat( trbuf,tmp );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
75 break;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
76 case '7': t=guiIntfStruct.LengthInSec; goto calclengthmmmmss;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
77 case '2': t=guiIntfStruct.TimeSec;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
78 calclengthmmmmss:
1888
1f1e98fbf3a7 add new sumbols
pontscho
parents: 1860
diff changeset
79 sprintf( tmp,"%04d:%02d",t/60,t%60 ); strcat( trbuf,tmp );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
80 break;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
81 case '3': sprintf( tmp,"%02d",guiIntfStruct.TimeSec / 3600 ); strcat( trbuf,tmp ); break;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
82 case '4': sprintf( tmp,"%02d",( ( guiIntfStruct.TimeSec / 60 ) % 60 ) ); strcat( trbuf,tmp ); break;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
83 case '5': sprintf( tmp,"%02d",guiIntfStruct.TimeSec % 60 ); strcat( trbuf,tmp ); break;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
84 case '8': sprintf( tmp,"%01d:%02d:%02d",guiIntfStruct.TimeSec / 3600,( guiIntfStruct.TimeSec / 60 ) % 60,guiIntfStruct.TimeSec % 60 ); strcat( trbuf,tmp ); break;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
85 case 'v': sprintf( tmp,"%3.2f%%",guiIntfStruct.Volume ); strcat( trbuf,tmp ); break;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
86 case 'V': sprintf( tmp,"%3.1f",guiIntfStruct.Volume ); strcat( trbuf,tmp ); break;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
87 case 'b': sprintf( tmp,"%3.2f%%",guiIntfStruct.Balance ); strcat( trbuf,tmp ); break;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
88 case 'B': sprintf( tmp,"%3.1f",guiIntfStruct.Balance ); strcat( trbuf,tmp ); break;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
89 case 'd': sprintf( tmp,"%d",guiIntfStruct.FrameDrop ); strcat( trbuf,tmp ); break;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
90 case 's': if ( guiIntfStruct.Playing == 0 ) strcat( trbuf,"s" ); break;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
91 case 'l': if ( guiIntfStruct.Playing == 1 ) strcat( trbuf,"p" ); break;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
92 case 'e': if ( guiIntfStruct.Playing == 2 ) strcat( trbuf,"e" ); break;
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
93 case 'a':
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
94 switch ( guiIntfStruct.AudioType )
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
95 {
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
96 case 0: strcat( trbuf,"n" ); break;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
97 case 1: strcat( trbuf,"m" ); break;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
98 case 2: strcat( trbuf,"t" ); break;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
99 }
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
100 break;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
101 case 'T':
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
102 switch ( guiIntfStruct.StreamType )
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
103 {
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
104 case STREAMTYPE_FILE: strcat( trbuf,"f" ); break;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
105 case STREAMTYPE_VCD: strcat( trbuf,"v" ); break;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
106 case STREAMTYPE_STREAM: strcat( trbuf,"u" ); break;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
107 #ifdef USE_DVDREAD
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
108 case STREAMTYPE_DVD: strcat( trbuf,"d" ); break;
3054
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
109 #endif
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
110 default: strcat( trbuf," " ); break;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
111 }
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
112 break;
1707
216aae08226c misc fixes/cleanup, Skin path stuff fixed
arpi
parents: 1693
diff changeset
113 case '$': strcat( trbuf,"$" ); break;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
114 default: continue;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
115 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
116 c=strlen( trbuf );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
117 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
118 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
119 return trbuf;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
120 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
121
3054
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
122 inline void PutImage( txSample * bf,int x,int y,int max,int ofs )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
123 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
124 int i=0,ix,iy;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
125 unsigned long * buf = NULL;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
126 unsigned long * drw = NULL;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
127 unsigned long tmp;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
128
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
129 if ( ( !bf )||( bf->Image == NULL ) ) return;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
130
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
131 i=( bf->Width * ( bf->Height / max ) ) * ofs;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
132 buf=(unsigned long *)mplDrawBuffer;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
133 drw=(unsigned long *)bf->Image;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
134
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
135 for ( iy=y;iy < (int)(y+bf->Height / max);iy++ )
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
136 for ( ix=x;ix < (int)(x+bf->Width);ix++ )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
137 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
138 tmp=drw[i++];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
139 if ( tmp != 0x00ff00ff )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
140 buf[ iy*appMPlayer.main.Bitmap.Width+ix ]=tmp;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
141 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
142 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
143
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
144 void mplMainDraw( wsParamDisplay )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
145 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
146 wItem * item;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
147 txSample * image = NULL;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
148 int i;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
149
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
150 if ( appMPlayer.mainWindow.Visible == wsWindowNotVisible ||
1729
d6c99f70449e fix hprogressbar
pontscho
parents: 1723
diff changeset
151 !mainVisible ) return;
d6c99f70449e fix hprogressbar
pontscho
parents: 1723
diff changeset
152 // !appMPlayer.mainWindow.Mapped ) return;
d6c99f70449e fix hprogressbar
pontscho
parents: 1723
diff changeset
153
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
154 btnModify( evSetMoviePosition,guiIntfStruct.Position );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
155 btnModify( evSetVolume,guiIntfStruct.Volume );
1751
d0dbc020f50f fix play -> pause button
pontscho
parents: 1750
diff changeset
156
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
157 if ( mplMainRender )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
158 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
159 memcpy( mplDrawBuffer,appMPlayer.main.Bitmap.Image,appMPlayer.main.Bitmap.ImageSize );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
160 for( i=0;i < appMPlayer.NumberOfItems + 1;i++ )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
161 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
162 item=&appMPlayer.Items[i];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
163 switch( item->type )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
164 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
165 case itButton:
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
166 PutImage( &item->Bitmap,item->x,item->y,3,item->pressed );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
167 break;
1729
d6c99f70449e fix hprogressbar
pontscho
parents: 1723
diff changeset
168 case itPotmeter:
d6c99f70449e fix hprogressbar
pontscho
parents: 1723
diff changeset
169 PutImage( &item->Bitmap,item->x,item->y,item->phases,item->phases * ( item->value / 100.0f ) );
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
170 break;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
171 case itHPotmeter:
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
172 PutImage( &item->Bitmap,item->x,item->y,item->phases,item->phases * ( item->value / 100.0f ) );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
173 PutImage( &item->Mask,item->x + (int)( ( item->width - item->psx ) * item->value / 100.0f ),item->y,3,item->pressed );
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
174 break;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
175 case itSLabel:
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
176 image=fntRender( item->fontid,0,item->width,"%s",item->label );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
177 goto drawrenderedtext;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
178 case itDLabel:
1729
d6c99f70449e fix hprogressbar
pontscho
parents: 1723
diff changeset
179 image=fntRender( item->fontid,mplTimer%item->width,item->width,"%s",Translate( item->label ) );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
180 //// image=fntRender( item->fontid,( mplRedrawTimer / 10 )%item->width,item->width,"%s",Translate( item->label ) );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
181 drawrenderedtext:
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
182 PutImage( image,item->x,item->y,1,0 );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
183 if ( image )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
184 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
185 if ( image->Image ) free( image->Image );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
186 free( image );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
187 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
188 break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
189 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
190 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
191 wsConvert( &appMPlayer.mainWindow,mplDrawBuffer,appMPlayer.main.Bitmap.ImageSize );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
192 mplMainRender=0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
193 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
194 wsPutImage( &appMPlayer.mainWindow );
2854
fd44ecf77f8d move bug meg fileload bug fixed asszem.
pontscho
parents: 2851
diff changeset
195 // XFlush( wsDisplay );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
196 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
197
1723
5e4214a7540e GUI stuff. now seeking works, and xmga renders to video window
arpi
parents: 1707
diff changeset
198 #define IZE(x) printf("@@@ " x " @@@\n");
5e4214a7540e GUI stuff. now seeking works, and xmga renders to video window
arpi
parents: 1707
diff changeset
199
1729
d6c99f70449e fix hprogressbar
pontscho
parents: 1723
diff changeset
200 extern void exit_player(char* how);
3618
772729dd7b40 better dvd support
pontscho
parents: 3597
diff changeset
201 extern int audio_id;
772729dd7b40 better dvd support
pontscho
parents: 3597
diff changeset
202 extern int dvdsub_id;
1729
d6c99f70449e fix hprogressbar
pontscho
parents: 1723
diff changeset
203
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
204 void mplEventHandling( int msg,float param )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
205 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
206 int j;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
207
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
208 switch( msg )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
209 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
210 // --- user events
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
211 case evExit:
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
212 exit_player( "Exit" );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
213 break;
2994
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
214
3054
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
215 #ifdef USE_DVDREAD
2994
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
216 case evPlayDVD:
3618
772729dd7b40 better dvd support
pontscho
parents: 3597
diff changeset
217 dvd_title=1;
772729dd7b40 better dvd support
pontscho
parents: 3597
diff changeset
218 dvd_chapter=1;
772729dd7b40 better dvd support
pontscho
parents: 3597
diff changeset
219 dvd_angle=1;
772729dd7b40 better dvd support
pontscho
parents: 3597
diff changeset
220 play_dvd_2:
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
221 guiIntfStruct.StreamType=STREAMTYPE_DVD;
3054
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
222 #endif
2994
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
223 case evPlay:
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
224 case evPlaySwitchToPause:
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
225 mplMainAutoPlay=0;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
226 if ( ( msg == evPlaySwitchToPause )&( guiIntfStruct.Playing == 1 ) ) goto NoPause;
3618
772729dd7b40 better dvd support
pontscho
parents: 3597
diff changeset
227
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
228 switch ( guiIntfStruct.StreamType )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
229 {
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
230 case STREAMTYPE_STREAM:
2995
f294650ae03b mondom fixed
pontscho
parents: 2994
diff changeset
231 case STREAMTYPE_VCD:
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
232 case STREAMTYPE_FILE:
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
233 dvd_title=0;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
234 break;
3054
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
235 #ifdef USE_DVDREAD
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
236 case STREAMTYPE_DVD:
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
237 guiSetFilename( guiIntfStruct.Filename,"/dev/dvd" );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
238 break;
3054
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
239 #endif
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
240 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
241 mplPlay();
4963
13262bd21965 small changes
pontscho
parents: 4950
diff changeset
242 mplMainRender=1;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
243 break;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
244 #ifdef USE_DVDREAD
3597
fe1283137353 init title change basz.
pontscho
parents: 3499
diff changeset
245 case evSetDVDSubtitle:
3618
772729dd7b40 better dvd support
pontscho
parents: 3597
diff changeset
246 dvdsub_id=(int)param;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
247 dvd_title=guiIntfStruct.DVD.current_title;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
248 dvd_angle=guiIntfStruct.DVD.current_angle;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
249 dvd_chapter=guiIntfStruct.DVD.current_chapter;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
250 guiIntfStruct.DVDChanged=1;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
251 goto play_dvd_2;
3597
fe1283137353 init title change basz.
pontscho
parents: 3499
diff changeset
252 break;
fe1283137353 init title change basz.
pontscho
parents: 3499
diff changeset
253 case evSetDVDAudio:
3618
772729dd7b40 better dvd support
pontscho
parents: 3597
diff changeset
254 audio_id=(int)param;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
255 dvd_title=guiIntfStruct.DVD.current_title;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
256 dvd_angle=guiIntfStruct.DVD.current_angle;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
257 dvd_chapter=guiIntfStruct.DVD.current_chapter;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
258 guiIntfStruct.DVDChanged=1;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
259 goto play_dvd_2;
3597
fe1283137353 init title change basz.
pontscho
parents: 3499
diff changeset
260 break;
fe1283137353 init title change basz.
pontscho
parents: 3499
diff changeset
261 case evSetDVDChapter:
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
262 dvd_title=guiIntfStruct.DVD.current_title;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
263 dvd_angle=guiIntfStruct.DVD.current_angle;
3597
fe1283137353 init title change basz.
pontscho
parents: 3499
diff changeset
264 dvd_chapter=(int)param;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
265 guiIntfStruct.DVDChanged=1;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
266 goto play_dvd_2;
3597
fe1283137353 init title change basz.
pontscho
parents: 3499
diff changeset
267 break;
fe1283137353 init title change basz.
pontscho
parents: 3499
diff changeset
268 case evSetDVDTitle:
fe1283137353 init title change basz.
pontscho
parents: 3499
diff changeset
269 dvd_title=(int)param;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
270 dvd_chapter=1;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
271 dvd_angle=1;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
272 guiIntfStruct.DVDChanged=1;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
273 goto play_dvd_2;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
274 break;
3618
772729dd7b40 better dvd support
pontscho
parents: 3597
diff changeset
275 #endif
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
276
2994
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
277 case evPause:
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
278 case evPauseSwitchToPlay:
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
279 NoPause:
4963
13262bd21965 small changes
pontscho
parents: 4950
diff changeset
280 mplPause();
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
281 mplMainRender=1;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
282 break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
283
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
284 case evStop:
4963
13262bd21965 small changes
pontscho
parents: 4950
diff changeset
285 mplStop();
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
286 mplMainRender=1;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
287 break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
288
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
289 case evLoadPlay:
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
290 mplMainAutoPlay=1;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
291 case evLoad:
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
292 mplMainRender=1;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
293 gtkShow( evLoad,NULL );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
294 break;
3499
93351eec9f1f Add subtitle loader for gui
pontscho
parents: 3075
diff changeset
295 case evLoadSubtitle:
93351eec9f1f Add subtitle loader for gui
pontscho
parents: 3075
diff changeset
296 mplMainRender=1;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
297 gtkShow( evLoadSubtitle,NULL );
3499
93351eec9f1f Add subtitle loader for gui
pontscho
parents: 3075
diff changeset
298 break;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
299 case evPrev:
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
300 mplMainRender=1;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
301 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[mw.h] previous stream ...\n" );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
302 break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
303 case evNext:
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
304 mplMainRender=1;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
305 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[mw.h] next stream ...\n" );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
306 break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
307
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
308 case evPlayList:
1723
5e4214a7540e GUI stuff. now seeking works, and xmga renders to video window
arpi
parents: 1707
diff changeset
309 IZE("evPlayList");
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
310 mplMainRender=1;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
311 gtkShow( evPlayList,NULL );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
312 #warning disabled old gtk code
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
313 #if 0
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
314 if ( gtkVisiblePlayList )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
315 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
316 btnModify( evPlayList,btnReleased );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
317 gtkShMem->vs.window=evPlayList;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
318 gtkSendMessage( evHideWindow );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
319 gtkVisiblePlayList=0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
320 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
321 else
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
322 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
323 gtkSendMessage( evPlayList );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
324 btnModify( evPlayList,btnPressed );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
325 gtkVisiblePlayList=1;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
326 }
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
327 #endif
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
328 break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
329
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
330 case evSkinBrowser: gtkShow( evSkinBrowser,skinName ); break;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
331 case evAbout: gtkShow( evAbout,NULL ); break;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
332 case evPreferences: gtkShow( evPreferences,NULL ); break;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
333
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
334 case evForward1min: mplRelSeek( 60 ); break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
335 case evBackward1min: mplRelSeek( -60 ); break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
336 case evForward10sec: mplRelSeek( 10 ); break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
337 case evBackward10sec: mplRelSeek( -10 ); break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
338 case evSetMoviePosition: mplAbsSeek( param ); break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
339
1860
c65abbc91c5c fix mwm bug's. faszom (C), and remove mixer.*
pontscho
parents: 1848
diff changeset
340 case evIncVolume: vo_x11_putkey( wsGrayMul ); break;
c65abbc91c5c fix mwm bug's. faszom (C), and remove mixer.*
pontscho
parents: 1848
diff changeset
341 case evDecVolume: vo_x11_putkey( wsGrayDiv ); break;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
342 case evMute: guiIntfStruct.Mute=1; break;
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
343 case evSetVolume:
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
344 case evSetBalance: guiIntfStruct.VolumeChanged=1; break;
1847
773ae4ba43f5 add voluechanged
pontscho
parents: 1845
diff changeset
345
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
346
2994
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
347 case evIconify:
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
348 switch ( (int)param )
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
349 {
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
350 case 0: wsIconify( appMPlayer.mainWindow ); break;
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
351 case 1: wsIconify( appMPlayer.subWindow ); break;
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
352 }
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
353 break;
1765
29913c011d50 normal size
pontscho
parents: 1751
diff changeset
354 case evNormalSize:
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
355 if ( guiIntfStruct.Playing )
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
356 {
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
357 appMPlayer.subWindow.isFullScreen=True;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
358 appMPlayer.subWindow.OldX=( wsMaxX - guiIntfStruct.MovieWidth ) / 2;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
359 appMPlayer.subWindow.OldY=( wsMaxY - guiIntfStruct.MovieHeight ) / 2;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
360 appMPlayer.subWindow.OldWidth=guiIntfStruct.MovieWidth; appMPlayer.subWindow.OldHeight=guiIntfStruct.MovieHeight;
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
361 wsFullScreen( &appMPlayer.subWindow );
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
362 }
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
363 break;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
364 case evDoubleSize:
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
365 if ( guiIntfStruct.Playing )
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
366 {
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
367 appMPlayer.subWindow.isFullScreen=True;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
368 appMPlayer.subWindow.OldX=( wsMaxX - guiIntfStruct.MovieWidth * 2 ) / 2;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
369 appMPlayer.subWindow.OldY=( wsMaxY - guiIntfStruct.MovieHeight * 2 ) / 2;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
370 appMPlayer.subWindow.OldWidth=guiIntfStruct.MovieWidth * 2; appMPlayer.subWindow.OldHeight=guiIntfStruct.MovieHeight * 2;
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
371 wsFullScreen( &appMPlayer.subWindow );
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
372 }
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
373 break;
2994
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
374 case evFullScreen:
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
375 for ( j=0;j<appMPlayer.NumberOfItems + 1;j++ )
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
376 {
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
377 if ( appMPlayer.Items[j].msg == evFullScreen )
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
378 {
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
379 appMPlayer.Items[j].tmp=!appMPlayer.Items[j].tmp;
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
380 appMPlayer.Items[j].pressed=appMPlayer.Items[j].tmp;
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
381 }
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
382 }
4981
bfc652fc7f43 rewrite fullscreen support in some libvo driver
pontscho
parents: 4979
diff changeset
383 mplFullScreen();
2994
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
384 mplMainRender=1;
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
385 break;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
386
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
387 // --- timer events
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
388 case evHideMouseCursor:
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
389 wsVisibleMouse( &appMPlayer.subWindow,wsHideMouseCursor );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
390 break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
391 case evRedraw:
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
392 mplMainRender=1;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
393 wsPostRedisplay( &appMPlayer.mainWindow );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
394 XFlush( wsDisplay );
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
395 mplRedrawTimer=mplRedrawTimerConst;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
396 break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
397 // --- system events
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
398 case evNone:
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
399 mp_msg( MSGT_GPLAYER,MSGL_STATUS,"[mw] event none received.\n" );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
400 break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
401 default:
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
402 mp_msg( MSGT_GPLAYER,MSGL_STATUS,"[mw] unknown event received ( %d,%.2f ).\n",msg,param );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
403 break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
404 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
405 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
406
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
407 #define itPLMButton (itNULL - 1)
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
408 #define itPRMButton (itNULL - 2)
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
409
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
410 void mplMainMouseHandle( int Button,int X,int Y,int RX,int RY )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
411 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
412 static int itemtype = 0;
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
413 int i;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
414 wItem * item = NULL;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
415 float value = 0.0f;
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
416
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
417 static int SelectedItem = -1;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
418 int currentselected = -1;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
419
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
420 wsVisibleMouse( &appMPlayer.subWindow,wsShowMouseCursor );
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
421
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
422 for ( i=0;i < appMPlayer.NumberOfItems + 1;i++ )
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
423 if ( ( appMPlayer.Items[i].pressed != btnDisabled )&&
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
424 ( wgIsRect( X,Y,appMPlayer.Items[i].x,appMPlayer.Items[i].y,appMPlayer.Items[i].x+appMPlayer.Items[i].width,appMPlayer.Items[i].y+appMPlayer.Items[i].height ) ) )
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
425 { currentselected=i; break; }
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
426
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
427 switch ( Button )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
428 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
429 case wsPRMouseButton:
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
430 mplShowMenu( RX,RY );
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
431 itemtype=itPRMButton;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
432 break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
433 case wsRRMouseButton:
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
434 mplHideMenu( RX,RY );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
435 break;
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
436
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
437 case wsPLMouseButton:
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
438 sx=X; sy=Y; boxMoved=1; itemtype=itPLMButton; // if move the main window
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
439 SelectedItem=currentselected;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
440 if ( SelectedItem == -1 ) break; // yeees, i'm move the fucking window
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
441 boxMoved=0; mplMainRender=1; // No, not move the window, i'm pressed one button
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
442 item=&appMPlayer.Items[SelectedItem];
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
443 itemtype=item->type;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
444 item->pressed=btnPressed;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
445 item->used=1;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
446 switch( item->type )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
447 {
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
448 case itButton:
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
449 if ( ( SelectedItem > -1 ) &&
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
450 ( ( ( appMPlayer.Items[SelectedItem].msg == evPlaySwitchToPause && item->msg == evPauseSwitchToPlay ) ) ||
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
451 ( ( appMPlayer.Items[SelectedItem].msg == evPauseSwitchToPlay && item->msg == evPlaySwitchToPause ) ) ) )
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
452 { appMPlayer.Items[SelectedItem].pressed=btnDisabled; }
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
453 break;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
454 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
455 break;
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
456 case wsRLMouseButton:
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
457 boxMoved=0;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
458 item=&appMPlayer.Items[SelectedItem];
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
459 item->pressed=btnReleased;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
460 SelectedItem=-1;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
461 if ( currentselected == - 1 ) { itemtype=0; break; }
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
462 value=0;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
463 switch( itemtype )
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
464 {
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
465 case itPotmeter:
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
466 case itHPotmeter:
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
467 item->used=0;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
468 btnModify( item->msg,(float)( X - item->x ) / item->width * 100.0f );
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
469 switch ( item->msg )
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
470 {
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
471 case evSetVolume:
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
472 guiIntfStruct.VolumeChanged=1;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
473 guiIntfStruct.Volume=item->value;
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
474 break;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
475 }
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
476 value=item->value;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
477 break;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
478 }
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
479 mplEventHandling( item->msg,value );
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
480 mplMainRender=1;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
481 itemtype=0;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
482 break;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
483
2902
d47cbcdce1a8 rewrite some header meg jol csinaltam menu -t koepso gombra gonosz mod ( bocs, tom, nem angol).
pontscho
parents: 2854
diff changeset
484 case wsPMMouseButton:
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
485 gtkShow( evShowPopUpMenu,NULL );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
486 break;
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
487
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
488 // --- rolled mouse ... de szar :)))
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
489 case wsP5MouseButton: value=-2.5f; goto rollerhandled;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
490 case wsP4MouseButton: value= 2.5f;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
491 rollerhandled:
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
492 item=&appMPlayer.Items[currentselected];
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
493 if ( ( item->type == itHPotmeter )||( item->type == itVPotmeter )||( item->type == itPotmeter ) )
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
494 {
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
495 item->used=0;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
496 item->value+=value;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
497 btnModify( item->msg,item->value );
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
498 switch ( item->msg )
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
499 {
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
500 case evSetVolume:
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
501 guiIntfStruct.VolumeChanged=1;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
502 guiIntfStruct.Volume=item->value;
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
503 break;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
504 }
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
505 mplEventHandling( item->msg,item->value );
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
506 mplMainRender=1;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
507 }
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
508 break;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
509
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
510 // --- moving
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
511 case wsMoveMouse:
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
512 item=&appMPlayer.Items[SelectedItem];
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
513 switch ( itemtype )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
514 {
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
515 case itPLMButton:
2854
fd44ecf77f8d move bug meg fileload bug fixed asszem.
pontscho
parents: 2851
diff changeset
516 wsMoveWindow( &appMPlayer.mainWindow,False,RX - abs( sx ),RY - abs( sy ) );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
517 mplMainRender=0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
518 break;
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
519 case itPRMButton:
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
520 mplMenuMouseHandle( X,Y,RX,RY );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
521 break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
522 case itPotmeter:
1729
d6c99f70449e fix hprogressbar
pontscho
parents: 1723
diff changeset
523 item->value=(float)( X - item->x ) / item->width * 100.0f;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
524 goto potihandled;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
525 case itHPotmeter:
1729
d6c99f70449e fix hprogressbar
pontscho
parents: 1723
diff changeset
526 item->value=(float)( X - item->x ) / item->width * 100.0f;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
527 potihandled:
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
528 if ( item->value > 100.0f ) item->value=100.0f;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
529 if ( item->value < 0.0f ) item->value=0.0f;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
530 switch ( item->msg )
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
531 {
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
532 case evSetVolume:
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
533 guiIntfStruct.VolumeChanged=1;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
534 guiIntfStruct.Volume=item->value;
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
535 break;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
536 }
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
537 mplEventHandling( item->msg,item->value );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
538 mplMainRender=1; wsPostRedisplay( &appMPlayer.mainWindow );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
539 break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
540 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
541 break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
542 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
543 if ( Button != wsMoveMouse ) wsPostRedisplay( &appMPlayer.mainWindow );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
544 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
545
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
546 int keyPressed = 0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
547
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
548 void mplMainKeyHandle( int State,int Type,int Key )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
549 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
550 int msg = evNone;
4950
307a94037c5c bazmeg a playtree - t
pontscho
parents: 4858
diff changeset
551
4409
61e53100353e add XF86 multimedia key cucc.
pontscho
parents: 4061
diff changeset
552 if ( Type != wsKeyPressed ) return;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
553 switch ( Key )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
554 {
4963
13262bd21965 small changes
pontscho
parents: 4950
diff changeset
555 case wsEnter: msg=evPlay; break;
4858
65730cea02e7 add half new input support for gui
pontscho
parents: 4818
diff changeset
556 #ifndef HAVE_NEW_INPUT
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
557 case '.':
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
558 case '>': msg=evNext; break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
559 case ',':
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
560 case '<': msg=evPrev; break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
561
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
562 case wsEscape: msg=evExit; break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
563
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
564 case wsSpace: msg=evPause; break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
565 case wsa:
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
566 case wsA: msg=evAbout; break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
567 case wsb:
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
568 case wsB: msg=evSkinBrowser; break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
569 case wse:
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
570 case wsE: msg=evEqualeaser; break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
571 case wsf:
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
572 case wsF: msg=evFullScreen; break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
573 case wsl:
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
574 case wsL: msg=evLoad; break;
3499
93351eec9f1f Add subtitle loader for gui
pontscho
parents: 3075
diff changeset
575 case wsu:
93351eec9f1f Add subtitle loader for gui
pontscho
parents: 3075
diff changeset
576 case wsU: msg=evLoadSubtitle; break;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
577 case wsm:
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
578 case wsM: msg=evMute; break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
579 case wss:
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
580 case wsS: msg=evStop; break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
581 case wsp:
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
582 case wsP: msg=evPlayList; break;
4858
65730cea02e7 add half new input support for gui
pontscho
parents: 4818
diff changeset
583 #endif
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
584
4409
61e53100353e add XF86 multimedia key cucc.
pontscho
parents: 4061
diff changeset
585 case wsXF86LowerVolume: msg=evDecVolume; break;
61e53100353e add XF86 multimedia key cucc.
pontscho
parents: 4061
diff changeset
586 case wsXF86RaiseVolume: msg=evIncVolume; break;
61e53100353e add XF86 multimedia key cucc.
pontscho
parents: 4061
diff changeset
587 case wsXF86Mute: msg=evMute; break;
61e53100353e add XF86 multimedia key cucc.
pontscho
parents: 4061
diff changeset
588 case wsXF86Play: msg=evPlaySwitchToPause; break;
61e53100353e add XF86 multimedia key cucc.
pontscho
parents: 4061
diff changeset
589 case wsXF86Stop: msg=evStop; break;
61e53100353e add XF86 multimedia key cucc.
pontscho
parents: 4061
diff changeset
590 case wsXF86Prev: msg=evPrev; break;
61e53100353e add XF86 multimedia key cucc.
pontscho
parents: 4061
diff changeset
591 case wsXF86Next: msg=evNext; break;
61e53100353e add XF86 multimedia key cucc.
pontscho
parents: 4061
diff changeset
592 case wsXF86Media: msg=evLoad; break;
61e53100353e add XF86 multimedia key cucc.
pontscho
parents: 4061
diff changeset
593
61e53100353e add XF86 multimedia key cucc.
pontscho
parents: 4061
diff changeset
594 default: vo_x11_putkey( Key ); return;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
595 }
4858
65730cea02e7 add half new input support for gui
pontscho
parents: 4818
diff changeset
596 if ( msg != evNone ) mplEventHandling( msg,0 );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
597 }