Mercurial > mplayer.hg
annotate Gui/mplayer/mw.c @ 8380:743fa83d9e2d
need this
author | pontscho |
---|---|
date | Thu, 05 Dec 2002 23:54:15 +0000 |
parents | ef8c992672f4 |
children | c6a1a5b6ba25 |
rev | line source |
---|---|
1693 | 1 |
2 // main window | |
3 | |
8055 | 4 #include <stdlib.h> |
5 #include <stdio.h> | |
6 #include <inttypes.h> | |
7 #include <sys/stat.h> | |
8 #include <unistd.h> | |
9 | |
10 #include "../app.h" | |
11 #include "../skin/font.h" | |
8139 | 12 #include "../skin/skin.h" |
8055 | 13 #include "../wm/ws.h" |
14 | |
15 #include "../../config.h" | |
16 #include "../../help_mp.h" | |
17 #include "../../libvo/x11_common.h" | |
18 | |
2447 | 19 #include "../../libmpdemux/stream.h" |
6311
da2dda48b7ec
add mute support ( step 1 ) and fixed panscan bugs (1000l for me)
pontscho
parents:
6298
diff
changeset
|
20 #include "../../mixer.h" |
6619
f554e7271587
fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents:
6546
diff
changeset
|
21 #include "../../libvo/sub.h" |
f554e7271587
fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents:
6546
diff
changeset
|
22 #include "../../mplayer.h" |
2447 | 23 |
8305
4c23944315d6
- add R¸«ädiger Kuhlmann's <mplayer-list-UGa6JdjLujS2@ruediger-kuhlmann.de> patch
pontscho
parents:
8302
diff
changeset
|
24 #include "../../libmpdemux/demuxer.h" |
4c23944315d6
- add R¸«ädiger Kuhlmann's <mplayer-list-UGa6JdjLujS2@ruediger-kuhlmann.de> patch
pontscho
parents:
8302
diff
changeset
|
25 #include "../../libmpdemux/stheader.h" |
4c23944315d6
- add R¸«ädiger Kuhlmann's <mplayer-list-UGa6JdjLujS2@ruediger-kuhlmann.de> patch
pontscho
parents:
8302
diff
changeset
|
26 #include "../../codec-cfg.h" |
4c23944315d6
- add R¸«ädiger Kuhlmann's <mplayer-list-UGa6JdjLujS2@ruediger-kuhlmann.de> patch
pontscho
parents:
8302
diff
changeset
|
27 |
4c23944315d6
- add R¸«ädiger Kuhlmann's <mplayer-list-UGa6JdjLujS2@ruediger-kuhlmann.de> patch
pontscho
parents:
8302
diff
changeset
|
28 |
8055 | 29 #include "play.h" |
30 #include "widgets.h" | |
31 | |
8043 | 32 extern unsigned int GetTimerMS( void ); |
33 | |
1693 | 34 unsigned char * mplDrawBuffer = NULL; |
35 int mplMainRender = 1; | |
2940 | 36 |
1693 | 37 int mplMainAutoPlay = 0; |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
38 int mplMiddleMenu = 0; |
1693 | 39 |
40 int mainVisible = 1; | |
41 | |
42 int boxMoved = 0; | |
43 int sx = 0,sy = 0; | |
44 int i,pot = 0; | |
45 | |
3054 | 46 inline void TranslateFilename( int c,char * tmp ) |
47 { | |
48 int i; | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
49 switch ( guiIntfStruct.StreamType ) |
3054 | 50 { |
6298 | 51 case STREAMTYPE_STREAM: |
52 strcpy( tmp,guiIntfStruct.Filename ); | |
53 break; | |
3054 | 54 case STREAMTYPE_FILE: |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
55 if ( ( guiIntfStruct.Filename )&&( guiIntfStruct.Filename[0] ) ) |
3054 | 56 { |
4979 | 57 if ( strrchr( guiIntfStruct.Filename,'/' ) ) strcpy( tmp,strrchr( guiIntfStruct.Filename,'/' ) + 1 ); |
58 else strcpy( tmp,guiIntfStruct.Filename ); | |
3054 | 59 if ( tmp[strlen( tmp ) - 4] == '.' ) tmp[strlen( tmp ) - 4]=0; |
60 if ( tmp[strlen( tmp ) - 5] == '.' ) tmp[strlen( tmp ) - 5]=0; | |
7150 | 61 } else strcpy( tmp,MSGTR_NoFileLoaded ); |
3054 | 62 break; |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
63 #ifdef USE_DVDREAD |
3054 | 64 case STREAMTYPE_DVD: |
7150 | 65 if ( guiIntfStruct.DVD.current_chapter ) sprintf( tmp,MSGTR_Chapter,guiIntfStruct.DVD.current_chapter ); |
66 else strcat( tmp,MSGTR_NoChapter ); | |
3054 | 67 break; |
68 #endif | |
6280 | 69 #ifdef HAVE_VCD |
70 case STREAMTYPE_VCD: | |
7150 | 71 sprintf( tmp,MSGTR_VCDTrack,guiIntfStruct.Track ); |
6280 | 72 break; |
73 #endif | |
7150 | 74 default: strcpy( tmp,MSGTR_NoMediaOpened ); |
3054 | 75 } |
76 if ( c ) | |
77 { | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
78 for ( i=0;i < (int)strlen( tmp );i++ ) |
3054 | 79 { |
80 int t=0; | |
81 if ( c == 1 ) { if ( ( tmp[i] >= 'A' )&&( tmp[i] <= 'Z' ) ) t=32; } | |
82 if ( c == 2 ) { if ( ( tmp[i] >= 'a' )&&( tmp[i] <= 'z' ) ) t=-32; } | |
83 tmp[i]=(char)( tmp[i] + t ); | |
84 } | |
85 } | |
86 } | |
87 | |
1693 | 88 char * Translate( char * str ) |
89 { | |
90 static char trbuf[512]; | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
91 char tmp[512]; |
1693 | 92 int i,c; |
2045 | 93 int t; |
1693 | 94 memset( trbuf,0,512 ); |
95 memset( tmp,0,128 ); | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
96 for ( c=0,i=0;i < (int)strlen( str );i++ ) |
1693 | 97 { |
98 if ( str[i] != '$' ) { trbuf[c++]=str[i]; trbuf[c]=0; } | |
99 else | |
100 { | |
101 switch ( str[++i] ) | |
102 { | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
103 case 't': sprintf( tmp,"%02d",guiIntfStruct.Track ); strcat( trbuf,tmp ); break; |
3054 | 104 case 'o': TranslateFilename( 0,tmp ); strcat( trbuf,tmp ); break; |
105 case 'f': TranslateFilename( 1,tmp ); strcat( trbuf,tmp ); break; | |
106 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
|
107 case '6': t=guiIntfStruct.LengthInSec; goto calclengthhhmmss; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
108 case '1': t=guiIntfStruct.TimeSec; |
1693 | 109 calclengthhhmmss: |
1888 | 110 sprintf( tmp,"%02d:%02d:%02d",t/3600,t/60%60,t%60 ); strcat( trbuf,tmp ); |
1693 | 111 break; |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
112 case '7': t=guiIntfStruct.LengthInSec; goto calclengthmmmmss; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
113 case '2': t=guiIntfStruct.TimeSec; |
1693 | 114 calclengthmmmmss: |
1888 | 115 sprintf( tmp,"%04d:%02d",t/60,t%60 ); strcat( trbuf,tmp ); |
1693 | 116 break; |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
117 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
|
118 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
|
119 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
|
120 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
|
121 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
|
122 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
|
123 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
|
124 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
|
125 case 'd': sprintf( tmp,"%d",guiIntfStruct.FrameDrop ); strcat( trbuf,tmp ); break; |
8305
4c23944315d6
- add R¸«ädiger Kuhlmann's <mplayer-list-UGa6JdjLujS2@ruediger-kuhlmann.de> patch
pontscho
parents:
8302
diff
changeset
|
126 case 'x': sprintf( tmp,"%d",guiIntfStruct.MovieWidth ); strcat( trbuf,tmp ); break; |
4c23944315d6
- add R¸«ädiger Kuhlmann's <mplayer-list-UGa6JdjLujS2@ruediger-kuhlmann.de> patch
pontscho
parents:
8302
diff
changeset
|
127 case 'y': sprintf( tmp,"%d",guiIntfStruct.MovieHeight ); strcat( trbuf,tmp ); break; |
4c23944315d6
- add R¸«ädiger Kuhlmann's <mplayer-list-UGa6JdjLujS2@ruediger-kuhlmann.de> patch
pontscho
parents:
8302
diff
changeset
|
128 case 'C': sprintf( tmp,"%s", guiIntfStruct.sh_video? ((sh_video_t *)guiIntfStruct.sh_video)->codec->name : ""); |
4c23944315d6
- add R¸«ädiger Kuhlmann's <mplayer-list-UGa6JdjLujS2@ruediger-kuhlmann.de> patch
pontscho
parents:
8302
diff
changeset
|
129 strcat( trbuf,tmp ); break; |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
130 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
|
131 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
|
132 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
|
133 case 'a': |
6619
f554e7271587
fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents:
6546
diff
changeset
|
134 if ( muted ) { strcat( trbuf,"n" ); break; } |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
135 switch ( guiIntfStruct.AudioType ) |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
136 { |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
137 case 0: strcat( trbuf,"n" ); break; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
138 case 1: strcat( trbuf,"m" ); break; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
139 case 2: strcat( trbuf,"t" ); break; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
140 } |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
141 break; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
142 case 'T': |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
143 switch ( guiIntfStruct.StreamType ) |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
144 { |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
145 case STREAMTYPE_FILE: strcat( trbuf,"f" ); break; |
6280 | 146 #ifdef HAVE_VCD |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
147 case STREAMTYPE_VCD: strcat( trbuf,"v" ); break; |
6280 | 148 #endif |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
149 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
|
150 #ifdef USE_DVDREAD |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
151 case STREAMTYPE_DVD: strcat( trbuf,"d" ); break; |
3054 | 152 #endif |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
153 default: strcat( trbuf," " ); break; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
154 } |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
155 break; |
1707 | 156 case '$': strcat( trbuf,"$" ); break; |
1693 | 157 default: continue; |
158 } | |
159 c=strlen( trbuf ); | |
160 } | |
161 } | |
162 return trbuf; | |
163 } | |
164 | |
3054 | 165 inline void PutImage( txSample * bf,int x,int y,int max,int ofs ) |
1693 | 166 { |
167 int i=0,ix,iy; | |
6159
dcf195b784bf
applied 64bit patch from Ulrich Hecht <uli@suse.de>
pontscho
parents:
6145
diff
changeset
|
168 uint32_t * buf = NULL; |
dcf195b784bf
applied 64bit patch from Ulrich Hecht <uli@suse.de>
pontscho
parents:
6145
diff
changeset
|
169 uint32_t * drw = NULL; |
dcf195b784bf
applied 64bit patch from Ulrich Hecht <uli@suse.de>
pontscho
parents:
6145
diff
changeset
|
170 uint32_t tmp; |
1693 | 171 |
172 if ( ( !bf )||( bf->Image == NULL ) ) return; | |
173 | |
174 i=( bf->Width * ( bf->Height / max ) ) * ofs; | |
6159
dcf195b784bf
applied 64bit patch from Ulrich Hecht <uli@suse.de>
pontscho
parents:
6145
diff
changeset
|
175 buf=(uint32_t *)mplDrawBuffer; |
dcf195b784bf
applied 64bit patch from Ulrich Hecht <uli@suse.de>
pontscho
parents:
6145
diff
changeset
|
176 drw=(uint32_t *)bf->Image; |
1693 | 177 |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
178 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
|
179 for ( ix=x;ix < (int)(x+bf->Width);ix++ ) |
1693 | 180 { |
181 tmp=drw[i++]; | |
182 if ( tmp != 0x00ff00ff ) | |
183 buf[ iy*appMPlayer.main.Bitmap.Width+ix ]=tmp; | |
184 } | |
185 } | |
186 | |
8058 | 187 void mplMainDraw( void ) |
1693 | 188 { |
189 wItem * item; | |
190 txSample * image = NULL; | |
8300 | 191 int i, type; |
1693 | 192 |
6043 | 193 if ( appMPlayer.mainWindow.State == wsWindowClosed ) exit_player( MSGTR_Exit_quit ); |
194 | |
1693 | 195 if ( appMPlayer.mainWindow.Visible == wsWindowNotVisible || |
1729 | 196 !mainVisible ) return; |
197 // !appMPlayer.mainWindow.Mapped ) return; | |
198 | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
199 btnModify( evSetMoviePosition,guiIntfStruct.Position ); |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
200 btnModify( evSetVolume,guiIntfStruct.Volume ); |
1751 | 201 |
6794 | 202 if ( mplMainRender && appMPlayer.mainWindow.State == wsWindowExpose ) |
1693 | 203 { |
204 memcpy( mplDrawBuffer,appMPlayer.main.Bitmap.Image,appMPlayer.main.Bitmap.ImageSize ); | |
205 for( i=0;i < appMPlayer.NumberOfItems + 1;i++ ) | |
206 { | |
207 item=&appMPlayer.Items[i]; | |
208 switch( item->type ) | |
209 { | |
210 case itButton: | |
211 PutImage( &item->Bitmap,item->x,item->y,3,item->pressed ); | |
212 break; | |
1729 | 213 case itPotmeter: |
5919 | 214 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
|
215 break; |
1693 | 216 case itHPotmeter: |
217 PutImage( &item->Bitmap,item->x,item->y,item->phases,item->phases * ( item->value / 100.0f ) ); | |
218 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
|
219 break; |
1693 | 220 case itSLabel: |
221 image=fntRender( item->fontid,0,item->width,"%s",item->label ); | |
222 goto drawrenderedtext; | |
223 case itDLabel: | |
6755 | 224 { |
225 char * t = Translate( item->label ); | |
226 int l = fntTextWidth( item->fontid,t ); | |
8043 | 227 image=fntRender( item->fontid,(GetTimerMS() / 20)%(l?l:item->width),item->width,"%s",t ); |
6755 | 228 } |
1693 | 229 drawrenderedtext: |
230 if ( image ) | |
231 { | |
5919 | 232 PutImage( image,item->x,item->y,1,0 ); |
1693 | 233 if ( image->Image ) free( image->Image ); |
234 free( image ); | |
235 } | |
236 break; | |
237 } | |
238 } | |
239 wsConvert( &appMPlayer.mainWindow,mplDrawBuffer,appMPlayer.main.Bitmap.ImageSize ); | |
240 mplMainRender=0; | |
241 } | |
242 wsPutImage( &appMPlayer.mainWindow ); | |
2854 | 243 // XFlush( wsDisplay ); |
1693 | 244 } |
245 | |
1729 | 246 extern void exit_player(char* how); |
5665 | 247 extern char * dvd_device; |
6280 | 248 extern int vcd_track; |
249 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
|
250 extern int osd_visible; |
1729 | 251 |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
252 void mplEventHandling( int msg,float param ) |
1693 | 253 { |
254 int j; | |
255 | |
256 switch( msg ) | |
257 { | |
258 // --- user events | |
259 case evExit: | |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
260 exit_player( "Exit" ); |
1693 | 261 break; |
2994 | 262 |
6298 | 263 case evPlayNetwork: |
6794 | 264 if ( guiIntfStruct.Subtitlename ) { free( guiIntfStruct.Subtitlename ); guiIntfStruct.Subtitlename=NULL; } |
265 if ( guiIntfStruct.AudioFile ) { free( guiIntfStruct.AudioFile ); guiIntfStruct.AudioFile=NULL; } | |
6298 | 266 guiIntfStruct.StreamType=STREAMTYPE_STREAM; |
267 goto play; | |
268 case evSetURL: | |
269 gtkShow( evPlayNetwork,NULL ); | |
270 break; | |
8312
ef8c992672f4
- audio track handling in menu (idea from R¸«ädiger Kuhlmann)
pontscho
parents:
8305
diff
changeset
|
271 |
ef8c992672f4
- audio track handling in menu (idea from R¸«ädiger Kuhlmann)
pontscho
parents:
8305
diff
changeset
|
272 case evSetAudio: |
ef8c992672f4
- audio track handling in menu (idea from R¸«ädiger Kuhlmann)
pontscho
parents:
8305
diff
changeset
|
273 if ( !guiIntfStruct.demuxer ) break; |
ef8c992672f4
- audio track handling in menu (idea from R¸«ädiger Kuhlmann)
pontscho
parents:
8305
diff
changeset
|
274 audio_id=(int)param; |
ef8c992672f4
- audio track handling in menu (idea from R¸«ädiger Kuhlmann)
pontscho
parents:
8305
diff
changeset
|
275 if ( guiIntfStruct.StreamType == STREAMTYPE_DVD ) goto play; |
ef8c992672f4
- audio track handling in menu (idea from R¸«ädiger Kuhlmann)
pontscho
parents:
8305
diff
changeset
|
276 guiIntfStruct.FilenameChanged=1; |
ef8c992672f4
- audio track handling in menu (idea from R¸«ädiger Kuhlmann)
pontscho
parents:
8305
diff
changeset
|
277 break; |
8380 | 278 |
279 case evSetVideo: | |
280 if ( !guiIntfStruct.demuxer ) break; | |
281 video_id=(int)param; | |
282 if ( guiIntfStruct.StreamType == STREAMTYPE_DVD ) goto play; | |
283 guiIntfStruct.FilenameChanged=1; | |
284 break; | |
285 | |
6280 | 286 #ifdef HAVE_VCD |
287 case evSetVCDTrack: | |
288 guiIntfStruct.Track=(int)param; | |
289 case evPlayVCD: | |
7009 | 290 gtkSet( gtkClearStruct,0,(void *)guiALL ); |
6280 | 291 guiIntfStruct.StreamType=STREAMTYPE_VCD; |
292 goto play; | |
293 #endif | |
3054 | 294 #ifdef USE_DVDREAD |
2994 | 295 case evPlayDVD: |
5665 | 296 guiIntfStruct.DVD.current_title=1; |
297 guiIntfStruct.DVD.current_chapter=1; | |
298 guiIntfStruct.DVD.current_angle=1; | |
3618 | 299 play_dvd_2: |
7009 | 300 gtkSet( gtkClearStruct,0,(void *)(guiALL - guiDVD) ); |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
301 guiIntfStruct.StreamType=STREAMTYPE_DVD; |
3054 | 302 #endif |
2994 | 303 case evPlay: |
304 case evPlaySwitchToPause: | |
6280 | 305 play: |
6713 | 306 |
6794 | 307 if ( ( msg == evPlaySwitchToPause )&&( guiIntfStruct.Playing == 2 ) ) goto NoPause; |
3618 | 308 |
6280 | 309 vcd_track=0; |
310 dvd_title=0; | |
311 | |
6905 | 312 if ( gtkSet( gtkGetCurrPlItem,0,NULL ) &&( guiIntfStruct.StreamType == STREAMTYPE_FILE ) ) |
6713 | 313 { |
314 plItem * next = gtkSet( gtkGetCurrPlItem,0,NULL ); | |
315 plLastPlayed=next; | |
316 guiSetDF( guiIntfStruct.Filename,next->path,next->name ); | |
317 guiIntfStruct.StreamType=STREAMTYPE_FILE; | |
318 guiIntfStruct.FilenameChanged=1; | |
6794 | 319 gfree( (void **)&guiIntfStruct.AudioFile ); |
320 gfree( (void **)&guiIntfStruct.Subtitlename ); | |
6713 | 321 } |
322 | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
323 switch ( guiIntfStruct.StreamType ) |
1693 | 324 { |
6298 | 325 case STREAMTYPE_STREAM: |
6280 | 326 case STREAMTYPE_FILE: |
7009 | 327 gtkSet( gtkClearStruct,0,(void *)(guiALL - guiFilenames) ); |
6280 | 328 break; |
329 #ifdef HAVE_VCD | |
2995 | 330 case STREAMTYPE_VCD: |
7009 | 331 gtkSet( gtkClearStruct,0,(void *)(guiALL - guiVCD - guiFilenames) ); |
332 if ( !cdrom_device ) cdrom_device=DEFAULT_CDROM_DEVICE; | |
333 mplSetFileName( NULL,cdrom_device,STREAMTYPE_VCD ); | |
6280 | 334 if ( guiIntfStruct.Playing != 2 ) |
335 { | |
336 if ( !guiIntfStruct.Track ) | |
337 { | |
338 if ( guiIntfStruct.VCDTracks == 1 ) guiIntfStruct.Track=1; | |
339 else guiIntfStruct.Track=2; | |
340 } | |
341 vcd_track=guiIntfStruct.Track; | |
342 guiIntfStruct.DiskChanged=1; | |
343 } | |
344 break; | |
345 #endif | |
3054 | 346 #ifdef USE_DVDREAD |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
347 case STREAMTYPE_DVD: |
7009 | 348 gtkSet( gtkClearStruct,0,(void *)(guiALL - guiDVD - guiFilenames) ); |
349 if ( !dvd_device ) dvd_device=DEFAULT_DVD_DEVICE; | |
350 mplSetFileName( NULL,dvd_device,STREAMTYPE_DVD ); | |
5667 | 351 if ( guiIntfStruct.Playing != 2 ) |
352 { | |
353 dvd_title=guiIntfStruct.DVD.current_title; | |
354 dvd_angle=guiIntfStruct.DVD.current_angle; | |
355 dvd_chapter=guiIntfStruct.DVD.current_chapter; | |
6280 | 356 guiIntfStruct.DiskChanged=1; |
5667 | 357 } |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
358 break; |
3054 | 359 #endif |
1693 | 360 } |
361 mplPlay(); | |
362 break; | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
363 #ifdef USE_DVDREAD |
3597 | 364 case evSetDVDSubtitle: |
3618 | 365 dvdsub_id=(int)param; |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
366 goto play_dvd_2; |
3597 | 367 break; |
368 case evSetDVDAudio: | |
3618 | 369 audio_id=(int)param; |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
370 goto play_dvd_2; |
3597 | 371 break; |
372 case evSetDVDChapter: | |
5665 | 373 guiIntfStruct.DVD.current_chapter=(int)param; |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
374 goto play_dvd_2; |
3597 | 375 break; |
376 case evSetDVDTitle: | |
5665 | 377 guiIntfStruct.DVD.current_title=(int)param; |
378 guiIntfStruct.DVD.current_chapter=1; | |
379 guiIntfStruct.DVD.current_angle=1; | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
380 goto play_dvd_2; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
381 break; |
3618 | 382 #endif |
1693 | 383 |
2994 | 384 case evPause: |
1693 | 385 case evPauseSwitchToPlay: |
386 NoPause: | |
4963 | 387 mplPause(); |
1693 | 388 break; |
389 | |
8118 | 390 case evStop: guiIntfStruct.Playing=guiSetStop; mplState(); break; |
1693 | 391 |
392 case evLoadPlay: | |
393 mplMainAutoPlay=1; | |
6280 | 394 // guiIntfStruct.StreamType=STREAMTYPE_FILE; |
1693 | 395 case evLoad: |
6713 | 396 gtkSet( gtkDelPl,0,NULL ); |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
397 gtkShow( evLoad,NULL ); |
1693 | 398 break; |
6794 | 399 case evLoadSubtitle: gtkShow( evLoadSubtitle,NULL ); break; |
7169 | 400 case evDropSubtitle: |
401 gfree( (void **)&guiIntfStruct.Subtitlename ); | |
402 guiLoadSubtitle( NULL ); | |
403 break; | |
6794 | 404 case evLoadAudioFile: gtkShow( evLoadAudioFile,NULL ); break; |
405 case evPrev: mplPrev(); break; | |
406 case evNext: mplNext(); break; | |
1693 | 407 |
6713 | 408 case evPlayList: gtkShow( evPlayList,NULL ); break; |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
409 case evSkinBrowser: gtkShow( evSkinBrowser,skinName ); break; |
6713 | 410 case evAbout: gtkShow( evAbout,NULL ); break; |
411 case evPreferences: gtkShow( evPreferences,NULL ); break; | |
412 case evEqualizer: gtkShow( evEqualizer,NULL ); break; | |
1693 | 413 |
414 case evForward1min: mplRelSeek( 60 ); break; | |
415 case evBackward1min: mplRelSeek( -60 ); break; | |
416 case evForward10sec: mplRelSeek( 10 ); break; | |
417 case evBackward10sec: mplRelSeek( -10 ); break; | |
418 case evSetMoviePosition: mplAbsSeek( param ); break; | |
419 | |
1860 | 420 case evIncVolume: vo_x11_putkey( wsGrayMul ); break; |
421 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
|
422 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
|
423 |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
424 case evSetVolume: |
6619
f554e7271587
fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents:
6546
diff
changeset
|
425 guiIntfStruct.Volume=param; |
f554e7271587
fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents:
6546
diff
changeset
|
426 goto set_volume; |
f554e7271587
fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents:
6546
diff
changeset
|
427 case evSetBalance: |
f554e7271587
fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents:
6546
diff
changeset
|
428 guiIntfStruct.Balance=param; |
f554e7271587
fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents:
6546
diff
changeset
|
429 set_volume: |
f554e7271587
fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents:
6546
diff
changeset
|
430 { |
f554e7271587
fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents:
6546
diff
changeset
|
431 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
|
432 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
|
433 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
|
434 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
|
435 // 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
|
436 mixer_setvolume( l,r ); |
f554e7271587
fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents:
6546
diff
changeset
|
437 } |
f554e7271587
fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents:
6546
diff
changeset
|
438 #ifdef USE_OSD |
f554e7271587
fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents:
6546
diff
changeset
|
439 if ( osd_level ) |
f554e7271587
fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents:
6546
diff
changeset
|
440 { |
f554e7271587
fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents:
6546
diff
changeset
|
441 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
|
442 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
|
443 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
|
444 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
|
445 } |
f554e7271587
fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents:
6546
diff
changeset
|
446 #endif |
f554e7271587
fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents:
6546
diff
changeset
|
447 break; |
1847 | 448 |
1693 | 449 |
2994 | 450 case evIconify: |
451 switch ( (int)param ) | |
452 { | |
453 case 0: wsIconify( appMPlayer.mainWindow ); break; | |
454 case 1: wsIconify( appMPlayer.subWindow ); break; | |
455 } | |
456 break; | |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
457 case evDoubleSize: |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
458 if ( guiIntfStruct.Playing ) |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
459 { |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
460 appMPlayer.subWindow.isFullScreen=True; |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
461 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
|
462 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
|
463 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
|
464 wsFullScreen( &appMPlayer.subWindow ); |
5520 | 465 vo_fs=0; |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
466 } |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
467 break; |
6623 | 468 case evNormalSize: |
469 if ( guiIntfStruct.Playing ) | |
470 { | |
471 appMPlayer.subWindow.isFullScreen=True; | |
472 appMPlayer.subWindow.OldX=( wsMaxX - guiIntfStruct.MovieWidth ) / 2; | |
473 appMPlayer.subWindow.OldY=( wsMaxY - guiIntfStruct.MovieHeight ) / 2; | |
474 appMPlayer.subWindow.OldWidth=guiIntfStruct.MovieWidth; appMPlayer.subWindow.OldHeight=guiIntfStruct.MovieHeight; | |
475 wsFullScreen( &appMPlayer.subWindow ); | |
476 vo_fs=0; | |
477 break; | |
478 } else if ( !appMPlayer.subWindow.isFullScreen ) break; | |
2994 | 479 case evFullScreen: |
480 for ( j=0;j<appMPlayer.NumberOfItems + 1;j++ ) | |
481 { | |
482 if ( appMPlayer.Items[j].msg == evFullScreen ) | |
483 { | |
484 appMPlayer.Items[j].tmp=!appMPlayer.Items[j].tmp; | |
485 appMPlayer.Items[j].pressed=appMPlayer.Items[j].tmp; | |
486 } | |
487 } | |
4981 | 488 mplFullScreen(); |
2994 | 489 break; |
1693 | 490 |
7541 | 491 case evSetAspect: |
492 switch ( (int)param ) | |
493 { | |
494 case 2: movie_aspect=16.0f / 9.0f; break; | |
495 case 3: movie_aspect=4.0f / 3.0f; break; | |
496 case 4: movie_aspect=2.35; break; | |
497 case 1: | |
498 default: movie_aspect=-1; | |
499 } | |
500 wsClearWindow( appMPlayer.subWindow ); | |
8039 | 501 #ifdef USE_DVDREAD |
7751 | 502 if ( guiIntfStruct.StreamType == STREAMTYPE_DVD ) goto play_dvd_2; |
8039 | 503 else |
504 #endif | |
505 guiIntfStruct.FilenameChanged=1; | |
7541 | 506 break; |
507 | |
1693 | 508 // --- timer events |
509 case evRedraw: | |
510 mplMainRender=1; | |
511 wsPostRedisplay( &appMPlayer.mainWindow ); | |
512 break; | |
513 // --- system events | |
6218 | 514 #ifdef MP_DEBUG |
1693 | 515 case evNone: |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
516 mp_msg( MSGT_GPLAYER,MSGL_STATUS,"[mw] event none received.\n" ); |
1693 | 517 break; |
518 default: | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
519 mp_msg( MSGT_GPLAYER,MSGL_STATUS,"[mw] unknown event received ( %d,%.2f ).\n",msg,param ); |
1693 | 520 break; |
6218 | 521 #endif |
1693 | 522 } |
523 } | |
524 | |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
525 #define itPLMButton (itNULL - 1) |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
526 #define itPRMButton (itNULL - 2) |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
527 |
1693 | 528 void mplMainMouseHandle( int Button,int X,int Y,int RX,int RY ) |
529 { | |
530 static int itemtype = 0; | |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
531 int i; |
1693 | 532 wItem * item = NULL; |
533 float value = 0.0f; | |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
534 |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
535 static int SelectedItem = -1; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
536 int currentselected = -1; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
537 |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
538 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
|
539 if ( ( appMPlayer.Items[i].pressed != btnDisabled )&& |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
540 ( 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
|
541 { currentselected=i; break; } |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
542 |
1693 | 543 switch ( Button ) |
544 { | |
6651 | 545 case wsPMMouseButton: |
6755 | 546 gtkShow( evHidePopUpMenu,NULL ); |
1693 | 547 mplShowMenu( RX,RY ); |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
548 itemtype=itPRMButton; |
1693 | 549 break; |
6651 | 550 case wsRMMouseButton: |
5919 | 551 mplHideMenu( RX,RY,0 ); |
1693 | 552 break; |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
553 |
1693 | 554 case wsPLMouseButton: |
6755 | 555 gtkShow( evHidePopUpMenu,NULL ); |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
556 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
|
557 SelectedItem=currentselected; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
558 if ( SelectedItem == -1 ) break; // yeees, i'm move the fucking window |
6794 | 559 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
|
560 item=&appMPlayer.Items[SelectedItem]; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
561 itemtype=item->type; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
562 item->pressed=btnPressed; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
563 switch( item->type ) |
1693 | 564 { |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
565 case itButton: |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
566 if ( ( SelectedItem > -1 ) && |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
567 ( ( ( 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
|
568 ( ( 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
|
569 { appMPlayer.Items[SelectedItem].pressed=btnDisabled; } |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
570 break; |
1693 | 571 } |
572 break; | |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
573 case wsRLMouseButton: |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
574 boxMoved=0; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
575 item=&appMPlayer.Items[SelectedItem]; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
576 item->pressed=btnReleased; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
577 SelectedItem=-1; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
578 if ( currentselected == - 1 ) { itemtype=0; break; } |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
579 value=0; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
580 switch( itemtype ) |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
581 { |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
582 case itPotmeter: |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
583 case itHPotmeter: |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
584 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
|
585 mplEventHandling( item->msg,item->value ); |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
586 value=item->value; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
587 break; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
588 } |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
589 mplEventHandling( item->msg,value ); |
6794 | 590 // mplMainRender=1; |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
591 itemtype=0; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
592 break; |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
593 |
6651 | 594 case wsPRMouseButton: |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
595 gtkShow( evShowPopUpMenu,NULL ); |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
596 break; |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
597 |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
598 // --- rolled mouse ... de szar :))) |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
599 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
|
600 case wsP4MouseButton: value= 2.5f; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
601 rollerhandled: |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
602 item=&appMPlayer.Items[currentselected]; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
603 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
|
604 { |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
605 item->value+=value; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
606 btnModify( item->msg,item->value ); |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4465
diff
changeset
|
607 mplEventHandling( item->msg,item->value ); |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
608 } |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
609 break; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
610 |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
611 // --- moving |
1693 | 612 case wsMoveMouse: |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
613 item=&appMPlayer.Items[SelectedItem]; |
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
614 switch ( itemtype ) |
1693 | 615 { |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
616 case itPLMButton: |
2854 | 617 wsMoveWindow( &appMPlayer.mainWindow,False,RX - abs( sx ),RY - abs( sy ) ); |
1693 | 618 mplMainRender=0; |
619 break; | |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
620 case itPRMButton: |
1693 | 621 mplMenuMouseHandle( X,Y,RX,RY ); |
622 break; | |
623 case itPotmeter: | |
1729 | 624 item->value=(float)( X - item->x ) / item->width * 100.0f; |
1693 | 625 goto potihandled; |
626 case itHPotmeter: | |
1729 | 627 item->value=(float)( X - item->x ) / item->width * 100.0f; |
1693 | 628 potihandled: |
2851
b64fa5d25142
add roleld mouse support and some small bugfix. neked jol a testedbe.
pontscho
parents:
2447
diff
changeset
|
629 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
|
630 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
|
631 mplEventHandling( item->msg,item->value ); |
1693 | 632 break; |
633 } | |
634 break; | |
635 } | |
6619
f554e7271587
fix volume handling ( step 2 ) -- add balance support and some code cleanup and fix
pontscho
parents:
6546
diff
changeset
|
636 // if ( Button != wsMoveMouse ) wsPostRedisplay( &appMPlayer.mainWindow ); |
1693 | 637 } |
638 | |
639 int keyPressed = 0; | |
640 | |
6183
a4bbda72ce86
fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents:
6159
diff
changeset
|
641 void mplMainKeyHandle( int KeyCode,int Type,int Key ) |
1693 | 642 { |
643 int msg = evNone; | |
4950 | 644 |
4409 | 645 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
|
646 |
a4bbda72ce86
fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents:
6159
diff
changeset
|
647 if ( !Key ) |
1693 | 648 { |
6183
a4bbda72ce86
fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents:
6159
diff
changeset
|
649 switch ( KeyCode ) |
a4bbda72ce86
fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents:
6159
diff
changeset
|
650 { |
a4bbda72ce86
fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents:
6159
diff
changeset
|
651 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
|
652 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
|
653 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
|
654 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
|
655 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
|
656 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
|
657 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
|
658 } |
a4bbda72ce86
fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents:
6159
diff
changeset
|
659 } |
a4bbda72ce86
fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents:
6159
diff
changeset
|
660 else |
a4bbda72ce86
fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents:
6159
diff
changeset
|
661 { |
a4bbda72ce86
fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents:
6159
diff
changeset
|
662 switch ( Key ) |
a4bbda72ce86
fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents:
6159
diff
changeset
|
663 { |
8302 | 664 case wsEnter: msg=evPlay; break; |
6183
a4bbda72ce86
fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents:
6159
diff
changeset
|
665 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
|
666 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
|
667 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
|
668 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
|
669 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
|
670 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
|
671 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
|
672 case wsXF86Media: msg=evLoad; break; |
8302 | 673 case wsEscape: |
674 if ( appMPlayer.subWindow.isFullScreen ) | |
675 { | |
676 if ( guiIntfStruct.event_struct ) | |
677 { memset( guiIntfStruct.event_struct,0,sizeof( XEvent ) ); guiIntfStruct.event_struct=NULL; } | |
678 mplEventHandling( evNormalSize,0 ); | |
679 break; | |
680 } | |
4409 | 681 |
6183
a4bbda72ce86
fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents:
6159
diff
changeset
|
682 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
|
683 } |
a4bbda72ce86
fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
pontscho
parents:
6159
diff
changeset
|
684 } |
4858 | 685 if ( msg != evNone ) mplEventHandling( msg,0 ); |
1693 | 686 } |
6967
0fa27966ac47
add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents:
6905
diff
changeset
|
687 |
0fa27966ac47
add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents:
6905
diff
changeset
|
688 /* 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
|
689 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
|
690 { |
0fa27966ac47
add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents:
6905
diff
changeset
|
691 struct stat buf; |
0fa27966ac47
add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents:
6905
diff
changeset
|
692 int f = 0; |
0fa27966ac47
add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents:
6905
diff
changeset
|
693 |
0fa27966ac47
add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents:
6905
diff
changeset
|
694 if (num <= 0) |
0fa27966ac47
add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents:
6905
diff
changeset
|
695 return; |
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 /* clear playlist */ |
0fa27966ac47
add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents:
6905
diff
changeset
|
698 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
|
699 |
0fa27966ac47
add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents:
6905
diff
changeset
|
700 /* 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
|
701 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
|
702 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
|
703 plItem* item; |
6977
7242f1840f8d
kde3 dnd fix from Gregory Kovriga and file name handling fix in dnd callback
pontscho
parents:
6967
diff
changeset
|
704 |
6996 | 705 #ifdef USE_ICONV |
6977
7242f1840f8d
kde3 dnd fix from Gregory Kovriga and file name handling fix in dnd callback
pontscho
parents:
6967
diff
changeset
|
706 if ( strchr( str,'%' ) ) |
7242f1840f8d
kde3 dnd fix from Gregory Kovriga and file name handling fix in dnd callback
pontscho
parents:
6967
diff
changeset
|
707 { |
6996 | 708 char * tmp=gconvert_uri_to_filename( str ); |
709 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
|
710 } |
6996 | 711 #endif |
6977
7242f1840f8d
kde3 dnd fix from Gregory Kovriga and file name handling fix in dnd callback
pontscho
parents:
6967
diff
changeset
|
712 |
6967
0fa27966ac47
add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents:
6905
diff
changeset
|
713 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
|
714 /* 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
|
715 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
|
716 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
|
717 |
6967
0fa27966ac47
add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents:
6905
diff
changeset
|
718 /* 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
|
719 /* yes -- Pontscho */ |
0fa27966ac47
add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents:
6905
diff
changeset
|
720 if ( strrchr( str,'/' ) ) |
0fa27966ac47
add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents:
6905
diff
changeset
|
721 { |
6977
7242f1840f8d
kde3 dnd fix from Gregory Kovriga and file name handling fix in dnd callback
pontscho
parents:
6967
diff
changeset
|
722 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
|
723 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
|
724 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
|
725 } 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
|
726 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
|
727 } else { |
0fa27966ac47
add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents:
6905
diff
changeset
|
728 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
|
729 } |
6977
7242f1840f8d
kde3 dnd fix from Gregory Kovriga and file name handling fix in dnd callback
pontscho
parents:
6967
diff
changeset
|
730 free( str ); |
6967
0fa27966ac47
add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents:
6905
diff
changeset
|
731 } |
0fa27966ac47
add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents:
6905
diff
changeset
|
732 |
7009 | 733 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
|
734 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
|
735 mplEventHandling( evPlay,0 ); |
0fa27966ac47
add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents:
6905
diff
changeset
|
736 |
0fa27966ac47
add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents:
6905
diff
changeset
|
737 } |