Mercurial > mplayer.hg
annotate gui/dialog/menu.c @ 36672:e1e9f2ea17c9
Revise GUI help message texts.
Remove colons, ellipses and newlines from the end of the texts.
This reduces the amount of texts to be translated, enhances reusability
and harmonizes the visual appearance of the different GUI localizations.
Additionally, make the necessary code changes.
author | ib |
---|---|
date | Fri, 31 Jan 2014 16:37:52 +0000 |
parents | 1862771a5ba9 |
children | acb4a92aba16 |
rev | line source |
---|---|
33572 | 1 /* |
2 * This file is part of MPlayer. | |
3 * | |
4 * MPlayer is free software; you can redistribute it and/or modify | |
5 * it under the terms of the GNU General Public License as published by | |
6 * the Free Software Foundation; either version 2 of the License, or | |
7 * (at your option) any later version. | |
8 * | |
9 * MPlayer is distributed in the hope that it will be useful, | |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 * GNU General Public License for more details. | |
13 * | |
14 * You should have received a copy of the GNU General Public License along | |
15 * with MPlayer; if not, write to the Free Software Foundation, Inc., | |
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
17 */ | |
18 | |
19 #include <stdio.h> | |
20 #include <stdlib.h> | |
21 #include <string.h> | |
22 | |
23 #include "config.h" | |
24 #include "help_mp.h" | |
25 #include "access_mpcontext.h" | |
26 #include "mixer.h" | |
27 #include "mpcommon.h" | |
28 | |
29 #include "menu.h" | |
35529 | 30 #include "dialog.h" |
35772 | 31 #include "gui/ui/actions.h" |
35525 | 32 #include "gui/app/app.h" |
33 #include "gui/app/gui.h" | |
33738 | 34 #include "gui/interface.h" |
33572 | 35 |
36 #include "stream/stream.h" | |
36273 | 37 #include "libavutil/common.h" |
38 #include "libmpcodecs/vd.h" | |
33572 | 39 #include "libmpdemux/demuxer.h" |
40 #include "libmpdemux/stheader.h" | |
41 #include "libavutil/avstring.h" | |
42 | |
35526 | 43 #include "pixmaps/about.xpm" |
44 #include "pixmaps/half.xpm" | |
45 #include "pixmaps/normal.xpm" | |
46 #include "pixmaps/double.xpm" | |
47 #include "pixmaps/full.xpm" | |
48 #include "pixmaps/exit.xpm" | |
49 #include "pixmaps/prefs.xpm" | |
50 #include "pixmaps/equalizer.xpm" | |
51 #include "pixmaps/playlist.xpm" | |
52 #include "pixmaps/skin.xpm" | |
53 #include "pixmaps/sound.xpm" | |
54 #include "pixmaps/open.xpm" | |
55 #include "pixmaps/play.xpm" | |
56 #include "pixmaps/stop.xpm" | |
57 #include "pixmaps/pause.xpm" | |
58 #include "pixmaps/prev.xpm" | |
59 #include "pixmaps/next.xpm" | |
60 #include "pixmaps/aspect.xpm" | |
61 #include "pixmaps/aspect11.xpm" | |
62 #include "pixmaps/aspect169.xpm" | |
63 #include "pixmaps/aspect235.xpm" | |
64 #include "pixmaps/aspect43.xpm" | |
65 #include "pixmaps/file2.xpm" | |
66 #include "pixmaps/url.xpm" | |
67 #include "pixmaps/sub.xpm" | |
68 #include "pixmaps/nosub.xpm" | |
69 #include "pixmaps/empty.xpm" | |
70 #include "pixmaps/loadeaf.xpm" | |
71 #include "pixmaps/title.xpm" | |
72 #include "pixmaps/subtitle.xpm" | |
34387 | 73 #ifdef CONFIG_CDDA |
35526 | 74 #include "pixmaps/cd.xpm" |
75 #include "pixmaps/playcd.xpm" | |
34387 | 76 #endif |
34077 | 77 #ifdef CONFIG_VCD |
35526 | 78 #include "pixmaps/vcd.xpm" |
79 #include "pixmaps/playvcd.xpm" | |
34077 | 80 #endif |
33572 | 81 #ifdef CONFIG_DVDREAD |
35526 | 82 #include "pixmaps/dvd.xpm" |
83 #include "pixmaps/playdvd.xpm" | |
84 #include "pixmaps/chapter.xpm" | |
85 #include "pixmaps/dolby.xpm" | |
36665 | 86 #include "pixmaps/audio.xpm" |
36666 | 87 #include "pixmaps/video.xpm" |
34422
b1f2949ca18d
Use empty1px.xpm instead of empty.xpm for check item (and similar) menus.
ib
parents:
34421
diff
changeset
|
88 #endif |
36429 | 89 #ifdef CONFIG_TV |
90 #include "pixmaps/tv.xpm" | |
91 #endif | |
35526 | 92 #include "pixmaps/empty1px.xpm" |
33572 | 93 |
36029
49be954ad61a
Move variable declarations and definitions where they belong.
ib
parents:
36028
diff
changeset
|
94 int gtkPopupMenu; |
49be954ad61a
Move variable declarations and definitions where they belong.
ib
parents:
36028
diff
changeset
|
95 int gtkPopupMenuParam; |
49be954ad61a
Move variable declarations and definitions where they belong.
ib
parents:
36028
diff
changeset
|
96 |
33572 | 97 static void ActivateMenuItem( int Item ) |
98 { | |
99 // fprintf( stderr,"[menu] item: %d.%d\n",Item&0xffff,Item>>16 ); | |
100 gtkPopupMenu=Item & 0x0000ffff; | |
101 gtkPopupMenuParam=Item >> 16; | |
35773 | 102 uiEvent( Item & 0x0000ffff,Item >> 16 ); |
33572 | 103 } |
104 | |
105 static GtkWidget * AddMenuCheckItem(GtkWidget *window1, const char * immagine_xpm, GtkWidget* Menu,const char* label, gboolean state, int Number) | |
106 { | |
107 GtkWidget * Label = NULL; | |
108 GtkWidget * Pixmap = NULL; | |
109 GtkWidget * hbox = NULL; | |
110 GtkWidget * Item = NULL; | |
111 | |
112 GdkPixmap *PixmapIcon = NULL; | |
113 GdkColor transparent; | |
114 GdkBitmap *MaskIcon = NULL; | |
115 | |
116 PixmapIcon = gdk_pixmap_create_from_xpm_d (window1->window, &MaskIcon, &transparent,(gchar **)immagine_xpm ); | |
117 Pixmap = gtk_pixmap_new (PixmapIcon, MaskIcon); | |
118 gdk_pixmap_unref (PixmapIcon); | |
119 | |
120 Item=gtk_check_menu_item_new(); | |
121 Label = gtk_label_new (label); | |
122 | |
123 hbox = gtk_hbox_new (FALSE, 8); | |
124 gtk_box_pack_start (GTK_BOX (hbox), Pixmap, FALSE, FALSE, 0); | |
125 gtk_box_pack_start (GTK_BOX (hbox), Label, FALSE, FALSE, 0); | |
126 gtk_container_add (GTK_CONTAINER (Item), hbox); | |
127 | |
128 gtk_menu_append( GTK_MENU( Menu ),Item ); | |
129 | |
130 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(Item),state); | |
131 gtk_signal_connect_object( GTK_OBJECT(Item),"activate", | |
132 GTK_SIGNAL_FUNC(ActivateMenuItem),(gpointer)Number ); | |
133 gtk_menu_item_right_justify (GTK_MENU_ITEM (Item)); | |
134 gtk_widget_show_all(Item); | |
135 | |
136 return Item; | |
137 } | |
138 GtkWidget * AddMenuItem( GtkWidget *window1, const char * immagine_xpm, GtkWidget * SubMenu,const char * label,int Number ) | |
139 { | |
140 GtkWidget * Label = NULL; | |
141 GtkWidget * Pixmap = NULL; | |
142 GtkWidget * hbox = NULL; | |
143 GtkWidget * Item = NULL; | |
144 GdkPixmap * PixmapIcon = NULL; | |
145 GdkColor transparent; | |
146 GdkBitmap * MaskIcon = NULL; | |
147 | |
148 PixmapIcon = gdk_pixmap_create_from_xpm_d (window1->window, &MaskIcon, &transparent,(gchar **)immagine_xpm ); | |
149 Pixmap = gtk_pixmap_new (PixmapIcon, MaskIcon); | |
150 gdk_pixmap_unref (PixmapIcon); | |
151 | |
152 Item=gtk_menu_item_new(); | |
153 Label = gtk_label_new (label); | |
154 | |
155 hbox = gtk_hbox_new (FALSE, 8); | |
156 gtk_box_pack_start (GTK_BOX (hbox), Pixmap, FALSE, FALSE, 0); | |
157 gtk_box_pack_start (GTK_BOX (hbox), Label, FALSE, FALSE, 0); | |
158 gtk_container_add (GTK_CONTAINER (Item), hbox); | |
159 | |
160 | |
161 gtk_menu_append( GTK_MENU( SubMenu ),Item ); | |
162 gtk_signal_connect_object( GTK_OBJECT(Item),"activate", | |
163 GTK_SIGNAL_FUNC(ActivateMenuItem),(gpointer)Number ); | |
164 | |
165 gtk_menu_item_right_justify (GTK_MENU_ITEM (Item)); | |
166 gtk_widget_show_all(Item); | |
167 return Item; | |
168 } | |
169 | |
170 | |
171 GtkWidget * AddSubMenu( GtkWidget *window1, const char * immagine_xpm, GtkWidget * Menu,const char * label ) | |
172 { | |
173 GtkWidget * Label = NULL; | |
174 GtkWidget * Pixmap = NULL; | |
175 GtkWidget * hbox = NULL; | |
176 GtkWidget * Item = NULL; | |
177 GtkWidget * SubItem = NULL; | |
178 GdkPixmap * PixmapIcon = NULL; | |
179 GdkColor transparent; | |
180 GdkBitmap * MaskIcon = NULL; | |
181 | |
182 PixmapIcon = gdk_pixmap_create_from_xpm_d (window1->window, &MaskIcon, &transparent,(gchar **)immagine_xpm); | |
183 Pixmap = gtk_pixmap_new (PixmapIcon, MaskIcon); | |
184 gdk_pixmap_unref (PixmapIcon); | |
185 | |
186 SubItem=gtk_menu_item_new(); | |
187 Item=gtk_menu_new(); | |
188 Label = gtk_label_new (label); | |
189 | |
190 hbox = gtk_hbox_new (FALSE, 8); | |
191 gtk_box_pack_start (GTK_BOX (hbox), Pixmap, FALSE, FALSE, 0); | |
192 gtk_box_pack_start (GTK_BOX (hbox), Label, FALSE, FALSE, 0); | |
193 gtk_container_add (GTK_CONTAINER (SubItem), hbox); | |
194 | |
195 gtk_menu_append( GTK_MENU( Menu ),SubItem ); | |
196 gtk_menu_item_set_submenu( GTK_MENU_ITEM( SubItem ),Item ); | |
197 | |
198 gtk_widget_show_all( SubItem ); | |
199 return Item; | |
200 } | |
201 | |
202 GtkWidget * AddSeparator( GtkWidget * Menu ) | |
203 { | |
204 GtkWidget * Item = NULL; | |
205 | |
206 Item=gtk_menu_item_new (); | |
207 gtk_widget_show( Item ); | |
208 gtk_container_add( GTK_CONTAINER( Menu ),Item ); | |
209 gtk_widget_set_sensitive( Item,FALSE ); | |
210 | |
211 return Item; | |
212 } | |
213 | |
214 typedef struct | |
215 { | |
216 int id; | |
217 const char * name; | |
218 } Languages_t; | |
219 | |
34454 | 220 #ifdef CONFIG_DVDREAD |
33572 | 221 #define lng( a,b ) ( (int)(a) * 256 + b ) |
222 static Languages_t Languages[] = | |
223 { | |
224 { lng( 'a','b' ), "Abkhazian" }, | |
225 { lng( 'a','a' ), "Afar" }, | |
226 { lng( 'a','f' ), "Afrikaans" }, | |
227 { lng( 's','q' ), "Albanian" }, | |
228 { lng( 'a','m' ), "Amharic" }, | |
229 { lng( 'a','r' ), "Arabic" }, | |
230 { lng( 'h','y' ), "Armenian" }, | |
231 { lng( 'a','s' ), "Assamese" }, | |
232 { lng( 'a','e' ), "Avestan" }, | |
233 { lng( 'a','y' ), "Aymara" }, | |
234 { lng( 'a','z' ), "Azerbaijani" }, | |
235 { lng( 'b','a' ), "Bashkir" }, | |
236 { lng( 'e','u' ), "Basque" }, | |
237 { lng( 'b','e' ), "Belarusian" }, | |
238 { lng( 'b','n' ), "Bengali" }, | |
239 { lng( 'b','h' ), "Bihari" }, | |
240 { lng( 'b','i' ), "Bislama" }, | |
241 { lng( 'b','s' ), "Bosnian" }, | |
242 { lng( 'b','r' ), "Breton" }, | |
243 { lng( 'b','g' ), "Bulgarian" }, | |
244 { lng( 'm','y' ), "Burmese" }, | |
245 { lng( 'c','a' ), "Catalan" }, | |
246 { lng( 'c','h' ), "Chamorro" }, | |
247 { lng( 'c','e' ), "Chechen" }, | |
248 { lng( 'n','y' ), "Chichewa;Nyanja" }, | |
249 { lng( 'z','h' ), "Chinese" }, | |
250 { lng( 'c','u' ), "ChurchSlavic" }, | |
251 { lng( 'c','v' ), "Chuvash" }, | |
252 { lng( 'k','w' ), "Cornish" }, | |
253 { lng( 'c','o' ), "Corsican" }, | |
254 { lng( 'h','r' ), "Croatian" }, | |
255 { lng( 'c','s' ), "Czech" }, | |
256 { lng( 'd','a' ), "Danish" }, | |
257 { lng( 'n','l' ), "Dutch" }, | |
258 { lng( 'd','z' ), "Dzongkha" }, | |
259 { lng( 'e','n' ), "English" }, | |
260 { lng( 'e','o' ), "Esperanto" }, | |
261 { lng( 'e','t' ), "Estonian" }, | |
262 { lng( 'f','o' ), "Faroese" }, | |
263 { lng( 'f','j' ), "Fijian" }, | |
264 { lng( 'f','i' ), "Finnish" }, | |
265 { lng( 'f','r' ), "French" }, | |
266 { lng( 'f','y' ), "Frisian" }, | |
267 { lng( 'g','d' ), "Gaelic(Scots" }, | |
268 { lng( 'g','l' ), "Gallegan" }, | |
269 { lng( 'k','a' ), "Georgian" }, | |
270 { lng( 'd','e' ), "German" }, | |
271 { lng( 'e','l' ), "Greek" }, | |
272 { lng( 'g','n' ), "Guarani" }, | |
273 { lng( 'g','u' ), "Gujarati" }, | |
274 { lng( 'h','a' ), "Hausa" }, | |
275 { lng( 'h','e' ), "Hebrew" }, | |
276 { lng( 'i','w' ), "Hebrew" }, | |
277 { lng( 'h','z' ), "Herero" }, | |
278 { lng( 'h','i' ), "Hindi" }, | |
279 { lng( 'h','o' ), "HiriMotu" }, | |
280 { lng( 'h','u' ), "Hungarian" }, | |
281 { lng( 'i','s' ), "Icelandic" }, | |
282 { lng( 'i','d' ), "Indonesian" }, | |
283 { lng( 'i','n' ), "Indonesian" }, | |
284 { lng( 'i','a' ), "Interlingua" }, | |
285 { lng( 'i','e' ), "Interlingue" }, | |
286 { lng( 'i','u' ), "Inuktitut" }, | |
287 { lng( 'i','k' ), "Inupiaq" }, | |
288 { lng( 'g','a' ), "Irish" }, | |
289 { lng( 'i','t' ), "Italian" }, | |
290 { lng( 'j','a' ), "Japanese" }, | |
291 { lng( 'j','v' ), "Javanese" }, | |
292 { lng( 'j','w' ), "Javanese" }, | |
293 { lng( 'k','l' ), "Kalaallisut" }, | |
294 { lng( 'k','n' ), "Kannada" }, | |
295 { lng( 'k','s' ), "Kashmiri" }, | |
296 { lng( 'k','k' ), "Kazakh" }, | |
297 { lng( 'k','m' ), "Khmer" }, | |
298 { lng( 'k','i' ), "Kikuyu" }, | |
299 { lng( 'r','w' ), "Kinyarwanda" }, | |
300 { lng( 'k','y' ), "Kirghiz" }, | |
301 { lng( 'k','v' ), "Komi" }, | |
302 { lng( 'k','o' ), "Korean" }, | |
303 { lng( 'k','j' ), "Kuanyama" }, | |
304 { lng( 'k','u' ), "Kurdish" }, | |
305 { lng( 'l','o' ), "Lao" }, | |
306 { lng( 'l','a' ), "Latin" }, | |
307 { lng( 'l','v' ), "Latvian" }, | |
308 { lng( 'l','b' ), "Letzeburgesch" }, | |
309 { lng( 'l','n' ), "Lingala" }, | |
310 { lng( 'l','t' ), "Lithuanian" }, | |
311 { lng( 'm','k' ), "Macedonian" }, | |
312 { lng( 'm','g' ), "Malagasy" }, | |
313 { lng( 'm','s' ), "Malay" }, | |
314 { lng( 'm','l' ), "Malayalam" }, | |
315 { lng( 'm','t' ), "Maltese" }, | |
316 { lng( 'g','v' ), "Manx" }, | |
317 { lng( 'm','i' ), "Maori" }, | |
318 { lng( 'm','r' ), "Marathi" }, | |
319 { lng( 'm','h' ), "Marshall" }, | |
320 { lng( 'm','o' ), "Moldavian" }, | |
321 { lng( 'm','n' ), "Mongolian" }, | |
322 { lng( 'n','a' ), "Nauru" }, | |
323 { lng( 'n','v' ), "Navajo" }, | |
324 { lng( 'n','d' ), "North Ndebele" }, | |
325 { lng( 'n','r' ), "South Ndebele" }, | |
326 { lng( 'n','g' ), "Ndonga" }, | |
327 { lng( 'n','e' ), "Nepali" }, | |
328 { lng( 's','e' ), "NorthernSami" }, | |
329 { lng( 'n','o' ), "Norwegian" }, | |
330 { lng( 'n','b' ), "NorwegianBokmål" }, | |
331 { lng( 'n','n' ), "NorwegianNynorsk" }, | |
332 { lng( 'n','y' ), "Nyanja;Chichewa" }, | |
333 { lng( 'o','c' ), "Occitan(post1500;Provençal" }, | |
334 { lng( 'o','r' ), "Oriya" }, | |
335 { lng( 'o','m' ), "Oromo" }, | |
336 { lng( 'o','s' ), "Ossetian;Ossetic" }, | |
337 { lng( 'p','i' ), "Pali" }, | |
338 { lng( 'p','a' ), "Panjabi" }, | |
339 { lng( 'f','a' ), "Persian" }, | |
340 { lng( 'p','l' ), "Polish" }, | |
341 { lng( 'p','t' ), "Portuguese" }, | |
342 { lng( 'o','c' ), "Provençal;Occitan(post1500" }, | |
343 { lng( 'p','s' ), "Pushto" }, | |
344 { lng( 'q','u' ), "Quechua" }, | |
345 { lng( 'r','m' ), "Raeto-Romance" }, | |
346 { lng( 'r','o' ), "Romanian" }, | |
347 { lng( 'r','n' ), "Rundi" }, | |
348 { lng( 'r','u' ), "Russian" }, | |
349 { lng( 's','m' ), "Samoan" }, | |
350 { lng( 's','g' ), "Sango" }, | |
351 { lng( 's','a' ), "Sanskrit" }, | |
352 { lng( 's','c' ), "Sardinian" }, | |
353 { lng( 's','r' ), "Serbian" }, | |
354 { lng( 's','n' ), "Shona" }, | |
355 { lng( 's','d' ), "Sindhi" }, | |
356 { lng( 's','i' ), "Sinhalese" }, | |
357 { lng( 's','k' ), "Slovak" }, | |
358 { lng( 's','l' ), "Slovenian" }, | |
359 { lng( 's','o' ), "Somali" }, | |
360 { lng( 's','t' ), "Sotho" }, | |
361 { lng( 'e','s' ), "Spanish" }, | |
362 { lng( 's','u' ), "Sundanese" }, | |
363 { lng( 's','w' ), "Swahili" }, | |
364 { lng( 's','s' ), "Swati" }, | |
365 { lng( 's','v' ), "Swedish" }, | |
366 { lng( 't','l' ), "Tagalog" }, | |
367 { lng( 't','y' ), "Tahitian" }, | |
368 { lng( 't','g' ), "Tajik" }, | |
369 { lng( 't','a' ), "Tamil" }, | |
370 { lng( 't','t' ), "Tatar" }, | |
371 { lng( 't','e' ), "Telugu" }, | |
372 { lng( 't','h' ), "Thai" }, | |
373 { lng( 'b','o' ), "Tibetan" }, | |
374 { lng( 't','i' ), "Tigrinya" }, | |
375 { lng( 't','o' ), "Tonga" }, | |
376 { lng( 't','s' ), "Tsonga" }, | |
377 { lng( 't','n' ), "Tswana" }, | |
378 { lng( 't','r' ), "Turkish" }, | |
379 { lng( 't','k' ), "Turkmen" }, | |
380 { lng( 't','w' ), "Twi" }, | |
381 { lng( 'u','g' ), "Uighur" }, | |
382 { lng( 'u','k' ), "Ukrainian" }, | |
383 { lng( 'u','r' ), "Urdu" }, | |
384 { lng( 'u','z' ), "Uzbek" }, | |
385 { lng( 'v','i' ), "Vietnamese" }, | |
386 { lng( 'v','o' ), "Volapük" }, | |
387 { lng( 'c','y' ), "Welsh" }, | |
388 { lng( 'w','o' ), "Wolof" }, | |
389 { lng( 'x','h' ), "Xhosa" }, | |
390 { lng( 'y','i' ), "Yiddish" }, | |
391 { lng( 'j','i' ), "Yiddish" }, | |
392 { lng( 'y','o' ), "Yoruba" }, | |
393 { lng( 'z','a' ), "Zhuang" }, | |
394 { lng( 'z','u' ), "Zulu" }, | |
395 }; | |
396 #undef lng | |
397 | |
398 static char * ChannelTypes[] = | |
399 { "Dolby Digital","","Mpeg1","Mpeg2","PCM","","Digital Theatre System" }; | |
400 static char * ChannelNumbers[] = | |
401 { "","Stereo","","","","5.1" }; | |
402 | |
403 static const char * GetLanguage( int language ) | |
404 { | |
405 unsigned int i; | |
406 for ( i=0;i<sizeof( Languages ) / sizeof( Languages_t );i++ ) | |
407 if ( Languages[i].id == language ) return Languages[i].name; | |
35158 | 408 return "Unknown"; |
33572 | 409 } |
34454 | 410 #endif |
33572 | 411 |
412 | |
36028 | 413 static GtkWidget * DVDSubMenu; |
33572 | 414 GtkWidget * DVDTitleMenu; |
415 GtkWidget * DVDChapterMenu; | |
416 GtkWidget * DVDAudioLanguageMenu; | |
417 GtkWidget * DVDSubtitleLanguageMenu; | |
418 GtkWidget * AspectMenu; | |
419 GtkWidget * VCDSubMenu; | |
420 GtkWidget * VCDTitleMenu; | |
34387 | 421 GtkWidget * CDSubMenu; |
422 GtkWidget * CDTitleMenu; | |
33572 | 423 |
35996 | 424 GtkWidget * CreatePopUpMenu( void ) |
33572 | 425 { |
426 GtkWidget * window1; | |
427 GtkWidget * Menu = NULL; | |
428 GtkWidget * SubMenu = NULL; | |
429 GtkWidget * MenuItem = NULL; | |
430 GtkWidget * H, * N, * D, * F; | |
33657 | 431 demuxer_t *demuxer = mpctx_get_demuxer(guiInfo.mpcontext); |
33572 | 432 mixer_t *mixer = mpctx_get_mixer(guiInfo.mpcontext); |
433 int global_sub_size = mpctx_get_global_sub_size(guiInfo.mpcontext); | |
434 | |
435 Menu=gtk_menu_new(); | |
436 gtk_widget_realize (Menu); | |
437 window1 = gtk_widget_get_toplevel(Menu); | |
438 | |
439 | |
440 AddMenuItem( window1, (const char*)about_xpm, Menu,MSGTR_MENU_AboutMPlayer" ", evAbout ); | |
441 AddSeparator( Menu ); | |
442 SubMenu=AddSubMenu( window1, (const char*)open_xpm, Menu,MSGTR_MENU_Open ); | |
36672 | 443 AddMenuItem( window1, (const char*)file2_xpm, SubMenu,MSGTR_MENU_PlayFile"... ", evLoadPlay ); |
34387 | 444 #ifdef CONFIG_CDDA |
445 AddMenuItem( window1, (const char*)playcd_xpm, SubMenu,MSGTR_MENU_PlayCD, evPlayCD ); | |
34419 | 446 CDSubMenu=AddSubMenu( window1, (const char*)cd_xpm, Menu,MSGTR_MENU_CD ); |
34387 | 447 AddMenuItem( window1, (const char*)playcd_xpm, CDSubMenu,MSGTR_MENU_PlayDisc,evPlayCD ); |
448 AddSeparator( CDSubMenu ); | |
449 CDTitleMenu=AddSubMenu( window1, (const char*)title_xpm, CDSubMenu,MSGTR_MENU_Titles ); | |
34420 | 450 if ( guiInfo.Tracks && ( guiInfo.StreamType == STREAMTYPE_CDDA ) ) |
34387 | 451 { |
452 char tmp[32]; int i; | |
453 for ( i=1;i <= guiInfo.Tracks;i++ ) | |
454 { | |
455 snprintf( tmp,32,MSGTR_MENU_Title,i ); | |
456 //AddMenuItem( CDTitleMenu,tmp,( i << 16 ) + ivSetCDTrack ); | |
34422
b1f2949ca18d
Use empty1px.xpm instead of empty.xpm for check item (and similar) menus.
ib
parents:
34421
diff
changeset
|
457 AddMenuCheckItem(window1, (const char*)empty1px_xpm, CDTitleMenu,tmp, guiInfo.Track == i, ( i << 16 ) + ivSetCDTrack ); |
34387 | 458 } |
459 } | |
460 else | |
461 { | |
34422
b1f2949ca18d
Use empty1px.xpm instead of empty.xpm for check item (and similar) menus.
ib
parents:
34421
diff
changeset
|
462 MenuItem=AddMenuItem( window1, (const char*)empty1px_xpm, CDTitleMenu,MSGTR_MENU_None,evNone ); |
34387 | 463 gtk_widget_set_sensitive( MenuItem,FALSE ); |
464 } | |
465 #endif | |
33572 | 466 #ifdef CONFIG_VCD |
34419 | 467 AddMenuItem( window1, (const char*)playvcd_xpm, SubMenu,MSGTR_MENU_PlayVCD, evPlayVCD ); |
468 VCDSubMenu=AddSubMenu( window1, (const char*)vcd_xpm, Menu,MSGTR_MENU_VCD ); | |
33572 | 469 AddMenuItem( window1, (const char*)playvcd_xpm, VCDSubMenu,MSGTR_MENU_PlayDisc,evPlayVCD ); |
470 AddSeparator( VCDSubMenu ); | |
471 VCDTitleMenu=AddSubMenu( window1, (const char*)title_xpm, VCDSubMenu,MSGTR_MENU_Titles ); | |
34420 | 472 if ( guiInfo.Tracks && ( guiInfo.StreamType == STREAMTYPE_VCD ) ) |
33572 | 473 { |
474 char tmp[32]; int i; | |
33876
4789b8eed97e
Get rid of a bunch of needless or redundant guiInfo members.
ib
parents:
33874
diff
changeset
|
475 for ( i=1;i < guiInfo.Tracks;i++ ) |
33572 | 476 { |
477 snprintf( tmp,32,MSGTR_MENU_Title,i ); | |
34333 | 478 //AddMenuItem( VCDTitleMenu,tmp,( i << 16 ) + ivSetVCDTrack ); |
34422
b1f2949ca18d
Use empty1px.xpm instead of empty.xpm for check item (and similar) menus.
ib
parents:
34421
diff
changeset
|
479 AddMenuCheckItem(window1, (const char*)empty1px_xpm, VCDTitleMenu,tmp, guiInfo.Track == i + 1, ( ( i + 1 ) << 16 ) + ivSetVCDTrack ); |
33572 | 480 } |
481 } | |
482 else | |
483 { | |
34422
b1f2949ca18d
Use empty1px.xpm instead of empty.xpm for check item (and similar) menus.
ib
parents:
34421
diff
changeset
|
484 MenuItem=AddMenuItem( window1, (const char*)empty1px_xpm, VCDTitleMenu,MSGTR_MENU_None,evNone ); |
33572 | 485 gtk_widget_set_sensitive( MenuItem,FALSE ); |
486 } | |
487 #endif | |
488 #ifdef CONFIG_DVDREAD | |
34419 | 489 AddMenuItem( window1, (const char*)playdvd_xpm, SubMenu,MSGTR_MENU_PlayDVD, evPlayDVD ); |
490 DVDSubMenu=AddSubMenu( window1, (const char*)dvd_xpm, Menu,MSGTR_MENU_DVD ); | |
33572 | 491 AddMenuItem( window1, (const char*)playdvd_xpm, DVDSubMenu,MSGTR_MENU_PlayDisc" ", evPlayDVD ); |
492 // AddMenuItem( DVDSubMenu,MSGTR_MENU_ShowDVDMenu, evNone ); | |
493 AddSeparator( DVDSubMenu ); | |
494 DVDTitleMenu=AddSubMenu( window1, (const char*)title_xpm, DVDSubMenu,MSGTR_MENU_Titles ); | |
34420 | 495 if ( guiInfo.Tracks && ( guiInfo.StreamType == STREAMTYPE_DVD ) ) |
33572 | 496 { |
497 char tmp[32]; int i; | |
33876
4789b8eed97e
Get rid of a bunch of needless or redundant guiInfo members.
ib
parents:
33874
diff
changeset
|
498 for ( i=1 ; i<= guiInfo.Tracks;i++ ) |
33572 | 499 { |
500 snprintf( tmp,32,MSGTR_MENU_Title,i); | |
501 AddMenuCheckItem( window1, (const char*)empty1px_xpm, DVDTitleMenu,tmp, | |
33876
4789b8eed97e
Get rid of a bunch of needless or redundant guiInfo members.
ib
parents:
33874
diff
changeset
|
502 guiInfo.Track == i, |
34333 | 503 (i << 16) + ivSetDVDTitle ); |
33572 | 504 } |
505 } | |
506 else | |
507 { | |
34422
b1f2949ca18d
Use empty1px.xpm instead of empty.xpm for check item (and similar) menus.
ib
parents:
34421
diff
changeset
|
508 MenuItem=AddMenuItem( window1, (const char*)empty1px_xpm, DVDTitleMenu,MSGTR_MENU_None,evNone ); |
33572 | 509 gtk_widget_set_sensitive( MenuItem,FALSE ); |
510 } | |
511 DVDChapterMenu=AddSubMenu( window1, (const char*)chapter_xpm, DVDSubMenu,MSGTR_MENU_Chapters ); | |
34420 | 512 if ( guiInfo.Chapters && ( guiInfo.StreamType == STREAMTYPE_DVD ) ) |
33572 | 513 { |
514 char tmp[32]; int i; | |
33876
4789b8eed97e
Get rid of a bunch of needless or redundant guiInfo members.
ib
parents:
33874
diff
changeset
|
515 for ( i=1;i <= guiInfo.Chapters;i++ ) |
33572 | 516 { |
517 snprintf( tmp,32,MSGTR_MENU_Chapter,i ); | |
33876
4789b8eed97e
Get rid of a bunch of needless or redundant guiInfo members.
ib
parents:
33874
diff
changeset
|
518 AddMenuCheckItem( window1, (const char*)empty1px_xpm, DVDChapterMenu,tmp,guiInfo.Chapter == i, |
34333 | 519 ( i << 16 ) + ivSetDVDChapter ); |
33572 | 520 } |
521 } | |
522 else | |
523 { | |
34422
b1f2949ca18d
Use empty1px.xpm instead of empty.xpm for check item (and similar) menus.
ib
parents:
34421
diff
changeset
|
524 MenuItem=AddMenuItem( window1, (const char*)empty1px_xpm, DVDChapterMenu,MSGTR_MENU_None,evNone ); |
33572 | 525 gtk_widget_set_sensitive( MenuItem,FALSE ); |
526 } | |
36665 | 527 DVDAudioLanguageMenu=AddSubMenu( window1, (const char*)audio_xpm, DVDSubMenu,MSGTR_MENU_AudioLanguages ); |
34420 | 528 if ( guiInfo.AudioStreams && ( guiInfo.StreamType == STREAMTYPE_DVD ) ) |
33572 | 529 { |
33657 | 530 char tmp[64]; int i, id = demuxer ? demuxer->audio->id : audio_id; |
33902 | 531 for ( i=0;i < guiInfo.AudioStreams;i++ ) |
33572 | 532 { |
33902 | 533 snprintf( tmp,64,"%s - %s %s",GetLanguage( guiInfo.AudioStream[i].language ), |
534 ChannelTypes[ guiInfo.AudioStream[i].type ], | |
535 ChannelNumbers[ guiInfo.AudioStream[i].channels ] ); | |
536 // if ( id == -1 ) id=audio_id; //guiInfo.AudioStream[i].id; | |
33572 | 537 AddMenuCheckItem( window1, (const char*)dolby_xpm, DVDAudioLanguageMenu,tmp, |
33902 | 538 id == guiInfo.AudioStream[i].id, |
34333 | 539 ( guiInfo.AudioStream[i].id << 16 ) + ivSetDVDAudio ); |
33572 | 540 } |
541 } | |
542 else | |
543 { | |
34422
b1f2949ca18d
Use empty1px.xpm instead of empty.xpm for check item (and similar) menus.
ib
parents:
34421
diff
changeset
|
544 MenuItem=AddMenuItem( window1, (const char*)empty1px_xpm, DVDAudioLanguageMenu,MSGTR_MENU_None,evNone ); |
33572 | 545 gtk_widget_set_sensitive( MenuItem,FALSE ); |
546 } | |
36664 | 547 DVDSubtitleLanguageMenu=AddSubMenu( window1, (const char*)subtitle_xpm, DVDSubMenu,MSGTR_MENU_SubtitleLanguages ); |
34420 | 548 if ( guiInfo.Subtitles && ( guiInfo.StreamType == STREAMTYPE_DVD ) ) |
33572 | 549 { |
550 char tmp[64]; int i; | |
34333 | 551 AddMenuItem( window1, (const char*)empty1px_xpm, DVDSubtitleLanguageMenu,MSGTR_MENU_None,( (unsigned short)-1 << 16 ) + ivSetDVDSubtitle ); |
33902 | 552 for ( i=0;i < guiInfo.Subtitles;i++ ) |
33572 | 553 { |
33902 | 554 av_strlcpy( tmp,GetLanguage( guiInfo.Subtitle[i].language ),sizeof(tmp) ); |
33572 | 555 AddMenuCheckItem( window1, (const char*)empty1px_xpm, DVDSubtitleLanguageMenu,tmp, |
33902 | 556 dvdsub_id == guiInfo.Subtitle[i].id, |
34333 | 557 ( guiInfo.Subtitle[i].id << 16 ) + ivSetDVDSubtitle ); |
33572 | 558 } |
559 } | |
560 else | |
561 { | |
34422
b1f2949ca18d
Use empty1px.xpm instead of empty.xpm for check item (and similar) menus.
ib
parents:
34421
diff
changeset
|
562 MenuItem=AddMenuItem( window1, (const char*)empty1px_xpm, DVDSubtitleLanguageMenu,MSGTR_MENU_None,evNone ); |
33572 | 563 gtk_widget_set_sensitive( MenuItem,FALSE ); |
564 } | |
565 #endif | |
36672 | 566 AddMenuItem( window1, (const char*)url_xpm, SubMenu,MSGTR_MENU_PlayURL"...", evLoadURL ); |
36429 | 567 #ifdef CONFIG_TV |
568 AddMenuItem( window1, (const char*)tv_xpm, SubMenu,MSGTR_MENU_PlayTV, evPlayTV ); | |
569 #endif | |
36663 | 570 AddSeparator( SubMenu ); |
36672 | 571 AddMenuItem( window1, (const char*)loadeaf_xpm, SubMenu,MSGTR_MENU_LoadExternAudioFile"...", evLoadAudioFile ); |
572 AddMenuItem( window1, (const char*)sub_xpm, SubMenu,MSGTR_MENU_LoadSubtitle"... ", evLoadSubtitle ); | |
34419 | 573 AddMenuItem( window1, (const char*)nosub_xpm, SubMenu,MSGTR_MENU_DropSubtitle,evDropSubtitle ); |
574 SubMenu=AddSubMenu(window1, (const char*)play_xpm, Menu,MSGTR_MENU_Playing ); | |
575 AddMenuItem( window1, (const char*)play_xpm, SubMenu,MSGTR_MENU_Play" ", evPlay ); | |
576 AddMenuItem( window1, (const char*)pause_xpm, SubMenu,MSGTR_MENU_Pause, evPause ); | |
577 AddMenuItem( window1, (const char*)stop_xpm, SubMenu,MSGTR_MENU_Stop, evStop ); | |
578 AddMenuItem( window1, (const char*)next_xpm, SubMenu,MSGTR_MENU_NextStream, evNext ); | |
579 AddMenuItem( window1, (const char*)prev_xpm, SubMenu,MSGTR_MENU_PrevStream, evPrev ); | |
580 // AddSeparator( SubMenu ); | |
581 // AddMenuItem( SubMenu,"Back 10 sec", evBackward10sec ); | |
582 // AddMenuItem( SubMenu,"Fwd 10 sec", evForward10sec ); | |
583 // AddMenuItem( SubMenu,"Back 1 min", evBackward1min ); | |
584 // AddMenuItem( SubMenu,"Fwd 1 min", evForward1min ); | |
585 // SubMenu=AddSubMenu( Menu,MSGTR_MENU_Size ); | |
586 // AddMenuItem( SubMenu,MSGTR_MENU_NormalSize" ", evNormalSize ); | |
587 // AddMenuItem( SubMenu,MSGTR_MENU_DoubleSize, evDoubleSize ); | |
35605
71f19d352561
Fix bug with wrong video window size after end of fullscreen playback.
ib
parents:
35529
diff
changeset
|
588 // AddMenuItem( SubMenu,MSGTR_MENU_FullScreen, evFullScreen + ( True << 16 ) ); |
33572 | 589 |
36261
ca1d4a7bb751
Disable aspect ratio menu in the absence of video playback.
ib
parents:
36029
diff
changeset
|
590 if ( guiInfo.VideoWindow ) |
33572 | 591 { |
36273 | 592 int a11 = False, a169 = False, a43 = False, a235 = False; |
36622
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
593 AddSeparator( Menu ); |
36316
139f2b064ef9
Don't subsequently calculate original_aspect from last movie_aspect.
ib
parents:
36297
diff
changeset
|
594 if (movie_aspect == -1.0f) a11 = True; |
36273 | 595 else |
596 { | |
597 a169 = (FFABS(movie_aspect - 16.0f / 9.0f) <= 0.01f); | |
598 a43 = (FFABS(movie_aspect - 4.0f / 3.0f) <= 0.01f); | |
36276 | 599 a235 = (FFABS(movie_aspect - 2.35f) <= 0.01f); |
36273 | 600 } |
601 | |
33572 | 602 AspectMenu=AddSubMenu( window1, (const char*)aspect_xpm, Menu,MSGTR_MENU_AspectRatio ); |
36273 | 603 H=AddMenuCheckItem( window1, (const char*)aspect11_xpm, AspectMenu,MSGTR_MENU_Original, a11, evSetAspect + ( 1 << 16 ) ); |
604 N=AddMenuCheckItem( window1, (const char*)aspect169_xpm, AspectMenu,"16:9", a169, evSetAspect + ( 2 << 16 ) ); | |
605 D=AddMenuCheckItem( window1, (const char*)aspect43_xpm, AspectMenu,"4:3", a43, evSetAspect + ( 3 << 16 ) ); | |
36278 | 606 F=AddMenuCheckItem( window1, (const char*)aspect235_xpm, AspectMenu,MSGTR_MENU_235, a235, evSetAspect + ( 4 << 16 ) ); |
36261
ca1d4a7bb751
Disable aspect ratio menu in the absence of video playback.
ib
parents:
36029
diff
changeset
|
607 |
ca1d4a7bb751
Disable aspect ratio menu in the absence of video playback.
ib
parents:
36029
diff
changeset
|
608 if ( !guiInfo.Playing ) |
ca1d4a7bb751
Disable aspect ratio menu in the absence of video playback.
ib
parents:
36029
diff
changeset
|
609 { |
ca1d4a7bb751
Disable aspect ratio menu in the absence of video playback.
ib
parents:
36029
diff
changeset
|
610 gtk_widget_set_sensitive( H,FALSE ); |
ca1d4a7bb751
Disable aspect ratio menu in the absence of video playback.
ib
parents:
36029
diff
changeset
|
611 gtk_widget_set_sensitive( N,FALSE ); |
ca1d4a7bb751
Disable aspect ratio menu in the absence of video playback.
ib
parents:
36029
diff
changeset
|
612 gtk_widget_set_sensitive( D,FALSE ); |
ca1d4a7bb751
Disable aspect ratio menu in the absence of video playback.
ib
parents:
36029
diff
changeset
|
613 gtk_widget_set_sensitive( F,FALSE ); |
ca1d4a7bb751
Disable aspect ratio menu in the absence of video playback.
ib
parents:
36029
diff
changeset
|
614 } |
33572 | 615 } |
616 | |
36622
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
617 if ( guiInfo.VideoWindow ) |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
618 { |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
619 int b1 = False, b2 = False, b_half = False; |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
620 |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
621 if ( !guiApp.videoWindow.isFullScreen && guiInfo.Playing ) |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
622 { |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
623 if ( ( guiApp.videoWindow.Width == guiInfo.VideoWidth * 2 )&& |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
624 ( guiApp.videoWindow.Height == guiInfo.VideoHeight * 2 ) ) b2=True; |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
625 else if ( ( guiApp.videoWindow.Width == guiInfo.VideoWidth / 2 ) && |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
626 ( guiApp.videoWindow.Height == guiInfo.VideoHeight / 2 ) ) b_half=True; |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
627 else b1=( guiApp.videoWindow.Width == guiInfo.VideoWidth && guiApp.videoWindow.Height == guiInfo.VideoHeight ); |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
628 } else b1=!guiApp.videoWindow.isFullScreen; |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
629 F=AddMenuCheckItem( window1, (const char*)full_xpm, Menu,MSGTR_MENU_FullScreen,guiApp.videoWindow.isFullScreen,evFullScreen + ( True << 16 ) ); |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
630 D=AddMenuCheckItem( window1, (const char*)double_xpm, Menu,MSGTR_MENU_DoubleSize,b2,evDoubleSize ); |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
631 N=AddMenuCheckItem( window1, (const char*)normal_xpm, Menu,MSGTR_MENU_NormalSize" ",b1,evNormalSize ); |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
632 H=AddMenuCheckItem( window1, (const char*)half_xpm, Menu,MSGTR_MENU_HalfSize,b_half,evHalfSize ); |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
633 if ( !guiInfo.Playing ) |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
634 { |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
635 gtk_widget_set_sensitive( H,FALSE ); |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
636 gtk_widget_set_sensitive( N,FALSE ); |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
637 gtk_widget_set_sensitive( D,FALSE ); |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
638 gtk_widget_set_sensitive( F,FALSE ); |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
639 } |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
640 } |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
641 |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
642 AddSeparator( Menu ); |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
643 MenuItem=AddMenuCheckItem( window1, (const char*)sound_xpm, Menu,MSGTR_MENU_Mute,mixer->muted,evMute ); |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
644 if ( !guiInfo.AudioChannels ) gtk_widget_set_sensitive( MenuItem,FALSE ); |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
645 |
33657 | 646 if ( guiInfo.Playing && demuxer && guiInfo.StreamType != STREAMTYPE_DVD ) |
33572 | 647 { |
648 int i,c = 0; | |
649 | |
650 for ( i=0;i < MAX_A_STREAMS;i++ ) | |
33657 | 651 if ( demuxer->a_streams[i] ) c++; |
33572 | 652 |
653 if ( c > 1 ) | |
654 { | |
36665 | 655 SubMenu=AddSubMenu( window1, (const char*)audio_xpm, Menu,MSGTR_MENU_AudioTrack ); |
33572 | 656 for ( i=0;i < MAX_A_STREAMS;i++ ) |
33657 | 657 if ( demuxer->a_streams[i] ) |
33572 | 658 { |
33657 | 659 int aid = ((sh_audio_t *)demuxer->a_streams[i])->aid; |
34555
da67e2df97be
Emphasize the default audio track in the selection list.
ib
parents:
34479
diff
changeset
|
660 int selected_id = (audio_id == aid || (audio_id == -1 && aid == demuxer_default_audio_track(mpctx_get_demuxer(guiInfo.mpcontext)))); |
33572 | 661 char tmp[32]; |
662 snprintf( tmp,32,MSGTR_MENU_Track,aid ); | |
34555
da67e2df97be
Emphasize the default audio track in the selection list.
ib
parents:
34479
diff
changeset
|
663 AddMenuCheckItem( window1, (const char*)empty1px_xpm, SubMenu,tmp,selected_id,( aid << 16 ) + ivSetAudio ); |
33572 | 664 } |
665 } | |
666 | |
667 for ( c=0,i=0;i < MAX_V_STREAMS;i++ ) | |
33657 | 668 if ( demuxer->v_streams[i] ) c++; |
33572 | 669 |
670 if ( c > 1 ) | |
671 { | |
36666 | 672 SubMenu=AddSubMenu( window1, (const char*)video_xpm, Menu,MSGTR_MENU_VideoTrack ); |
33572 | 673 for ( i=0;i < MAX_V_STREAMS;i++ ) |
33657 | 674 if ( demuxer->v_streams[i] ) |
33572 | 675 { |
33657 | 676 int vid = ((sh_video_t *)demuxer->v_streams[i])->vid; |
33572 | 677 char tmp[32]; |
678 snprintf( tmp,32,MSGTR_MENU_Track,vid ); | |
34479 | 679 AddMenuCheckItem( window1, (const char*)empty1px_xpm, SubMenu,tmp,video_id == vid,( vid << 16 ) + ivSetVideo ); |
33572 | 680 } |
681 } | |
682 } | |
683 | |
684 /* cheap subtitle switching for non-DVD streams */ | |
685 if ( global_sub_size && guiInfo.StreamType != STREAMTYPE_DVD ) | |
686 { | |
36458 | 687 int pos, i; |
688 pos = mpctx_get_global_sub_pos(guiInfo.mpcontext); | |
34903 | 689 SubMenu=AddSubMenu( window1, (const char*)subtitle_xpm, Menu, MSGTR_MENU_Subtitles ); |
36458 | 690 AddMenuCheckItem( window1, (const char*)empty1px_xpm, SubMenu, MSGTR_MENU_None, pos == -1, (-1 << 16) + ivSetSubtitle ); |
33572 | 691 for ( i=0;i < global_sub_size;i++ ) |
692 { | |
693 char tmp[32]; | |
694 snprintf( tmp, 32, MSGTR_MENU_Track, i ); | |
36458 | 695 AddMenuCheckItem( window1,(const char*)empty1px_xpm,SubMenu,tmp,pos == i,( i << 16 ) + ivSetSubtitle ); |
33572 | 696 } |
697 } | |
698 | |
699 AddSeparator( Menu ); | |
36621 | 700 AddMenuItem( window1, (const char*)equalizer_xpm, Menu,MSGTR_Equalizer, evEqualizer ); |
36620 | 701 AddMenuItem( window1, (const char*)playlist_xpm, Menu,MSGTR_MENU_PlayList, evPlaylist ); |
702 AddMenuItem( window1, (const char*)skin_xpm, Menu,MSGTR_MENU_SkinBrowser, evSkinBrowser ); | |
703 AddMenuItem( window1, (const char*)prefs_xpm, Menu,MSGTR_MENU_Preferences, evPreferences ); | |
704 | |
705 AddSeparator( Menu ); | |
33572 | 706 AddMenuItem( window1, (const char*)exit_xpm, Menu,MSGTR_MENU_Exit, evExit ); |
707 | |
708 return Menu; | |
709 } |