annotate Gui/mplayer/mw.h @ 7092:8e9607c5897e

- warning fixes from Dominik Mierzejewski <dominik@rangers.eu.org> - wsXDNDProcessSelection return Truae fix - add url list saving support from Morten Volden <mvolden@tdcadsl.dk> - fix bug's in this patches - fix some memleak and bug
author pontscho
date Mon, 26 Aug 2002 22:20:58 +0000
parents 98bed9e12087
children b65b78640d49
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"
6311
da2dda48b7ec add mute support ( step 1 ) and fixed panscan bugs (1000l for me)
pontscho
parents: 6298
diff changeset
5 #include "../../mixer.h"
6619
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
6 #include "../../libvo/sub.h"
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
7 #include "../../mplayer.h"
2447
3248aabc6d1d add vcd,dvd,etcsymbol handling
pontscho
parents: 2045
diff changeset
8
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
9 unsigned char * mplDrawBuffer = NULL;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
10 int mplMainRender = 1;
2940
1902b7ff9cdc middle menu is working
pontscho
parents: 2902
diff changeset
11
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
12 int mplMainAutoPlay = 0;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
13 int mplMiddleMenu = 0;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
14
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
15 int mainVisible = 1;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
16
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
17 int boxMoved = 0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
18 int sx = 0,sy = 0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
19 int i,pot = 0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
20
3054
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
21 inline void TranslateFilename( int c,char * tmp )
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 int i;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
24 switch ( guiIntfStruct.StreamType )
3054
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
25 {
6298
d42cb911d7f7 add network streaming support for gui
pontscho
parents: 6280
diff changeset
26 case STREAMTYPE_STREAM:
d42cb911d7f7 add network streaming support for gui
pontscho
parents: 6280
diff changeset
27 strcpy( tmp,guiIntfStruct.Filename );
d42cb911d7f7 add network streaming support for gui
pontscho
parents: 6280
diff changeset
28 break;
3054
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
29 case STREAMTYPE_FILE:
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
30 if ( ( guiIntfStruct.Filename )&&( guiIntfStruct.Filename[0] ) )
3054
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
31 {
4979
27980a844961 PlayToPause bug with mouse fixed
pontscho
parents: 4974
diff changeset
32 if ( strrchr( guiIntfStruct.Filename,'/' ) ) strcpy( tmp,strrchr( guiIntfStruct.Filename,'/' ) + 1 );
27980a844961 PlayToPause bug with mouse fixed
pontscho
parents: 4974
diff changeset
33 else strcpy( tmp,guiIntfStruct.Filename );
3054
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
34 if ( tmp[strlen( tmp ) - 4] == '.' ) tmp[strlen( tmp ) - 4]=0;
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
35 if ( tmp[strlen( tmp ) - 5] == '.' ) tmp[strlen( tmp ) - 5]=0;
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
36 } else strcpy( tmp,"no file loaded" );
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
37 break;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
38 #ifdef USE_DVDREAD
3054
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
39 case STREAMTYPE_DVD:
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
40 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
41 else strcat( tmp,"no chapter" );
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
42 break;
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
43 #endif
6280
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
44 #ifdef HAVE_VCD
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
45 case STREAMTYPE_VCD:
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
46 sprintf( tmp,"VCD track %d",guiIntfStruct.Track );
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
47 break;
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
48 #endif
3054
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
49 default: strcpy( tmp,"no media opened" );
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 if ( c )
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
52 {
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
53 for ( i=0;i < (int)strlen( tmp );i++ )
3054
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
54 {
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
55 int t=0;
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
56 if ( c == 1 ) { if ( ( tmp[i] >= 'A' )&&( tmp[i] <= 'Z' ) ) t=32; }
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
57 if ( c == 2 ) { if ( ( tmp[i] >= 'a' )&&( tmp[i] <= 'z' ) ) t=-32; }
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
58 tmp[i]=(char)( tmp[i] + t );
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
59 }
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
60 }
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
61 }
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
62
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
63 char * Translate( char * str )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
64 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
65 static char trbuf[512];
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
66 char tmp[512];
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
67 int i,c;
2045
deb4aff05c44 fix other bugs
pontscho
parents: 1888
diff changeset
68 int t;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
69 memset( trbuf,0,512 );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
70 memset( tmp,0,128 );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
71 for ( c=0,i=0;i < (int)strlen( str );i++ )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
72 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
73 if ( str[i] != '$' ) { trbuf[c++]=str[i]; trbuf[c]=0; }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
74 else
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
75 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
76 switch ( str[++i] )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
77 {
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
78 case 't': sprintf( tmp,"%02d",guiIntfStruct.Track ); strcat( trbuf,tmp ); break;
3054
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
79 case 'o': TranslateFilename( 0,tmp ); strcat( trbuf,tmp ); break;
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
80 case 'f': TranslateFilename( 1,tmp ); strcat( trbuf,tmp ); break;
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
81 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
82 case '6': t=guiIntfStruct.LengthInSec; goto calclengthhhmmss;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
83 case '1': t=guiIntfStruct.TimeSec;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
84 calclengthhhmmss:
1888
1f1e98fbf3a7 add new sumbols
pontscho
parents: 1860
diff changeset
85 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
86 break;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
87 case '7': t=guiIntfStruct.LengthInSec; goto calclengthmmmmss;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
88 case '2': t=guiIntfStruct.TimeSec;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
89 calclengthmmmmss:
1888
1f1e98fbf3a7 add new sumbols
pontscho
parents: 1860
diff changeset
90 sprintf( tmp,"%04d:%02d",t/60,t%60 ); strcat( trbuf,tmp );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
91 break;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
92 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
93 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
94 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
95 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
96 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
97 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
98 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
99 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
100 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
101 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
102 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
103 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
104 case 'a':
6619
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
105 if ( muted ) { strcat( trbuf,"n" ); break; }
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
106 switch ( guiIntfStruct.AudioType )
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
107 {
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
108 case 0: strcat( trbuf,"n" ); break;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
109 case 1: strcat( trbuf,"m" ); break;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
110 case 2: strcat( trbuf,"t" ); 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;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
113 case 'T':
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
114 switch ( guiIntfStruct.StreamType )
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
115 {
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
116 case STREAMTYPE_FILE: strcat( trbuf,"f" ); break;
6280
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
117 #ifdef HAVE_VCD
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
118 case STREAMTYPE_VCD: strcat( trbuf,"v" ); break;
6280
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
119 #endif
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
120 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
121 #ifdef USE_DVDREAD
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
122 case STREAMTYPE_DVD: strcat( trbuf,"d" ); break;
3054
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
123 #endif
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
124 default: strcat( trbuf," " ); break;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
125 }
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
126 break;
1707
216aae08226c misc fixes/cleanup, Skin path stuff fixed
arpi
parents: 1693
diff changeset
127 case '$': strcat( trbuf,"$" ); break;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
128 default: continue;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
129 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
130 c=strlen( trbuf );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
131 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
132 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
133 return trbuf;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
134 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
135
3054
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
136 inline void PutImage( txSample * bf,int x,int y,int max,int ofs )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
137 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
138 int i=0,ix,iy;
6159
dcf195b784bf applied 64bit patch from Ulrich Hecht <uli@suse.de>
pontscho
parents: 6145
diff changeset
139 uint32_t * buf = NULL;
dcf195b784bf applied 64bit patch from Ulrich Hecht <uli@suse.de>
pontscho
parents: 6145
diff changeset
140 uint32_t * drw = NULL;
dcf195b784bf applied 64bit patch from Ulrich Hecht <uli@suse.de>
pontscho
parents: 6145
diff changeset
141 uint32_t tmp;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
142
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
143 if ( ( !bf )||( bf->Image == NULL ) ) return;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
144
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
145 i=( bf->Width * ( bf->Height / max ) ) * ofs;
6159
dcf195b784bf applied 64bit patch from Ulrich Hecht <uli@suse.de>
pontscho
parents: 6145
diff changeset
146 buf=(uint32_t *)mplDrawBuffer;
dcf195b784bf applied 64bit patch from Ulrich Hecht <uli@suse.de>
pontscho
parents: 6145
diff changeset
147 drw=(uint32_t *)bf->Image;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
148
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
149 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
150 for ( ix=x;ix < (int)(x+bf->Width);ix++ )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
151 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
152 tmp=drw[i++];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
153 if ( tmp != 0x00ff00ff )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
154 buf[ iy*appMPlayer.main.Bitmap.Width+ix ]=tmp;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
155 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
156 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
157
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
158 void mplMainDraw( wsParamDisplay )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
159 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
160 wItem * item;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
161 txSample * image = NULL;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
162 int i;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
163
6043
421781c5b128 fix some small bug and -rootwin
pontscho
parents: 5919
diff changeset
164 if ( appMPlayer.mainWindow.State == wsWindowClosed ) exit_player( MSGTR_Exit_quit );
421781c5b128 fix some small bug and -rootwin
pontscho
parents: 5919
diff changeset
165
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
166 if ( appMPlayer.mainWindow.Visible == wsWindowNotVisible ||
1729
d6c99f70449e fix hprogressbar
pontscho
parents: 1723
diff changeset
167 !mainVisible ) return;
d6c99f70449e fix hprogressbar
pontscho
parents: 1723
diff changeset
168 // !appMPlayer.mainWindow.Mapped ) return;
d6c99f70449e fix hprogressbar
pontscho
parents: 1723
diff changeset
169
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
170 btnModify( evSetMoviePosition,guiIntfStruct.Position );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
171 btnModify( evSetVolume,guiIntfStruct.Volume );
1751
d0dbc020f50f fix play -> pause button
pontscho
parents: 1750
diff changeset
172
6794
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6755
diff changeset
173 if ( mplMainRender && appMPlayer.mainWindow.State == wsWindowExpose )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
174 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
175 memcpy( mplDrawBuffer,appMPlayer.main.Bitmap.Image,appMPlayer.main.Bitmap.ImageSize );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
176 for( i=0;i < appMPlayer.NumberOfItems + 1;i++ )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
177 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
178 item=&appMPlayer.Items[i];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
179 switch( item->type )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
180 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
181 case itButton:
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
182 PutImage( &item->Bitmap,item->x,item->y,3,item->pressed );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
183 break;
1729
d6c99f70449e fix hprogressbar
pontscho
parents: 1723
diff changeset
184 case itPotmeter:
5919
60cf2bca993f some bug fix
pontscho
parents: 5689
diff changeset
185 PutImage( &item->Bitmap,item->x,item->y,item->phases,( item->phases - 1 ) * ( item->value / 100.0f ) );
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
186 break;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
187 case itHPotmeter:
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
188 PutImage( &item->Bitmap,item->x,item->y,item->phases,item->phases * ( item->value / 100.0f ) );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
189 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
190 break;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
191 case itSLabel:
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
192 image=fntRender( item->fontid,0,item->width,"%s",item->label );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
193 goto drawrenderedtext;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
194 case itDLabel:
6755
a31b9f15cbff - fix audio equalizer
pontscho
parents: 6713
diff changeset
195 {
a31b9f15cbff - fix audio equalizer
pontscho
parents: 6713
diff changeset
196 char * t = Translate( item->label );
a31b9f15cbff - fix audio equalizer
pontscho
parents: 6713
diff changeset
197 int l = fntTextWidth( item->fontid,t );
a31b9f15cbff - fix audio equalizer
pontscho
parents: 6713
diff changeset
198 image=fntRender( item->fontid,mplTimer%(l?l:item->width),item->width,"%s",t );
a31b9f15cbff - fix audio equalizer
pontscho
parents: 6713
diff changeset
199 }
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
200 drawrenderedtext:
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
201 if ( image )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
202 {
5919
60cf2bca993f some bug fix
pontscho
parents: 5689
diff changeset
203 PutImage( image,item->x,item->y,1,0 );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
204 if ( image->Image ) free( image->Image );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
205 free( image );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
206 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
207 break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
208 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
209 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
210 wsConvert( &appMPlayer.mainWindow,mplDrawBuffer,appMPlayer.main.Bitmap.ImageSize );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
211 mplMainRender=0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
212 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
213 wsPutImage( &appMPlayer.mainWindow );
2854
fd44ecf77f8d move bug meg fileload bug fixed asszem.
pontscho
parents: 2851
diff changeset
214 // XFlush( wsDisplay );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
215 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
216
1729
d6c99f70449e fix hprogressbar
pontscho
parents: 1723
diff changeset
217 extern void exit_player(char* how);
3618
772729dd7b40 better dvd support
pontscho
parents: 3597
diff changeset
218 extern int audio_id;
772729dd7b40 better dvd support
pontscho
parents: 3597
diff changeset
219 extern int dvdsub_id;
5665
3e7f39c4110c fix dvd playing under gui
pontscho
parents: 5651
diff changeset
220 extern char * dvd_device;
6280
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
221 extern int vcd_track;
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
222 extern char * cdrom_device;
6619
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
223 extern int osd_visible;
1729
d6c99f70449e fix hprogressbar
pontscho
parents: 1723
diff changeset
224
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
225 void mplEventHandling( int msg,float param )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
226 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
227 int j;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
228
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
229 switch( msg )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
230 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
231 // --- user events
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
232 case evExit:
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
233 exit_player( "Exit" );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
234 break;
2994
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
235
6298
d42cb911d7f7 add network streaming support for gui
pontscho
parents: 6280
diff changeset
236 case evPlayNetwork:
6794
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6755
diff changeset
237 if ( guiIntfStruct.Subtitlename ) { free( guiIntfStruct.Subtitlename ); guiIntfStruct.Subtitlename=NULL; }
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6755
diff changeset
238 if ( guiIntfStruct.AudioFile ) { free( guiIntfStruct.AudioFile ); guiIntfStruct.AudioFile=NULL; }
6298
d42cb911d7f7 add network streaming support for gui
pontscho
parents: 6280
diff changeset
239 guiIntfStruct.StreamType=STREAMTYPE_STREAM;
d42cb911d7f7 add network streaming support for gui
pontscho
parents: 6280
diff changeset
240 goto play;
d42cb911d7f7 add network streaming support for gui
pontscho
parents: 6280
diff changeset
241 case evSetURL:
d42cb911d7f7 add network streaming support for gui
pontscho
parents: 6280
diff changeset
242 gtkShow( evPlayNetwork,NULL );
d42cb911d7f7 add network streaming support for gui
pontscho
parents: 6280
diff changeset
243 break;
d42cb911d7f7 add network streaming support for gui
pontscho
parents: 6280
diff changeset
244
6280
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
245 #ifdef HAVE_VCD
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
246 case evSetVCDTrack:
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
247 guiIntfStruct.Track=(int)param;
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
248 case evPlayVCD:
7009
98bed9e12087 - add dxr3 gui support (dialogbox, etc.)
pontscho
parents: 6996
diff changeset
249 gtkSet( gtkClearStruct,0,(void *)guiALL );
6280
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
250 guiIntfStruct.StreamType=STREAMTYPE_VCD;
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
251 goto play;
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
252 #endif
3054
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
253 #ifdef USE_DVDREAD
2994
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
254 case evPlayDVD:
5665
3e7f39c4110c fix dvd playing under gui
pontscho
parents: 5651
diff changeset
255 guiIntfStruct.DVD.current_title=1;
3e7f39c4110c fix dvd playing under gui
pontscho
parents: 5651
diff changeset
256 guiIntfStruct.DVD.current_chapter=1;
3e7f39c4110c fix dvd playing under gui
pontscho
parents: 5651
diff changeset
257 guiIntfStruct.DVD.current_angle=1;
3618
772729dd7b40 better dvd support
pontscho
parents: 3597
diff changeset
258 play_dvd_2:
7009
98bed9e12087 - add dxr3 gui support (dialogbox, etc.)
pontscho
parents: 6996
diff changeset
259 gtkSet( gtkClearStruct,0,(void *)(guiALL - guiDVD) );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
260 guiIntfStruct.StreamType=STREAMTYPE_DVD;
3054
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
261 #endif
2994
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
262 case evPlay:
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
263 case evPlaySwitchToPause:
6280
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
264 play:
6713
cc917a581b6e add simple playlist support
pontscho
parents: 6651
diff changeset
265
6794
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6755
diff changeset
266 if ( ( msg == evPlaySwitchToPause )&&( guiIntfStruct.Playing == 2 ) ) goto NoPause;
3618
772729dd7b40 better dvd support
pontscho
parents: 3597
diff changeset
267
6280
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
268 vcd_track=0;
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
269 dvd_title=0;
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
270
6905
e32d3d0d8998 - fix playlist2dvd bug
pontscho
parents: 6903
diff changeset
271 if ( gtkSet( gtkGetCurrPlItem,0,NULL ) &&( guiIntfStruct.StreamType == STREAMTYPE_FILE ) )
6713
cc917a581b6e add simple playlist support
pontscho
parents: 6651
diff changeset
272 {
cc917a581b6e add simple playlist support
pontscho
parents: 6651
diff changeset
273 plItem * next = gtkSet( gtkGetCurrPlItem,0,NULL );
cc917a581b6e add simple playlist support
pontscho
parents: 6651
diff changeset
274 plLastPlayed=next;
cc917a581b6e add simple playlist support
pontscho
parents: 6651
diff changeset
275 guiSetDF( guiIntfStruct.Filename,next->path,next->name );
cc917a581b6e add simple playlist support
pontscho
parents: 6651
diff changeset
276 guiIntfStruct.StreamType=STREAMTYPE_FILE;
cc917a581b6e add simple playlist support
pontscho
parents: 6651
diff changeset
277 guiIntfStruct.FilenameChanged=1;
6794
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6755
diff changeset
278 gfree( (void **)&guiIntfStruct.AudioFile );
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6755
diff changeset
279 gfree( (void **)&guiIntfStruct.Subtitlename );
6713
cc917a581b6e add simple playlist support
pontscho
parents: 6651
diff changeset
280 }
cc917a581b6e add simple playlist support
pontscho
parents: 6651
diff changeset
281
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
282 switch ( guiIntfStruct.StreamType )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
283 {
6298
d42cb911d7f7 add network streaming support for gui
pontscho
parents: 6280
diff changeset
284 case STREAMTYPE_STREAM:
6280
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
285 case STREAMTYPE_FILE:
7009
98bed9e12087 - add dxr3 gui support (dialogbox, etc.)
pontscho
parents: 6996
diff changeset
286 gtkSet( gtkClearStruct,0,(void *)(guiALL - guiFilenames) );
6280
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
287 break;
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
288 #ifdef HAVE_VCD
2995
f294650ae03b mondom fixed
pontscho
parents: 2994
diff changeset
289 case STREAMTYPE_VCD:
7009
98bed9e12087 - add dxr3 gui support (dialogbox, etc.)
pontscho
parents: 6996
diff changeset
290 gtkSet( gtkClearStruct,0,(void *)(guiALL - guiVCD - guiFilenames) );
98bed9e12087 - add dxr3 gui support (dialogbox, etc.)
pontscho
parents: 6996
diff changeset
291 if ( !cdrom_device ) cdrom_device=DEFAULT_CDROM_DEVICE;
98bed9e12087 - add dxr3 gui support (dialogbox, etc.)
pontscho
parents: 6996
diff changeset
292 mplSetFileName( NULL,cdrom_device,STREAMTYPE_VCD );
6280
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
293 if ( guiIntfStruct.Playing != 2 )
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
294 {
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
295 if ( !guiIntfStruct.Track )
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
296 {
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
297 if ( guiIntfStruct.VCDTracks == 1 ) guiIntfStruct.Track=1;
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
298 else guiIntfStruct.Track=2;
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
299 }
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
300 vcd_track=guiIntfStruct.Track;
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
301 guiIntfStruct.DiskChanged=1;
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
302 }
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
303 break;
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
304 #endif
3054
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
305 #ifdef USE_DVDREAD
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
306 case STREAMTYPE_DVD:
7009
98bed9e12087 - add dxr3 gui support (dialogbox, etc.)
pontscho
parents: 6996
diff changeset
307 gtkSet( gtkClearStruct,0,(void *)(guiALL - guiDVD - guiFilenames) );
98bed9e12087 - add dxr3 gui support (dialogbox, etc.)
pontscho
parents: 6996
diff changeset
308 if ( !dvd_device ) dvd_device=DEFAULT_DVD_DEVICE;
98bed9e12087 - add dxr3 gui support (dialogbox, etc.)
pontscho
parents: 6996
diff changeset
309 mplSetFileName( NULL,dvd_device,STREAMTYPE_DVD );
5667
fd0a2f189e80 fix dvd pause. 10l
pontscho
parents: 5665
diff changeset
310 if ( guiIntfStruct.Playing != 2 )
fd0a2f189e80 fix dvd pause. 10l
pontscho
parents: 5665
diff changeset
311 {
fd0a2f189e80 fix dvd pause. 10l
pontscho
parents: 5665
diff changeset
312 dvd_title=guiIntfStruct.DVD.current_title;
fd0a2f189e80 fix dvd pause. 10l
pontscho
parents: 5665
diff changeset
313 dvd_angle=guiIntfStruct.DVD.current_angle;
fd0a2f189e80 fix dvd pause. 10l
pontscho
parents: 5665
diff changeset
314 dvd_chapter=guiIntfStruct.DVD.current_chapter;
6280
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
315 guiIntfStruct.DiskChanged=1;
5667
fd0a2f189e80 fix dvd pause. 10l
pontscho
parents: 5665
diff changeset
316 }
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
317 break;
3054
9507f90d8254 add half dvd support for gui
pontscho
parents: 2995
diff changeset
318 #endif
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
319 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
320 mplPlay();
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
321 break;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
322 #ifdef USE_DVDREAD
3597
fe1283137353 init title change basz.
pontscho
parents: 3499
diff changeset
323 case evSetDVDSubtitle:
3618
772729dd7b40 better dvd support
pontscho
parents: 3597
diff changeset
324 dvdsub_id=(int)param;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
325 goto play_dvd_2;
3597
fe1283137353 init title change basz.
pontscho
parents: 3499
diff changeset
326 break;
fe1283137353 init title change basz.
pontscho
parents: 3499
diff changeset
327 case evSetDVDAudio:
3618
772729dd7b40 better dvd support
pontscho
parents: 3597
diff changeset
328 audio_id=(int)param;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
329 goto play_dvd_2;
3597
fe1283137353 init title change basz.
pontscho
parents: 3499
diff changeset
330 break;
fe1283137353 init title change basz.
pontscho
parents: 3499
diff changeset
331 case evSetDVDChapter:
5665
3e7f39c4110c fix dvd playing under gui
pontscho
parents: 5651
diff changeset
332 guiIntfStruct.DVD.current_chapter=(int)param;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
333 goto play_dvd_2;
3597
fe1283137353 init title change basz.
pontscho
parents: 3499
diff changeset
334 break;
fe1283137353 init title change basz.
pontscho
parents: 3499
diff changeset
335 case evSetDVDTitle:
5665
3e7f39c4110c fix dvd playing under gui
pontscho
parents: 5651
diff changeset
336 guiIntfStruct.DVD.current_title=(int)param;
3e7f39c4110c fix dvd playing under gui
pontscho
parents: 5651
diff changeset
337 guiIntfStruct.DVD.current_chapter=1;
3e7f39c4110c fix dvd playing under gui
pontscho
parents: 5651
diff changeset
338 guiIntfStruct.DVD.current_angle=1;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
339 goto play_dvd_2;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
340 break;
3618
772729dd7b40 better dvd support
pontscho
parents: 3597
diff changeset
341 #endif
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
342
2994
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
343 case evPause:
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
344 case evPauseSwitchToPlay:
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
345 NoPause:
4963
13262bd21965 small changes
pontscho
parents: 4950
diff changeset
346 mplPause();
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
347 break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
348
6794
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6755
diff changeset
349 case evStop: guiIntfStruct.Playing=guiSetStop; break;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
350
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
351 case evLoadPlay:
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
352 mplMainAutoPlay=1;
6280
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6218
diff changeset
353 // guiIntfStruct.StreamType=STREAMTYPE_FILE;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
354 case evLoad:
6713
cc917a581b6e add simple playlist support
pontscho
parents: 6651
diff changeset
355 gtkSet( gtkDelPl,0,NULL );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
356 gtkShow( evLoad,NULL );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
357 break;
6794
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6755
diff changeset
358 case evLoadSubtitle: gtkShow( evLoadSubtitle,NULL ); break;
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6755
diff changeset
359 case evLoadAudioFile: gtkShow( evLoadAudioFile,NULL ); break;
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6755
diff changeset
360 case evPrev: mplPrev(); break;
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6755
diff changeset
361 case evNext: mplNext(); break;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
362
6713
cc917a581b6e add simple playlist support
pontscho
parents: 6651
diff changeset
363 case evPlayList: gtkShow( evPlayList,NULL ); break;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
364 case evSkinBrowser: gtkShow( evSkinBrowser,skinName ); break;
6713
cc917a581b6e add simple playlist support
pontscho
parents: 6651
diff changeset
365 case evAbout: gtkShow( evAbout,NULL ); break;
cc917a581b6e add simple playlist support
pontscho
parents: 6651
diff changeset
366 case evPreferences: gtkShow( evPreferences,NULL ); break;
cc917a581b6e add simple playlist support
pontscho
parents: 6651
diff changeset
367 case evEqualizer: gtkShow( evEqualizer,NULL ); break;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
368
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
369 case evForward1min: mplRelSeek( 60 ); break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
370 case evBackward1min: mplRelSeek( -60 ); break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
371 case evForward10sec: mplRelSeek( 10 ); break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
372 case evBackward10sec: mplRelSeek( -10 ); break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
373 case evSetMoviePosition: mplAbsSeek( param ); break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
374
1860
c65abbc91c5c fix mwm bug's. faszom (C), and remove mixer.*
pontscho
parents: 1848
diff changeset
375 case evIncVolume: vo_x11_putkey( wsGrayMul ); break;
c65abbc91c5c fix mwm bug's. faszom (C), and remove mixer.*
pontscho
parents: 1848
diff changeset
376 case evDecVolume: vo_x11_putkey( wsGrayDiv ); break;
6619
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
377 case evMute: mixer_mute(); break;
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
378
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
379 case evSetVolume:
6619
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
380 guiIntfStruct.Volume=param;
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
381 goto set_volume;
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
382 case evSetBalance:
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
383 guiIntfStruct.Balance=param;
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
384 set_volume:
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
385 {
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
386 float l = guiIntfStruct.Volume * ( ( 100.0 - guiIntfStruct.Balance ) / 50.0 );
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
387 float r = guiIntfStruct.Volume * ( ( guiIntfStruct.Balance ) / 50.0 );
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
388 if ( l > guiIntfStruct.Volume ) l=guiIntfStruct.Volume;
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
389 if ( r > guiIntfStruct.Volume ) r=guiIntfStruct.Volume;
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
390 // printf( "!!! v: %.2f b: %.2f -> %.2f x %.2f\n",guiIntfStruct.Volume,guiIntfStruct.Balance,l,r );
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
391 mixer_setvolume( l,r );
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
392 }
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
393 #ifdef USE_OSD
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
394 if ( osd_level )
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
395 {
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
396 osd_visible=vo_mouse_timer_const;
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
397 vo_osd_progbar_type=OSD_VOLUME;
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
398 vo_osd_progbar_value=( ( guiIntfStruct.Volume ) * 256.0 ) / 100.0;
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
399 vo_osd_changed( OSDTYPE_PROGBAR );
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
400 }
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
401 #endif
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
402 break;
1847
773ae4ba43f5 add voluechanged
pontscho
parents: 1845
diff changeset
403
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
404
2994
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
405 case evIconify:
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
406 switch ( (int)param )
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
407 {
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
408 case 0: wsIconify( appMPlayer.mainWindow ); break;
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
409 case 1: wsIconify( appMPlayer.subWindow ); break;
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
410 }
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
411 break;
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
412 case evDoubleSize:
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
413 if ( guiIntfStruct.Playing )
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
414 {
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
415 appMPlayer.subWindow.isFullScreen=True;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
416 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
417 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
418 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
419 wsFullScreen( &appMPlayer.subWindow );
5520
25c43bd75e4c small bugfixes...
pontscho
parents: 5046
diff changeset
420 vo_fs=0;
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 break;
6623
7bc4c6ba9485 add -audiofile support for gui
pontscho
parents: 6619
diff changeset
423 case evNormalSize:
7bc4c6ba9485 add -audiofile support for gui
pontscho
parents: 6619
diff changeset
424 if ( guiIntfStruct.Playing )
7bc4c6ba9485 add -audiofile support for gui
pontscho
parents: 6619
diff changeset
425 {
7bc4c6ba9485 add -audiofile support for gui
pontscho
parents: 6619
diff changeset
426 appMPlayer.subWindow.isFullScreen=True;
7bc4c6ba9485 add -audiofile support for gui
pontscho
parents: 6619
diff changeset
427 appMPlayer.subWindow.OldX=( wsMaxX - guiIntfStruct.MovieWidth ) / 2;
7bc4c6ba9485 add -audiofile support for gui
pontscho
parents: 6619
diff changeset
428 appMPlayer.subWindow.OldY=( wsMaxY - guiIntfStruct.MovieHeight ) / 2;
7bc4c6ba9485 add -audiofile support for gui
pontscho
parents: 6619
diff changeset
429 appMPlayer.subWindow.OldWidth=guiIntfStruct.MovieWidth; appMPlayer.subWindow.OldHeight=guiIntfStruct.MovieHeight;
7bc4c6ba9485 add -audiofile support for gui
pontscho
parents: 6619
diff changeset
430 wsFullScreen( &appMPlayer.subWindow );
7bc4c6ba9485 add -audiofile support for gui
pontscho
parents: 6619
diff changeset
431 vo_fs=0;
7bc4c6ba9485 add -audiofile support for gui
pontscho
parents: 6619
diff changeset
432 break;
7bc4c6ba9485 add -audiofile support for gui
pontscho
parents: 6619
diff changeset
433 } else if ( !appMPlayer.subWindow.isFullScreen ) break;
2994
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
434 case evFullScreen:
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
435 for ( j=0;j<appMPlayer.NumberOfItems + 1;j++ )
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
436 {
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
437 if ( appMPlayer.Items[j].msg == evFullScreen )
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
438 {
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
439 appMPlayer.Items[j].tmp=!appMPlayer.Items[j].tmp;
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
440 appMPlayer.Items[j].pressed=appMPlayer.Items[j].tmp;
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
441 }
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
442 }
4981
bfc652fc7f43 rewrite fullscreen support in some libvo driver
pontscho
parents: 4979
diff changeset
443 mplFullScreen();
2994
4e30e2c6dcb9 dvd playing bug fixed
pontscho
parents: 2940
diff changeset
444 break;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
445
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
446 // --- timer events
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
447 case evRedraw:
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
448 mplMainRender=1;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
449 wsPostRedisplay( &appMPlayer.mainWindow );
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
450 mplRedrawTimer=mplRedrawTimerConst;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
451 break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
452 // --- system events
6218
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6183
diff changeset
453 #ifdef MP_DEBUG
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
454 case evNone:
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
455 mp_msg( MSGT_GPLAYER,MSGL_STATUS,"[mw] event none received.\n" );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
456 break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
457 default:
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
458 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
459 break;
6218
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6183
diff changeset
460 #endif
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
461 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
462 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
463
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
464 #define itPLMButton (itNULL - 1)
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
465 #define itPRMButton (itNULL - 2)
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
466
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
467 void mplMainMouseHandle( int Button,int X,int Y,int RX,int RY )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
468 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
469 static int itemtype = 0;
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
470 int i;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
471 wItem * item = NULL;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
472 float value = 0.0f;
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
473
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
474 static int SelectedItem = -1;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
475 int currentselected = -1;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
476
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
477 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
478 if ( ( appMPlayer.Items[i].pressed != btnDisabled )&&
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
479 ( 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
480 { currentselected=i; break; }
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
481
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
482 switch ( Button )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
483 {
6651
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6627
diff changeset
484 case wsPMMouseButton:
6755
a31b9f15cbff - fix audio equalizer
pontscho
parents: 6713
diff changeset
485 gtkShow( evHidePopUpMenu,NULL );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
486 mplShowMenu( RX,RY );
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
487 itemtype=itPRMButton;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
488 break;
6651
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6627
diff changeset
489 case wsRMMouseButton:
5919
60cf2bca993f some bug fix
pontscho
parents: 5689
diff changeset
490 mplHideMenu( RX,RY,0 );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
491 break;
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
492
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
493 case wsPLMouseButton:
6755
a31b9f15cbff - fix audio equalizer
pontscho
parents: 6713
diff changeset
494 gtkShow( evHidePopUpMenu,NULL );
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
495 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
496 SelectedItem=currentselected;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
497 if ( SelectedItem == -1 ) break; // yeees, i'm move the fucking window
6794
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6755
diff changeset
498 boxMoved=0; //mplMainRender=1; // No, not move the window, i'm pressed one button
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
499 item=&appMPlayer.Items[SelectedItem];
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
500 itemtype=item->type;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
501 item->pressed=btnPressed;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
502 switch( item->type )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
503 {
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
504 case itButton:
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
505 if ( ( SelectedItem > -1 ) &&
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
506 ( ( ( 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
507 ( ( 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
508 { appMPlayer.Items[SelectedItem].pressed=btnDisabled; }
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
509 break;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
510 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
511 break;
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
512 case wsRLMouseButton:
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
513 boxMoved=0;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
514 item=&appMPlayer.Items[SelectedItem];
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
515 item->pressed=btnReleased;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
516 SelectedItem=-1;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
517 if ( currentselected == - 1 ) { itemtype=0; break; }
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
518 value=0;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
519 switch( itemtype )
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
520 {
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
521 case itPotmeter:
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
522 case itHPotmeter:
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
523 btnModify( item->msg,(float)( X - item->x ) / item->width * 100.0f );
6619
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
524 mplEventHandling( item->msg,item->value );
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
525 value=item->value;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
526 break;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
527 }
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
528 mplEventHandling( item->msg,value );
6794
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6755
diff changeset
529 // mplMainRender=1;
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
530 itemtype=0;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
531 break;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
532
6651
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6627
diff changeset
533 case wsPRMouseButton:
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
534 gtkShow( evShowPopUpMenu,NULL );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
535 break;
2851
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 // --- rolled mouse ... de szar :)))
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
538 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
539 case wsP4MouseButton: value= 2.5f;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
540 rollerhandled:
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
541 item=&appMPlayer.Items[currentselected];
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
542 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
543 {
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
544 item->value+=value;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
545 btnModify( item->msg,item->value );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
546 mplEventHandling( item->msg,item->value );
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
547 }
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
548 break;
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
549
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
550 // --- moving
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
551 case wsMoveMouse:
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
552 item=&appMPlayer.Items[SelectedItem];
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
553 switch ( itemtype )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
554 {
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
555 case itPLMButton:
2854
fd44ecf77f8d move bug meg fileload bug fixed asszem.
pontscho
parents: 2851
diff changeset
556 wsMoveWindow( &appMPlayer.mainWindow,False,RX - abs( sx ),RY - abs( sy ) );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
557 mplMainRender=0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
558 break;
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
559 case itPRMButton:
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
560 mplMenuMouseHandle( X,Y,RX,RY );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
561 break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
562 case itPotmeter:
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 goto potihandled;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
565 case itHPotmeter:
1729
d6c99f70449e fix hprogressbar
pontscho
parents: 1723
diff changeset
566 item->value=(float)( X - item->x ) / item->width * 100.0f;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
567 potihandled:
2851
b64fa5d25142 add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents: 2447
diff changeset
568 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
569 if ( item->value < 0.0f ) item->value=0.0f;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
570 mplEventHandling( item->msg,item->value );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
571 break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
572 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
573 break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
574 }
6619
f554e7271587 fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents: 6546
diff changeset
575 // if ( Button != wsMoveMouse ) wsPostRedisplay( &appMPlayer.mainWindow );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
576 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
577
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
578 int keyPressed = 0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
579
6183
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
580 void mplMainKeyHandle( int KeyCode,int Type,int Key )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
581 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
582 int msg = evNone;
4950
307a94037c5c bazmeg a playtree - t
pontscho
parents: 4858
diff changeset
583
4409
61e53100353e add XF86 multimedia key cucc.
pontscho
parents: 4061
diff changeset
584 if ( Type != wsKeyPressed ) return;
6183
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
585
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
586 if ( !Key )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
587 {
6183
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
588 switch ( KeyCode )
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
589 {
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
590 case wsXFMMPrev: msg=evPrev; break;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
591 case wsXFMMStop: msg=evStop; break;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
592 case wsXFMMPlay: msg=evPlaySwitchToPause; break;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
593 case wsXFMMNext: msg=evNext; break;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
594 case wsXFMMVolUp: msg=evIncVolume; break;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
595 case wsXFMMVolDown: msg=evDecVolume; break;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
596 case wsXFMMMute: msg=evMute; break;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
597 }
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
598 }
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
599 else
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
600 {
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
601 switch ( Key )
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
602 {
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
603 case wsEnter: msg=evPlay; break;
4858
65730cea02e7 add half new input support for gui
pontscho
parents: 4818
diff changeset
604 #ifndef HAVE_NEW_INPUT
6183
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
605 case '.':
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
606 case '>': msg=evNext; break;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
607 case ',':
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
608 case '<': msg=evPrev; break;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
609
6183
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
610 case wsEscape: msg=evExit; break;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
611
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
612 case wsSpace: msg=evPause; break;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
613 case wsa:
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
614 case wsA: msg=evAbout; break;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
615 case wsb:
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
616 case wsB: msg=evSkinBrowser; break;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
617 case wse:
6546
e9f97e2fd0dc equalizer typo fix by diego
atmos4
parents: 6311
diff changeset
618 case wsE: msg=evEqualizer; break;
6183
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
619 case wsf:
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
620 case wsF: msg=evFullScreen; break;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
621 case wsl:
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
622 case wsL: msg=evLoad; break;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
623 case wsu:
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
624 case wsU: msg=evLoadSubtitle; break;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
625 case wsm:
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
626 case wsM: msg=evMute; break;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
627 case wss:
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
628 case wsS: msg=evStop; break;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
629 case wsp:
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
630 case wsP: msg=evPlayList; break;
4858
65730cea02e7 add half new input support for gui
pontscho
parents: 4818
diff changeset
631 #endif
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4465
diff changeset
632
6183
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
633 case wsXF86LowerVolume: msg=evDecVolume; break;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
634 case wsXF86RaiseVolume: msg=evIncVolume; break;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
635 case wsXF86Mute: msg=evMute; break;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
636 case wsXF86Play: msg=evPlaySwitchToPause; break;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
637 case wsXF86Stop: msg=evStop; break;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
638 case wsXF86Prev: msg=evPrev; break;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
639 case wsXF86Next: msg=evNext; break;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
640 case wsXF86Media: msg=evLoad; break;
4409
61e53100353e add XF86 multimedia key cucc.
pontscho
parents: 4061
diff changeset
641
6183
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
642 default: vo_x11_putkey( Key ); return;
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
643 }
a4bbda72ce86 fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents: 6159
diff changeset
644 }
4858
65730cea02e7 add half new input support for gui
pontscho
parents: 4818
diff changeset
645 if ( msg != evNone ) mplEventHandling( msg,0 );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
646 }
6967
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
647
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
648 /* this will be used to handle Drag&Drop files */
7092
8e9607c5897e - warning fixes from Dominik Mierzejewski <dominik@rangers.eu.org>
pontscho
parents: 7009
diff changeset
649 void mplDandDHandler(int num,char** files)
6967
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
650 {
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
651 struct stat buf;
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
652 int f = 0;
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
653
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
654 if (num <= 0)
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
655 return;
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
656
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
657 /* clear playlist */
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
658 gtkSet(gtkDelPl,0,NULL);
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
659
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
660 /* now fill it with new items */
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
661 for(f=0; f < num; f++){
6977
7242f1840f8d kde3 dnd fix from Gregory Kovriga and file name handling fix in dnd callback
pontscho
parents: 6967
diff changeset
662 char* str = strdup( files[f] );
6967
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
663 plItem* item;
6977
7242f1840f8d kde3 dnd fix from Gregory Kovriga and file name handling fix in dnd callback
pontscho
parents: 6967
diff changeset
664
6996
163f78ece9c2 add uri2filename converter
pontscho
parents: 6977
diff changeset
665 #ifdef USE_ICONV
6977
7242f1840f8d kde3 dnd fix from Gregory Kovriga and file name handling fix in dnd callback
pontscho
parents: 6967
diff changeset
666 if ( strchr( str,'%' ) )
7242f1840f8d kde3 dnd fix from Gregory Kovriga and file name handling fix in dnd callback
pontscho
parents: 6967
diff changeset
667 {
6996
163f78ece9c2 add uri2filename converter
pontscho
parents: 6977
diff changeset
668 char * tmp=gconvert_uri_to_filename( str );
163f78ece9c2 add uri2filename converter
pontscho
parents: 6977
diff changeset
669 free( str ); str=tmp;
6977
7242f1840f8d kde3 dnd fix from Gregory Kovriga and file name handling fix in dnd callback
pontscho
parents: 6967
diff changeset
670 }
6996
163f78ece9c2 add uri2filename converter
pontscho
parents: 6977
diff changeset
671 #endif
6977
7242f1840f8d kde3 dnd fix from Gregory Kovriga and file name handling fix in dnd callback
pontscho
parents: 6967
diff changeset
672
6967
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
673 if(stat(str,&buf) == 0 && S_ISDIR(buf.st_mode) == 0) {
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
674 /* this is not a directory so try to play it */
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
675 printf("Received D&D %s\n",str);
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
676 item = calloc(1,sizeof(plItem));
6977
7242f1840f8d kde3 dnd fix from Gregory Kovriga and file name handling fix in dnd callback
pontscho
parents: 6967
diff changeset
677
6967
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
678 /* FIXME: decompose file name ? */
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
679 /* yes -- Pontscho */
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
680 if ( strrchr( str,'/' ) )
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
681 {
6977
7242f1840f8d kde3 dnd fix from Gregory Kovriga and file name handling fix in dnd callback
pontscho
parents: 6967
diff changeset
682 char * s = strrchr( str,'/' ); *s=0; s++;
6967
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
683 item->name = gstrdup( s );
6977
7242f1840f8d kde3 dnd fix from Gregory Kovriga and file name handling fix in dnd callback
pontscho
parents: 6967
diff changeset
684 item->path = gstrdup( str );
6967
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
685 } else { item->name = strdup(str); item->path = strdup(""); }
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
686 gtkSet(gtkAddPlItem,0,(void*)item);
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
687 } else {
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
688 printf("Received not a file: %s !\n",str);
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
689 }
6977
7242f1840f8d kde3 dnd fix from Gregory Kovriga and file name handling fix in dnd callback
pontscho
parents: 6967
diff changeset
690 free( str );
6967
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
691 }
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
692
7009
98bed9e12087 - add dxr3 gui support (dialogbox, etc.)
pontscho
parents: 6996
diff changeset
693 mplSetFileName( NULL,files[0],STREAMTYPE_FILE );
6967
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
694 if ( guiIntfStruct.Playing == 1 ) mplEventHandling( evStop,0 );
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
695 mplEventHandling( evPlay,0 );
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
696
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6905
diff changeset
697 }