annotate Gui/mplayer/mw.h @ 4598:badb76094897

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