Mercurial > mplayer.hg
annotate Gui/mplayer/gtk/menu.c @ 7949:0aedfdc5d6ef
fixing segfault
author | michael |
---|---|
date | Tue, 29 Oct 2002 01:20:51 +0000 |
parents | 1efdf16883a0 |
children | e5dda05f9aab |
rev | line source |
---|---|
2901 | 1 |
2 #include <stdio.h> | |
3 #include <stdlib.h> | |
3054 | 4 #include <string.h> |
5 | |
6 #include "../../../config.h" | |
3587 | 7 #include "../../../help_mp.h" |
7821
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
8 #include "../../../mplayer.h" |
2901 | 9 |
10 #include "../../events.h" | |
3054 | 11 |
2901 | 12 #include "menu.h" |
13 #include "../widgets.h" | |
7821
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
14 #include "../app.h" |
2901 | 15 |
16 void ActivateMenuItem( int Item ) | |
17 { | |
3618 | 18 // fprintf( stderr,"[menu] item: %d.%d\n",Item&0xffff,Item>>16 ); |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
3618
diff
changeset
|
19 gtkPopupMenu=Item & 0x0000ffff; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
3618
diff
changeset
|
20 gtkPopupMenuParam=Item >> 16; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
3618
diff
changeset
|
21 mplEventHandling( Item & 0x0000ffff,Item >> 16 ); |
2901 | 22 } |
23 | |
7821
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
24 GtkWidget * AddMenuCheckItem(GtkWidget* Menu,char* label, gboolean state, int Number) |
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
25 { |
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
26 GtkWidget * Item = NULL; |
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
27 Item=gtk_check_menu_item_new_with_label( label ); |
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
28 gtk_menu_append( GTK_MENU( Menu ),Item ); |
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
29 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(Item),state); |
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
30 gtk_signal_connect_object( GTK_OBJECT(Item),"activate", |
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
31 GTK_SIGNAL_FUNC(ActivateMenuItem),(gpointer)Number ); |
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
32 gtk_widget_show( Item ); |
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
33 return Item; |
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
34 } |
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
35 |
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
36 |
2901 | 37 GtkWidget * AddMenuItem( GtkWidget * Menu,char * label,int Number ) |
38 { | |
39 GtkWidget * Item = NULL; | |
40 Item=gtk_menu_item_new_with_label( label ); | |
41 gtk_menu_append( GTK_MENU( Menu ),Item ); | |
42 gtk_signal_connect_object( GTK_OBJECT(Item),"activate", | |
43 GTK_SIGNAL_FUNC(ActivateMenuItem),(gpointer)Number ); | |
44 gtk_widget_show( Item ); | |
45 return Item; | |
46 } | |
47 | |
48 GtkWidget * AddSubMenu( GtkWidget * Menu,char * label ) | |
49 { | |
50 GtkWidget * Item = NULL; | |
51 GtkWidget * SubItem = NULL; | |
52 | |
53 SubItem=gtk_menu_item_new_with_label( label ); | |
54 gtk_menu_append( GTK_MENU( Menu ),SubItem ); | |
55 gtk_widget_show( SubItem ); | |
56 | |
57 Item=gtk_menu_new(); | |
58 gtk_widget_show( Item ); | |
59 gtk_menu_item_set_submenu( GTK_MENU_ITEM( SubItem ),Item ); | |
60 return Item; | |
61 } | |
62 | |
63 GtkWidget * AddSeparator( GtkWidget * Menu ) | |
64 { | |
65 GtkWidget * Item = NULL; | |
66 | |
67 Item=gtk_menu_item_new (); | |
68 gtk_widget_show( Item ); | |
69 gtk_container_add( GTK_CONTAINER( Menu ),Item ); | |
70 gtk_widget_set_sensitive( Item,FALSE ); | |
71 | |
72 return Item; | |
73 } | |
74 | |
3054 | 75 typedef struct |
76 { | |
77 int id; | |
78 char * name; | |
79 } Languages_t; | |
80 | |
81 #define lng( a,b ) ( (int)(a) * 256 + b ) | |
6651 | 82 static Languages_t Languages[] = |
3054 | 83 { |
84 { lng( 'a','b' ), "Abkhazian" }, | |
85 { lng( 'a','a' ), "Afar" }, | |
86 { lng( 'a','f' ), "Afrikaans" }, | |
87 { lng( 's','q' ), "Albanian" }, | |
88 { lng( 'a','m' ), "Amharic" }, | |
89 { lng( 'a','r' ), "Arabic" }, | |
90 { lng( 'h','y' ), "Armenian" }, | |
91 { lng( 'a','s' ), "Assamese" }, | |
92 { lng( 'a','e' ), "Avestan" }, | |
93 { lng( 'a','y' ), "Aymara" }, | |
94 { lng( 'a','z' ), "Azerbaijani" }, | |
95 { lng( 'b','a' ), "Bashkir" }, | |
96 { lng( 'e','u' ), "Basque" }, | |
97 { lng( 'b','e' ), "Belarusian" }, | |
98 { lng( 'b','n' ), "Bengali" }, | |
99 { lng( 'b','h' ), "Bihari" }, | |
100 { lng( 'b','i' ), "Bislama" }, | |
101 { lng( 'b','s' ), "Bosnian" }, | |
102 { lng( 'b','r' ), "Breton" }, | |
103 { lng( 'b','g' ), "Bulgarian" }, | |
104 { lng( 'm','y' ), "Burmese" }, | |
105 { lng( 'c','a' ), "Catalan" }, | |
106 { lng( 'c','h' ), "Chamorro" }, | |
107 { lng( 'c','e' ), "Chechen" }, | |
108 { lng( 'n','y' ), "Chichewa;Nyanja" }, | |
109 { lng( 'z','h' ), "Chinese" }, | |
110 { lng( 'c','u' ), "ChurchSlavic" }, | |
111 { lng( 'c','v' ), "Chuvash" }, | |
112 { lng( 'k','w' ), "Cornish" }, | |
113 { lng( 'c','o' ), "Corsican" }, | |
114 { lng( 'h','r' ), "Croatian" }, | |
115 { lng( 'c','s' ), "Czech" }, | |
116 { lng( 'd','a' ), "Danish" }, | |
117 { lng( 'n','l' ), "Dutch" }, | |
118 { lng( 'd','z' ), "Dzongkha" }, | |
119 { lng( 'e','n' ), "English" }, | |
120 { lng( 'e','o' ), "Esperanto" }, | |
121 { lng( 'e','t' ), "Estonian" }, | |
122 { lng( 'f','o' ), "Faroese" }, | |
123 { lng( 'f','j' ), "Fijian" }, | |
124 { lng( 'f','i' ), "Finnish" }, | |
125 { lng( 'f','r' ), "French" }, | |
126 { lng( 'f','y' ), "Frisian" }, | |
127 { lng( 'g','d' ), "Gaelic(Scots" }, | |
128 { lng( 'g','l' ), "Gallegan" }, | |
129 { lng( 'k','a' ), "Georgian" }, | |
130 { lng( 'd','e' ), "German" }, | |
131 { lng( 'e','l' ), "Greek" }, | |
132 { lng( 'g','n' ), "Guarani" }, | |
133 { lng( 'g','u' ), "Gujarati" }, | |
134 { lng( 'h','a' ), "Hausa" }, | |
135 { lng( 'h','e' ), "Hebrew" }, | |
136 { lng( 'i','w' ), "Hebrew" }, | |
137 { lng( 'h','z' ), "Herero" }, | |
138 { lng( 'h','i' ), "Hindi" }, | |
139 { lng( 'h','o' ), "HiriMotu" }, | |
140 { lng( 'h','u' ), "Hungarian" }, | |
141 { lng( 'i','s' ), "Icelandic" }, | |
142 { lng( 'i','d' ), "Indonesian" }, | |
143 { lng( 'i','n' ), "Indonesian" }, | |
144 { lng( 'i','a' ), "Interlingua" }, | |
145 { lng( 'i','e' ), "Interlingue" }, | |
146 { lng( 'i','u' ), "Inuktitut" }, | |
147 { lng( 'i','k' ), "Inupiaq" }, | |
148 { lng( 'g','a' ), "Irish" }, | |
149 { lng( 'i','t' ), "Italian" }, | |
150 { lng( 'j','a' ), "Japanese" }, | |
151 { lng( 'j','v' ), "Javanese" }, | |
152 { lng( 'j','w' ), "Javanese" }, | |
153 { lng( 'k','l' ), "Kalaallisut" }, | |
154 { lng( 'k','n' ), "Kannada" }, | |
155 { lng( 'k','s' ), "Kashmiri" }, | |
156 { lng( 'k','k' ), "Kazakh" }, | |
157 { lng( 'k','m' ), "Khmer" }, | |
158 { lng( 'k','i' ), "Kikuyu" }, | |
159 { lng( 'r','w' ), "Kinyarwanda" }, | |
160 { lng( 'k','y' ), "Kirghiz" }, | |
161 { lng( 'k','v' ), "Komi" }, | |
162 { lng( 'k','o' ), "Korean" }, | |
163 { lng( 'k','j' ), "Kuanyama" }, | |
164 { lng( 'k','u' ), "Kurdish" }, | |
165 { lng( 'l','o' ), "Lao" }, | |
166 { lng( 'l','a' ), "Latin" }, | |
167 { lng( 'l','v' ), "Latvian" }, | |
168 { lng( 'l','b' ), "Letzeburgesch" }, | |
169 { lng( 'l','n' ), "Lingala" }, | |
170 { lng( 'l','t' ), "Lithuanian" }, | |
171 { lng( 'm','k' ), "Macedonian" }, | |
172 { lng( 'm','g' ), "Malagasy" }, | |
173 { lng( 'm','s' ), "Malay" }, | |
174 { lng( 'm','l' ), "Malayalam" }, | |
175 { lng( 'm','t' ), "Maltese" }, | |
176 { lng( 'g','v' ), "Manx" }, | |
177 { lng( 'm','i' ), "Maori" }, | |
178 { lng( 'm','r' ), "Marathi" }, | |
179 { lng( 'm','h' ), "Marshall" }, | |
180 { lng( 'm','o' ), "Moldavian" }, | |
181 { lng( 'm','n' ), "Mongolian" }, | |
182 { lng( 'n','a' ), "Nauru" }, | |
183 { lng( 'n','v' ), "Navajo" }, | |
184 { lng( 'n','d' ), "North Ndebele" }, | |
185 { lng( 'n','r' ), "South Ndebele" }, | |
186 { lng( 'n','g' ), "Ndonga" }, | |
187 { lng( 'n','e' ), "Nepali" }, | |
188 { lng( 's','e' ), "NorthernSami" }, | |
189 { lng( 'n','o' ), "Norwegian" }, | |
190 { lng( 'n','b' ), "NorwegianBokmål" }, | |
191 { lng( 'n','n' ), "NorwegianNynorsk" }, | |
192 { lng( 'n','y' ), "Nyanja;Chichewa" }, | |
193 { lng( 'o','c' ), "Occitan(post1500;Provençal" }, | |
194 { lng( 'o','r' ), "Oriya" }, | |
195 { lng( 'o','m' ), "Oromo" }, | |
196 { lng( 'o','s' ), "Ossetian;Ossetic" }, | |
197 { lng( 'p','i' ), "Pali" }, | |
198 { lng( 'p','a' ), "Panjabi" }, | |
199 { lng( 'f','a' ), "Persian" }, | |
200 { lng( 'p','l' ), "Polish" }, | |
201 { lng( 'p','t' ), "Portuguese" }, | |
202 { lng( 'o','c' ), "Provençal;Occitan(post1500" }, | |
203 { lng( 'p','s' ), "Pushto" }, | |
204 { lng( 'q','u' ), "Quechua" }, | |
205 { lng( 'r','m' ), "Raeto-Romance" }, | |
206 { lng( 'r','o' ), "Romanian" }, | |
207 { lng( 'r','n' ), "Rundi" }, | |
208 { lng( 'r','u' ), "Russian" }, | |
209 { lng( 's','m' ), "Samoan" }, | |
210 { lng( 's','g' ), "Sango" }, | |
211 { lng( 's','a' ), "Sanskrit" }, | |
212 { lng( 's','c' ), "Sardinian" }, | |
213 { lng( 's','r' ), "Serbian" }, | |
214 { lng( 's','n' ), "Shona" }, | |
215 { lng( 's','d' ), "Sindhi" }, | |
216 { lng( 's','i' ), "Sinhalese" }, | |
217 { lng( 's','k' ), "Slovak" }, | |
218 { lng( 's','l' ), "Slovenian" }, | |
219 { lng( 's','o' ), "Somali" }, | |
220 { lng( 's','t' ), "Sotho" }, | |
221 { lng( 'e','s' ), "Spanish" }, | |
222 { lng( 's','u' ), "Sundanese" }, | |
223 { lng( 's','w' ), "Swahili" }, | |
224 { lng( 's','s' ), "Swati" }, | |
225 { lng( 's','v' ), "Swedish" }, | |
226 { lng( 't','l' ), "Tagalog" }, | |
227 { lng( 't','y' ), "Tahitian" }, | |
228 { lng( 't','g' ), "Tajik" }, | |
229 { lng( 't','a' ), "Tamil" }, | |
230 { lng( 't','t' ), "Tatar" }, | |
231 { lng( 't','e' ), "Telugu" }, | |
232 { lng( 't','h' ), "Thai" }, | |
233 { lng( 'b','o' ), "Tibetan" }, | |
234 { lng( 't','i' ), "Tigrinya" }, | |
235 { lng( 't','o' ), "Tonga" }, | |
236 { lng( 't','s' ), "Tsonga" }, | |
237 { lng( 't','n' ), "Tswana" }, | |
238 { lng( 't','r' ), "Turkish" }, | |
239 { lng( 't','k' ), "Turkmen" }, | |
240 { lng( 't','w' ), "Twi" }, | |
241 { lng( 'u','g' ), "Uighur" }, | |
242 { lng( 'u','k' ), "Ukrainian" }, | |
243 { lng( 'u','r' ), "Urdu" }, | |
244 { lng( 'u','z' ), "Uzbek" }, | |
245 { lng( 'v','i' ), "Vietnamese" }, | |
246 { lng( 'v','o' ), "Volapük" }, | |
247 { lng( 'c','y' ), "Welsh" }, | |
248 { lng( 'w','o' ), "Wolof" }, | |
249 { lng( 'x','h' ), "Xhosa" }, | |
250 { lng( 'y','i' ), "Yiddish" }, | |
251 { lng( 'j','i' ), "Yiddish" }, | |
252 { lng( 'y','o' ), "Yoruba" }, | |
253 { lng( 'z','a' ), "Zhuang" }, | |
254 { lng( 'z','u' ), "Zulu" }, | |
255 }; | |
256 #undef lng | |
257 | |
6651 | 258 static char * ChannelTypes[] = |
259 { "Dolby Digital","","Mpeg1","Mpeg2","PCM","","Digital Theatre System" }; | |
260 static char * ChannelNumbers[] = | |
261 { "","Stereo","","","","5.1" }; | |
262 | |
3054 | 263 char * GetLanguage( int language ) |
264 { | |
6651 | 265 unsigned int i; |
3054 | 266 for ( i=0;i<sizeof( Languages ) / sizeof( Languages_t );i++ ) |
267 if ( Languages[i].id == language ) return Languages[i].name; | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
3618
diff
changeset
|
268 return NULL; |
3054 | 269 } |
270 | |
2901 | 271 GtkWidget * DVDSubMenu; |
2980 | 272 GtkWidget * DVDTitleMenu; |
3054 | 273 GtkWidget * DVDChapterMenu; |
2940 | 274 GtkWidget * DVDAudioLanguageMenu; |
275 GtkWidget * DVDSubtitleLanguageMenu; | |
7541 | 276 GtkWidget * AspectMenu; |
6280 | 277 GtkWidget * VCDSubMenu; |
278 GtkWidget * VCDTitleMenu; | |
279 | |
2901 | 280 GtkWidget * create_PopUpMenu( void ) |
281 { | |
282 GtkWidget * Menu = NULL; | |
283 GtkWidget * SubMenu = NULL; | |
3590 | 284 GtkWidget * MenuItem = NULL; |
2901 | 285 |
286 Menu=gtk_menu_new(); | |
287 | |
3587 | 288 AddMenuItem( Menu,MSGTR_MENU_AboutMPlayer" ", evAbout ); |
2901 | 289 AddSeparator( Menu ); |
3587 | 290 SubMenu=AddSubMenu( Menu,MSGTR_MENU_Open ); |
291 AddMenuItem( SubMenu,MSGTR_MENU_PlayFile" ", evLoadPlay ); | |
6280 | 292 #ifdef HAVE_VCD |
293 AddMenuItem( SubMenu,MSGTR_MENU_PlayVCD, evPlayVCD ); | |
294 #endif | |
3054 | 295 #ifdef USE_DVDREAD |
3587 | 296 AddMenuItem( SubMenu,MSGTR_MENU_PlayDVD, evPlayDVD ); |
3054 | 297 #endif |
6298 | 298 AddMenuItem( SubMenu,MSGTR_MENU_PlayURL, evSetURL ); |
3587 | 299 AddMenuItem( SubMenu,MSGTR_MENU_LoadSubtitle" ", evLoadSubtitle ); |
7169 | 300 AddMenuItem( SubMenu,MSGTR_MENU_DropSubtitle,evDropSubtitle ); |
6623 | 301 AddMenuItem( SubMenu,MSGTR_MENU_LoadExternAudioFile, evLoadAudioFile ); |
3587 | 302 SubMenu=AddSubMenu( Menu,MSGTR_MENU_Playing ); |
303 AddMenuItem( SubMenu,MSGTR_MENU_Play" ", evPlay ); | |
304 AddMenuItem( SubMenu,MSGTR_MENU_Pause, evPause ); | |
305 AddMenuItem( SubMenu,MSGTR_MENU_Stop, evStop ); | |
306 AddMenuItem( SubMenu,MSGTR_MENU_NextStream, evPrev ); | |
307 AddMenuItem( SubMenu,MSGTR_MENU_PrevStream, evNext ); | |
3054 | 308 // AddSeparator( SubMenu ); |
309 // AddMenuItem( SubMenu,"Back 10 sec", evBackward10sec ); | |
310 // AddMenuItem( SubMenu,"Fwd 10 sec", evForward10sec ); | |
311 // AddMenuItem( SubMenu,"Back 1 min", evBackward1min ); | |
312 // AddMenuItem( SubMenu,"Fwd 1 min", evForward1min ); | |
6903 | 313 // SubMenu=AddSubMenu( Menu,MSGTR_MENU_Size ); |
314 // AddMenuItem( SubMenu,MSGTR_MENU_NormalSize" ", evNormalSize ); | |
315 // AddMenuItem( SubMenu,MSGTR_MENU_DoubleSize, evDoubleSize ); | |
316 // AddMenuItem( SubMenu,MSGTR_MENU_FullScreen, evFullScreen ); | |
6280 | 317 #ifdef HAVE_VCD |
318 VCDSubMenu=AddSubMenu( Menu,MSGTR_MENU_VCD ); | |
319 AddMenuItem( VCDSubMenu,MSGTR_MENU_PlayDisc,evPlayVCD ); | |
320 AddSeparator( VCDSubMenu ); | |
321 VCDTitleMenu=AddSubMenu( VCDSubMenu,MSGTR_MENU_Titles ); | |
322 if ( guiIntfStruct.VCDTracks ) | |
323 { | |
324 char tmp[32]; int i; | |
325 for ( i=0;i < guiIntfStruct.VCDTracks;i++ ) | |
326 { | |
7583 | 327 snprintf( tmp,32,MSGTR_MENU_Title,i+1 ); |
6280 | 328 AddMenuItem( VCDTitleMenu,tmp,( (i+1) << 16 ) + evSetVCDTrack ); |
329 } | |
330 } | |
331 else | |
332 { | |
333 MenuItem=AddMenuItem( VCDTitleMenu,MSGTR_MENU_None,evNone ); | |
334 gtk_widget_set_sensitive( MenuItem,FALSE ); | |
335 } | |
336 #endif | |
3054 | 337 #ifdef USE_DVDREAD |
3587 | 338 DVDSubMenu=AddSubMenu( Menu,MSGTR_MENU_DVD ); |
339 AddMenuItem( DVDSubMenu,MSGTR_MENU_PlayDisc" ", evPlayDVD ); | |
6794 | 340 // AddMenuItem( DVDSubMenu,MSGTR_MENU_ShowDVDMenu, evNone ); |
2901 | 341 AddSeparator( DVDSubMenu ); |
3587 | 342 DVDTitleMenu=AddSubMenu( DVDSubMenu,MSGTR_MENU_Titles ); |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
3618
diff
changeset
|
343 if ( guiIntfStruct.DVD.titles ) |
3054 | 344 { |
345 char tmp[32]; int i; | |
7821
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
346 for ( i=1 ; i<= guiIntfStruct.DVD.titles;i++ ) |
3054 | 347 { |
7821
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
348 snprintf( tmp,32,MSGTR_MENU_Title,i); |
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
349 AddMenuCheckItem( DVDTitleMenu,tmp, |
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
350 guiIntfStruct.DVD.current_title == i, |
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
351 (i << 16) + evSetDVDTitle ); |
3054 | 352 } |
353 } | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
3618
diff
changeset
|
354 else |
3590 | 355 { |
356 MenuItem=AddMenuItem( DVDTitleMenu,MSGTR_MENU_None,evNone ); | |
357 gtk_widget_set_sensitive( MenuItem,FALSE ); | |
358 } | |
3587 | 359 DVDChapterMenu=AddSubMenu( DVDSubMenu,MSGTR_MENU_Chapters ); |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
3618
diff
changeset
|
360 if ( guiIntfStruct.DVD.chapters ) |
3054 | 361 { |
362 char tmp[32]; int i; | |
7821
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
363 for ( i=1;i <= guiIntfStruct.DVD.chapters;i++ ) |
3054 | 364 { |
7821
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
365 snprintf( tmp,32,MSGTR_MENU_Chapter,i ); |
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
366 AddMenuCheckItem( DVDChapterMenu,tmp,guiIntfStruct.DVD.current_chapter == i, |
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
367 ( i << 16 ) + evSetDVDChapter ); |
3054 | 368 } |
369 } | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
3618
diff
changeset
|
370 else |
3590 | 371 { |
372 MenuItem=AddMenuItem( DVDChapterMenu,MSGTR_MENU_None,evNone ); | |
373 gtk_widget_set_sensitive( MenuItem,FALSE ); | |
374 } | |
3587 | 375 DVDAudioLanguageMenu=AddSubMenu( DVDSubMenu,MSGTR_MENU_AudioLanguages ); |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
3618
diff
changeset
|
376 if ( guiIntfStruct.DVD.nr_of_audio_channels ) |
3054 | 377 { |
378 char tmp[64]; int i; | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
3618
diff
changeset
|
379 for ( i=0;i < guiIntfStruct.DVD.nr_of_audio_channels;i++ ) |
3054 | 380 { |
6651 | 381 snprintf( tmp,64,"%s - %s %s",GetLanguage( guiIntfStruct.DVD.audio_streams[i].language ), |
382 ChannelTypes[ guiIntfStruct.DVD.audio_streams[i].type ], | |
383 ChannelNumbers[ guiIntfStruct.DVD.audio_streams[i].channels ] ); | |
7821
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
384 AddMenuCheckItem( DVDAudioLanguageMenu,tmp, |
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
385 audio_id == guiIntfStruct.DVD.audio_streams[i].id, |
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
386 ( guiIntfStruct.DVD.audio_streams[i].id << 16 ) + evSetDVDAudio ); |
3054 | 387 } |
388 } | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
3618
diff
changeset
|
389 else |
3590 | 390 { |
391 MenuItem=AddMenuItem( DVDAudioLanguageMenu,MSGTR_MENU_None,evNone ); | |
392 gtk_widget_set_sensitive( MenuItem,FALSE ); | |
393 } | |
3587 | 394 DVDSubtitleLanguageMenu=AddSubMenu( DVDSubMenu,MSGTR_MENU_SubtitleLanguages ); |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
3618
diff
changeset
|
395 if ( guiIntfStruct.DVD.nr_of_subtitles ) |
3054 | 396 { |
397 char tmp[64]; int i; | |
7821
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
398 AddMenuItem( DVDSubtitleLanguageMenu,MSGTR_MENU_None,( (unsigned short)-1 << 16 ) + evSetDVDSubtitle ); |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
3618
diff
changeset
|
399 for ( i=0;i < guiIntfStruct.DVD.nr_of_subtitles;i++ ) |
3054 | 400 { |
7583 | 401 snprintf( tmp,64,"%s",GetLanguage( guiIntfStruct.DVD.subtitles[i].language ) ); |
7821
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
402 AddMenuCheckItem( DVDSubtitleLanguageMenu,tmp, |
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
403 dvdsub_id == guiIntfStruct.DVD.subtitles[i].id, |
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
404 ( guiIntfStruct.DVD.subtitles[i].id << 16 ) + evSetDVDSubtitle ); |
3054 | 405 } |
406 } | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
3618
diff
changeset
|
407 else |
3590 | 408 { |
409 MenuItem=AddMenuItem( DVDSubtitleLanguageMenu,MSGTR_MENU_None,evNone ); | |
410 gtk_widget_set_sensitive( MenuItem,FALSE ); | |
411 } | |
3054 | 412 #endif |
7821
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
413 AspectMenu=AddSubMenu( Menu,MSGTR_MENU_AspectRatio ); |
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
414 AddMenuItem( AspectMenu,MSGTR_MENU_Original,( 1 << 16 ) + evSetAspect ); |
7541 | 415 AddMenuItem( AspectMenu,"16:9",( 2 << 16 ) + evSetAspect ); |
416 AddMenuItem( AspectMenu,"4:3",( 3 << 16 ) + evSetAspect ); | |
417 AddMenuItem( AspectMenu,"2.35",( 4 << 16 ) + evSetAspect ); | |
418 | |
2901 | 419 AddSeparator( Menu ); |
7821
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
420 AddMenuItem( Menu,MSGTR_MENU_Mute, evMute ); |
3587 | 421 AddMenuItem( Menu,MSGTR_MENU_PlayList, evPlayList ); |
422 AddMenuItem( Menu,MSGTR_MENU_SkinBrowser, evSkinBrowser ); | |
423 AddMenuItem( Menu,MSGTR_MENU_Preferences, evPreferences ); | |
6627 | 424 AddMenuItem( Menu,MSGTR_Equalizer, evEqualizer ); |
2901 | 425 AddSeparator( Menu ); |
7821
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
426 #if 0 |
6903 | 427 AddMenuItem( Menu,MSGTR_MENU_NormalSize" ", evNormalSize ); |
428 AddMenuItem( Menu,MSGTR_MENU_DoubleSize, evDoubleSize ); | |
429 AddMenuItem( Menu,MSGTR_MENU_FullScreen, evFullScreen ); | |
7821
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
430 #else |
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
431 { |
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
432 int b1 = 0, b2 = 0; |
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
433 if ( !appMPlayer.subWindow.isFullScreen && guiIntfStruct.Playing ) |
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
434 { |
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
435 if ( ( appMPlayer.subWindow.Width == guiIntfStruct.MovieWidth * 2 )&& |
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
436 ( appMPlayer.subWindow.Height == guiIntfStruct.MovieHeight * 2 ) ) b2=1; |
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
437 else b1=1; |
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
438 } else b1=!appMPlayer.subWindow.isFullScreen; |
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
439 AddMenuCheckItem( Menu,MSGTR_MENU_NormalSize" ",b1,evNormalSize ); |
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
440 AddMenuCheckItem( Menu,MSGTR_MENU_DoubleSize,b2,evDoubleSize ); |
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
441 } |
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
442 AddMenuCheckItem( Menu,MSGTR_MENU_FullScreen,appMPlayer.subWindow.isFullScreen,evFullScreen ); |
1efdf16883a0
add and extended Gregory Kovriga's <gkovriga@techunix.technion.ac.il> patch
pontscho
parents:
7583
diff
changeset
|
443 #endif |
6903 | 444 AddSeparator( Menu ); |
3587 | 445 AddMenuItem( Menu,MSGTR_MENU_Exit, evExit ); |
2901 | 446 |
447 return Menu; | |
448 } |