Mercurial > mplayer.hg
comparison Gui/mplayer/gtk/menu.c @ 13852:be3261b2bcf4
icons for the GUI context menu
patch by Piero di Vita <scognito at acaro dot org>
author | diego |
---|---|
date | Tue, 02 Nov 2004 14:45:03 +0000 |
parents | 0230544f52a1 |
children | 8f2f26ef46e2 |
comparison
equal
deleted
inserted
replaced
13851:4ec3e68709aa | 13852:be3261b2bcf4 |
---|---|
14 #include "../widgets.h" | 14 #include "../widgets.h" |
15 #include "../app.h" | 15 #include "../app.h" |
16 | 16 |
17 #include "../../../libmpdemux/stream.h" | 17 #include "../../../libmpdemux/stream.h" |
18 #include "../../../libmpdemux/demuxer.h" | 18 #include "../../../libmpdemux/demuxer.h" |
19 | |
20 #include "../pixmaps/ab.xpm" | |
21 #include "../pixmaps/normal.xpm" | |
22 #include "../pixmaps/double.xpm" | |
23 #include "../pixmaps/fs.xpm" | |
24 #include "../pixmaps/exit.xpm" | |
25 #include "../pixmaps/prefs.xpm" | |
26 #include "../pixmaps/eq.xpm" | |
27 #include "../pixmaps/pl.xpm" | |
28 #include "../pixmaps/skin.xpm" | |
29 #include "../pixmaps/sound.xpm" | |
30 #include "../pixmaps/open.xpm" | |
31 #include "../pixmaps/dvd.xpm" | |
32 #include "../pixmaps/vcd.xpm" | |
33 #include "../pixmaps/play.xpm" | |
34 #include "../pixmaps/stop2.xpm" | |
35 #include "../pixmaps/pause.xpm" | |
36 #include "../pixmaps/prev.xpm" | |
37 #include "../pixmaps/next.xpm" | |
38 #include "../pixmaps/aspect.xpm" | |
39 #include "../pixmaps/a11.xpm" | |
40 #include "../pixmaps/a169.xpm" | |
41 #include "../pixmaps/a235.xpm" | |
42 #include "../pixmaps/a43.xpm" | |
43 #include "../pixmaps/playdvd.xpm" | |
44 #include "../pixmaps/playvcd.xpm" | |
45 #include "../pixmaps/file2.xpm" | |
46 #include "../pixmaps/url.xpm" | |
47 #include "../pixmaps/sub.xpm" | |
48 #include "../pixmaps/delsub.xpm" | |
49 #include "../pixmaps/empty.xpm" | |
50 #include "../pixmaps/empty1px.xpm" | |
51 #include "../pixmaps/tongue.xpm" | |
52 #include "../pixmaps/tonguebla.xpm" | |
53 #include "../pixmaps/dolby.xpm" | |
54 #include "../pixmaps/loadeaf.xpm" | |
55 #include "../pixmaps/title.xpm" | |
56 #include "../pixmaps/chapter.xpm" | |
19 | 57 |
20 extern mixer_t mixer; // mixer from mplayer.c | 58 extern mixer_t mixer; // mixer from mplayer.c |
21 | 59 |
22 void ActivateMenuItem( int Item ) | 60 void ActivateMenuItem( int Item ) |
23 { | 61 { |
25 gtkPopupMenu=Item & 0x0000ffff; | 63 gtkPopupMenu=Item & 0x0000ffff; |
26 gtkPopupMenuParam=Item >> 16; | 64 gtkPopupMenuParam=Item >> 16; |
27 mplEventHandling( Item & 0x0000ffff,Item >> 16 ); | 65 mplEventHandling( Item & 0x0000ffff,Item >> 16 ); |
28 } | 66 } |
29 | 67 |
30 GtkWidget * AddMenuCheckItem(GtkWidget* Menu,char* label, gboolean state, int Number) | 68 GtkWidget * AddMenuCheckItem(GtkWidget *window1, const char * immagine_xpm, GtkWidget* Menu,char* label, gboolean state, int Number) |
31 { | 69 { |
70 GtkWidget * Label = NULL; | |
71 GtkWidget * Pixmap = NULL; | |
72 GtkWidget * hbox = NULL; | |
32 GtkWidget * Item = NULL; | 73 GtkWidget * Item = NULL; |
33 Item=gtk_check_menu_item_new_with_label( label ); | 74 |
75 GdkPixmap *PixmapIcon = NULL; | |
76 GdkColor transparent; | |
77 GdkBitmap *MaskIcon = NULL; | |
78 | |
79 PixmapIcon = gdk_pixmap_create_from_xpm_d (window1->window, &MaskIcon, &transparent,(gchar **)immagine_xpm ); | |
80 Pixmap = gtk_pixmap_new (PixmapIcon, MaskIcon); | |
81 gdk_pixmap_unref (PixmapIcon); | |
82 | |
83 Item=gtk_check_menu_item_new(); | |
84 Label = gtk_label_new (label); | |
85 | |
86 hbox = gtk_hbox_new (FALSE, 8); | |
87 gtk_box_pack_start (GTK_BOX (hbox), Pixmap, FALSE, FALSE, 0); | |
88 gtk_box_pack_start (GTK_BOX (hbox), Label, FALSE, FALSE, 0); | |
89 gtk_container_add (GTK_CONTAINER (Item), hbox); | |
90 | |
34 gtk_menu_append( GTK_MENU( Menu ),Item ); | 91 gtk_menu_append( GTK_MENU( Menu ),Item ); |
92 | |
35 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(Item),state); | 93 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(Item),state); |
36 gtk_signal_connect_object( GTK_OBJECT(Item),"activate", | 94 gtk_signal_connect_object( GTK_OBJECT(Item),"activate", |
37 GTK_SIGNAL_FUNC(ActivateMenuItem),(gpointer)Number ); | 95 GTK_SIGNAL_FUNC(ActivateMenuItem),(gpointer)Number ); |
38 gtk_widget_show( Item ); | 96 gtk_menu_item_right_justify (GTK_MENU_ITEM (Item)); |
97 gtk_widget_show_all(Item); | |
98 | |
39 return Item; | 99 return Item; |
40 } | 100 } |
41 | 101 GtkWidget * AddMenuItem( GtkWidget *window1, const char * immagine_xpm, GtkWidget * SubMenu,char * label,int Number ) |
42 | 102 { |
43 GtkWidget * AddMenuItem( GtkWidget * Menu,char * label,int Number ) | 103 GtkWidget * Label = NULL; |
44 { | 104 GtkWidget * Pixmap = NULL; |
105 GtkWidget * hbox = NULL; | |
45 GtkWidget * Item = NULL; | 106 GtkWidget * Item = NULL; |
46 Item=gtk_menu_item_new_with_label( label ); | 107 GdkPixmap * PixmapIcon = NULL; |
47 gtk_menu_append( GTK_MENU( Menu ),Item ); | 108 GdkColor transparent; |
109 GdkBitmap * MaskIcon = NULL; | |
110 | |
111 PixmapIcon = gdk_pixmap_create_from_xpm_d (window1->window, &MaskIcon, &transparent,(gchar **)immagine_xpm ); | |
112 Pixmap = gtk_pixmap_new (PixmapIcon, MaskIcon); | |
113 gdk_pixmap_unref (PixmapIcon); | |
114 | |
115 Item=gtk_menu_item_new(); | |
116 Label = gtk_label_new (label); | |
117 | |
118 hbox = gtk_hbox_new (FALSE, 8); | |
119 gtk_box_pack_start (GTK_BOX (hbox), Pixmap, FALSE, FALSE, 0); | |
120 gtk_box_pack_start (GTK_BOX (hbox), Label, FALSE, FALSE, 0); | |
121 gtk_container_add (GTK_CONTAINER (Item), hbox); | |
122 | |
123 | |
124 gtk_menu_append( GTK_MENU( SubMenu ),Item ); | |
48 gtk_signal_connect_object( GTK_OBJECT(Item),"activate", | 125 gtk_signal_connect_object( GTK_OBJECT(Item),"activate", |
49 GTK_SIGNAL_FUNC(ActivateMenuItem),(gpointer)Number ); | 126 GTK_SIGNAL_FUNC(ActivateMenuItem),(gpointer)Number ); |
50 gtk_widget_show( Item ); | 127 |
128 gtk_menu_item_right_justify (GTK_MENU_ITEM (Item)); | |
129 gtk_widget_show_all(Item); | |
51 return Item; | 130 return Item; |
52 } | 131 } |
53 | 132 |
54 GtkWidget * AddSubMenu( GtkWidget * Menu,char * label ) | 133 |
55 { | 134 GtkWidget * AddSubMenu( GtkWidget *window1, const char * immagine_xpm, GtkWidget * Menu,char * label ) |
135 { | |
136 GtkWidget * Label = NULL; | |
137 GtkWidget * Pixmap = NULL; | |
138 GtkWidget * hbox = NULL; | |
56 GtkWidget * Item = NULL; | 139 GtkWidget * Item = NULL; |
57 GtkWidget * SubItem = NULL; | 140 GtkWidget * SubItem = NULL; |
58 | 141 GdkPixmap * PixmapIcon = NULL; |
59 SubItem=gtk_menu_item_new_with_label( label ); | 142 GdkColor transparent; |
143 GdkBitmap * MaskIcon = NULL; | |
144 | |
145 PixmapIcon = gdk_pixmap_create_from_xpm_d (window1->window, &MaskIcon, &transparent,(gchar **)immagine_xpm); | |
146 Pixmap = gtk_pixmap_new (PixmapIcon, MaskIcon); | |
147 gdk_pixmap_unref (PixmapIcon); | |
148 | |
149 SubItem=gtk_menu_item_new(); | |
150 Item=gtk_menu_new(); | |
151 Label = gtk_label_new (label); | |
152 | |
153 hbox = gtk_hbox_new (FALSE, 8); | |
154 gtk_box_pack_start (GTK_BOX (hbox), Pixmap, FALSE, FALSE, 0); | |
155 gtk_box_pack_start (GTK_BOX (hbox), Label, FALSE, FALSE, 0); | |
156 gtk_container_add (GTK_CONTAINER (SubItem), hbox); | |
157 | |
60 gtk_menu_append( GTK_MENU( Menu ),SubItem ); | 158 gtk_menu_append( GTK_MENU( Menu ),SubItem ); |
61 gtk_widget_show( SubItem ); | |
62 | |
63 Item=gtk_menu_new(); | |
64 gtk_widget_show( Item ); | |
65 gtk_menu_item_set_submenu( GTK_MENU_ITEM( SubItem ),Item ); | 159 gtk_menu_item_set_submenu( GTK_MENU_ITEM( SubItem ),Item ); |
160 | |
161 gtk_widget_show_all( SubItem ); | |
66 return Item; | 162 return Item; |
67 } | 163 } |
68 | 164 |
69 GtkWidget * AddSeparator( GtkWidget * Menu ) | 165 GtkWidget * AddSeparator( GtkWidget * Menu ) |
70 { | 166 { |
283 GtkWidget * VCDSubMenu; | 379 GtkWidget * VCDSubMenu; |
284 GtkWidget * VCDTitleMenu; | 380 GtkWidget * VCDTitleMenu; |
285 | 381 |
286 GtkWidget * create_PopUpMenu( void ) | 382 GtkWidget * create_PopUpMenu( void ) |
287 { | 383 { |
384 GtkWidget * window1; | |
288 GtkWidget * Menu = NULL; | 385 GtkWidget * Menu = NULL; |
289 GtkWidget * SubMenu = NULL; | 386 GtkWidget * SubMenu = NULL; |
290 GtkWidget * MenuItem = NULL; | 387 GtkWidget * MenuItem = NULL; |
291 GtkWidget * N, * D, * F; | 388 GtkWidget * N, * D, * F; |
292 | 389 |
293 Menu=gtk_menu_new(); | 390 Menu=gtk_menu_new(); |
294 | 391 gtk_widget_realize (Menu); |
295 AddMenuItem( Menu,MSGTR_MENU_AboutMPlayer" ", evAbout ); | 392 window1 = gtk_widget_get_toplevel(Menu); |
393 | |
394 AddMenuItem( window1, (const char*)ab_xpm, Menu,MSGTR_MENU_AboutMPlayer" ", evAbout ); | |
296 AddSeparator( Menu ); | 395 AddSeparator( Menu ); |
297 SubMenu=AddSubMenu( Menu,MSGTR_MENU_Open ); | 396 SubMenu=AddSubMenu( window1, (const char*)open_xpm, Menu,MSGTR_MENU_Open ); |
298 AddMenuItem( SubMenu,MSGTR_MENU_PlayFile" ", evLoadPlay ); | 397 AddMenuItem( window1, (const char*)file2_xpm, SubMenu,MSGTR_MENU_PlayFile" ", evLoadPlay ); |
299 #ifdef HAVE_VCD | 398 #ifdef HAVE_VCD |
300 AddMenuItem( SubMenu,MSGTR_MENU_PlayVCD, evPlayVCD ); | 399 AddMenuItem( window1, (const char*)playvcd_xpm, SubMenu,MSGTR_MENU_PlayVCD, evPlayVCD ); |
301 #endif | 400 #endif |
302 #ifdef USE_DVDREAD | 401 #ifdef USE_DVDREAD |
303 AddMenuItem( SubMenu,MSGTR_MENU_PlayDVD, evPlayDVD ); | 402 AddMenuItem( window1, (const char*)playdvd_xpm, SubMenu,MSGTR_MENU_PlayDVD, evPlayDVD ); |
304 #endif | 403 #endif |
305 AddMenuItem( SubMenu,MSGTR_MENU_PlayURL, evSetURL ); | 404 AddMenuItem( window1, (const char*)url_xpm, SubMenu,MSGTR_MENU_PlayURL, evSetURL ); |
306 AddMenuItem( SubMenu,MSGTR_MENU_LoadSubtitle" ", evLoadSubtitle ); | 405 AddMenuItem( window1, (const char*)sub_xpm, SubMenu,MSGTR_MENU_LoadSubtitle" ", evLoadSubtitle ); |
307 AddMenuItem( SubMenu,MSGTR_MENU_DropSubtitle,evDropSubtitle ); | 406 AddMenuItem( window1, (const char*)delsub_xpm, SubMenu,MSGTR_MENU_DropSubtitle,evDropSubtitle ); |
308 AddMenuItem( SubMenu,MSGTR_MENU_LoadExternAudioFile, evLoadAudioFile ); | 407 AddMenuItem( window1, (const char*)loadeaf_xpm, SubMenu,MSGTR_MENU_LoadExternAudioFile, evLoadAudioFile ); |
309 SubMenu=AddSubMenu( Menu,MSGTR_MENU_Playing ); | 408 SubMenu=AddSubMenu(window1, (const char*)play_xpm, Menu,MSGTR_MENU_Playing ); |
310 AddMenuItem( SubMenu,MSGTR_MENU_Play" ", evPlay ); | 409 AddMenuItem( window1, (const char*)play_xpm, SubMenu,MSGTR_MENU_Play" ", evPlay ); |
311 AddMenuItem( SubMenu,MSGTR_MENU_Pause, evPause ); | 410 AddMenuItem( window1, (const char*)pause_xpm, SubMenu,MSGTR_MENU_Pause, evPause ); |
312 AddMenuItem( SubMenu,MSGTR_MENU_Stop, evStop ); | 411 AddMenuItem( window1, (const char*)stop2_xpm, SubMenu,MSGTR_MENU_Stop, evStop ); |
313 AddMenuItem( SubMenu,MSGTR_MENU_NextStream, evNext ); | 412 AddMenuItem( window1, (const char*)next_xpm, SubMenu,MSGTR_MENU_NextStream, evNext ); |
314 AddMenuItem( SubMenu,MSGTR_MENU_PrevStream, evPrev ); | 413 AddMenuItem( window1, (const char*)prev_xpm, SubMenu,MSGTR_MENU_PrevStream, evPrev ); |
315 // AddSeparator( SubMenu ); | 414 // AddSeparator( SubMenu ); |
316 // AddMenuItem( SubMenu,"Back 10 sec", evBackward10sec ); | 415 // AddMenuItem( SubMenu,"Back 10 sec", evBackward10sec ); |
317 // AddMenuItem( SubMenu,"Fwd 10 sec", evForward10sec ); | 416 // AddMenuItem( SubMenu,"Fwd 10 sec", evForward10sec ); |
318 // AddMenuItem( SubMenu,"Back 1 min", evBackward1min ); | 417 // AddMenuItem( SubMenu,"Back 1 min", evBackward1min ); |
319 // AddMenuItem( SubMenu,"Fwd 1 min", evForward1min ); | 418 // AddMenuItem( SubMenu,"Fwd 1 min", evForward1min ); |
320 // SubMenu=AddSubMenu( Menu,MSGTR_MENU_Size ); | 419 // SubMenu=AddSubMenu( Menu,MSGTR_MENU_Size ); |
321 // AddMenuItem( SubMenu,MSGTR_MENU_NormalSize" ", evNormalSize ); | 420 // AddMenuItem( SubMenu,MSGTR_MENU_NormalSize" ", evNormalSize ); |
322 // AddMenuItem( SubMenu,MSGTR_MENU_DoubleSize, evDoubleSize ); | 421 // AddMenuItem( SubMenu,MSGTR_MENU_DoubleSize, evDoubleSize ); |
323 // AddMenuItem( SubMenu,MSGTR_MENU_FullScreen, evFullScreen ); | 422 // AddMenuItem( SubMenu,MSGTR_MENU_FullScreen, evFullScreen ); |
324 #ifdef HAVE_VCD | 423 #ifdef HAVE_VCD |
325 VCDSubMenu=AddSubMenu( Menu,MSGTR_MENU_VCD ); | 424 VCDSubMenu=AddSubMenu( window1, (const char*)vcd_xpm, Menu,MSGTR_MENU_VCD ); |
326 AddMenuItem( VCDSubMenu,MSGTR_MENU_PlayDisc,evPlayVCD ); | 425 AddMenuItem( window1, (const char*)playvcd_xpm, VCDSubMenu,MSGTR_MENU_PlayDisc,evPlayVCD ); |
327 AddSeparator( VCDSubMenu ); | 426 AddSeparator( VCDSubMenu ); |
328 VCDTitleMenu=AddSubMenu( VCDSubMenu,MSGTR_MENU_Titles ); | 427 VCDTitleMenu=AddSubMenu( window1, (const char*)title_xpm, VCDSubMenu,MSGTR_MENU_Titles ); |
329 if ( guiIntfStruct.VCDTracks ) | 428 if ( guiIntfStruct.VCDTracks ) |
330 { | 429 { |
331 char tmp[32]; int i; | 430 char tmp[32]; int i; |
332 for ( i=0;i < guiIntfStruct.VCDTracks;i++ ) | 431 for ( i=0;i < guiIntfStruct.VCDTracks;i++ ) |
333 { | 432 { |
334 snprintf( tmp,32,MSGTR_MENU_Title,i+1 ); | 433 snprintf( tmp,32,MSGTR_MENU_Title,i+1 ); |
335 AddMenuItem( VCDTitleMenu,tmp,( (i+1) << 16 ) + evSetVCDTrack ); | 434 //AddMenuItem( VCDTitleMenu,tmp,( (i+1) << 16 ) + evSetVCDTrack ); |
435 AddMenuItem(window1, (const char*)empty_xpm, VCDTitleMenu,tmp,( (i+1) << 16 ) + evSetVCDTrack ); | |
336 } | 436 } |
337 } | 437 } |
338 else | 438 else |
339 { | 439 { |
340 MenuItem=AddMenuItem( VCDTitleMenu,MSGTR_MENU_None,evNone ); | 440 MenuItem=AddMenuItem( window1, (const char*)empty_xpm, VCDTitleMenu,MSGTR_MENU_None,evNone ); |
341 gtk_widget_set_sensitive( MenuItem,FALSE ); | 441 gtk_widget_set_sensitive( MenuItem,FALSE ); |
342 } | 442 } |
343 #endif | 443 #endif |
344 #ifdef USE_DVDREAD | 444 #ifdef USE_DVDREAD |
345 DVDSubMenu=AddSubMenu( Menu,MSGTR_MENU_DVD ); | 445 DVDSubMenu=AddSubMenu( window1, (const char*)dvd_xpm, Menu,MSGTR_MENU_DVD ); |
346 AddMenuItem( DVDSubMenu,MSGTR_MENU_PlayDisc" ", evPlayDVD ); | 446 AddMenuItem( window1, (const char*)playdvd_xpm, DVDSubMenu,MSGTR_MENU_PlayDisc" ", evPlayDVD ); |
347 // AddMenuItem( DVDSubMenu,MSGTR_MENU_ShowDVDMenu, evNone ); | 447 // AddMenuItem( DVDSubMenu,MSGTR_MENU_ShowDVDMenu, evNone ); |
348 AddSeparator( DVDSubMenu ); | 448 AddSeparator( DVDSubMenu ); |
349 DVDTitleMenu=AddSubMenu( DVDSubMenu,MSGTR_MENU_Titles ); | 449 DVDTitleMenu=AddSubMenu( window1, (const char*)title_xpm, DVDSubMenu,MSGTR_MENU_Titles ); |
350 if ( guiIntfStruct.DVD.titles ) | 450 if ( guiIntfStruct.DVD.titles ) |
351 { | 451 { |
352 char tmp[32]; int i; | 452 char tmp[32]; int i; |
353 for ( i=1 ; i<= guiIntfStruct.DVD.titles;i++ ) | 453 for ( i=1 ; i<= guiIntfStruct.DVD.titles;i++ ) |
354 { | 454 { |
355 snprintf( tmp,32,MSGTR_MENU_Title,i); | 455 snprintf( tmp,32,MSGTR_MENU_Title,i); |
356 AddMenuCheckItem( DVDTitleMenu,tmp, | 456 AddMenuCheckItem( window1, (const char*)empty1px_xpm, DVDTitleMenu,tmp, |
357 guiIntfStruct.DVD.current_title == i, | 457 guiIntfStruct.DVD.current_title == i, |
358 (i << 16) + evSetDVDTitle ); | 458 (i << 16) + evSetDVDTitle ); |
359 } | 459 } |
360 } | 460 } |
361 else | 461 else |
362 { | 462 { |
363 MenuItem=AddMenuItem( DVDTitleMenu,MSGTR_MENU_None,evNone ); | 463 MenuItem=AddMenuItem( window1, (const char*)empty_xpm, DVDTitleMenu,MSGTR_MENU_None,evNone ); |
364 gtk_widget_set_sensitive( MenuItem,FALSE ); | 464 gtk_widget_set_sensitive( MenuItem,FALSE ); |
365 } | 465 } |
366 DVDChapterMenu=AddSubMenu( DVDSubMenu,MSGTR_MENU_Chapters ); | 466 DVDChapterMenu=AddSubMenu( window1, (const char*)chapter_xpm, DVDSubMenu,MSGTR_MENU_Chapters ); |
367 if ( guiIntfStruct.DVD.chapters ) | 467 if ( guiIntfStruct.DVD.chapters ) |
368 { | 468 { |
369 char tmp[32]; int i; | 469 char tmp[32]; int i; |
370 for ( i=1;i <= guiIntfStruct.DVD.chapters;i++ ) | 470 for ( i=1;i <= guiIntfStruct.DVD.chapters;i++ ) |
371 { | 471 { |
372 snprintf( tmp,32,MSGTR_MENU_Chapter,i ); | 472 snprintf( tmp,32,MSGTR_MENU_Chapter,i ); |
373 AddMenuCheckItem( DVDChapterMenu,tmp,guiIntfStruct.DVD.current_chapter == i, | 473 AddMenuCheckItem( window1, (const char*)empty1px_xpm, DVDChapterMenu,tmp,guiIntfStruct.DVD.current_chapter == i, |
374 ( i << 16 ) + evSetDVDChapter ); | 474 ( i << 16 ) + evSetDVDChapter ); |
375 } | 475 } |
376 } | 476 } |
377 else | 477 else |
378 { | 478 { |
379 MenuItem=AddMenuItem( DVDChapterMenu,MSGTR_MENU_None,evNone ); | 479 MenuItem=AddMenuItem( window1, (const char*)empty_xpm, DVDChapterMenu,MSGTR_MENU_None,evNone ); |
380 gtk_widget_set_sensitive( MenuItem,FALSE ); | 480 gtk_widget_set_sensitive( MenuItem,FALSE ); |
381 } | 481 } |
382 DVDAudioLanguageMenu=AddSubMenu( DVDSubMenu,MSGTR_MENU_AudioLanguages ); | 482 DVDAudioLanguageMenu=AddSubMenu( window1, (const char*)tongue_xpm, DVDSubMenu,MSGTR_MENU_AudioLanguages ); |
383 if ( guiIntfStruct.DVD.nr_of_audio_channels ) | 483 if ( guiIntfStruct.DVD.nr_of_audio_channels ) |
384 { | 484 { |
385 char tmp[64]; int i, id = guiIntfStruct.demuxer ? ((demuxer_t *)guiIntfStruct.demuxer)->audio->id : audio_id; | 485 char tmp[64]; int i, id = guiIntfStruct.demuxer ? ((demuxer_t *)guiIntfStruct.demuxer)->audio->id : audio_id; |
386 for ( i=0;i < guiIntfStruct.DVD.nr_of_audio_channels;i++ ) | 486 for ( i=0;i < guiIntfStruct.DVD.nr_of_audio_channels;i++ ) |
387 { | 487 { |
388 snprintf( tmp,64,"%s - %s %s",GetLanguage( guiIntfStruct.DVD.audio_streams[i].language ), | 488 snprintf( tmp,64,"%s - %s %s",GetLanguage( guiIntfStruct.DVD.audio_streams[i].language ), |
389 ChannelTypes[ guiIntfStruct.DVD.audio_streams[i].type ], | 489 ChannelTypes[ guiIntfStruct.DVD.audio_streams[i].type ], |
390 ChannelNumbers[ guiIntfStruct.DVD.audio_streams[i].channels ] ); | 490 ChannelNumbers[ guiIntfStruct.DVD.audio_streams[i].channels ] ); |
391 // if ( id == -1 ) id=audio_id; //guiIntfStruct.DVD.audio_streams[i].id; | 491 // if ( id == -1 ) id=audio_id; //guiIntfStruct.DVD.audio_streams[i].id; |
392 AddMenuCheckItem( DVDAudioLanguageMenu,tmp, | 492 AddMenuCheckItem( window1, (const char*)dolby_xpm, DVDAudioLanguageMenu,tmp, |
393 id == guiIntfStruct.DVD.audio_streams[i].id, | 493 id == guiIntfStruct.DVD.audio_streams[i].id, |
394 ( guiIntfStruct.DVD.audio_streams[i].id << 16 ) + evSetDVDAudio ); | 494 ( guiIntfStruct.DVD.audio_streams[i].id << 16 ) + evSetDVDAudio ); |
395 } | 495 } |
396 } | 496 } |
397 else | 497 else |
398 { | 498 { |
399 MenuItem=AddMenuItem( DVDAudioLanguageMenu,MSGTR_MENU_None,evNone ); | 499 MenuItem=AddMenuItem( window1, (const char*)empty_xpm, DVDAudioLanguageMenu,MSGTR_MENU_None,evNone ); |
400 gtk_widget_set_sensitive( MenuItem,FALSE ); | 500 gtk_widget_set_sensitive( MenuItem,FALSE ); |
401 } | 501 } |
402 DVDSubtitleLanguageMenu=AddSubMenu( DVDSubMenu,MSGTR_MENU_SubtitleLanguages ); | 502 DVDSubtitleLanguageMenu=AddSubMenu( window1, (const char*)tonguebla_xpm, DVDSubMenu,MSGTR_MENU_SubtitleLanguages ); |
403 if ( guiIntfStruct.DVD.nr_of_subtitles ) | 503 if ( guiIntfStruct.DVD.nr_of_subtitles ) |
404 { | 504 { |
405 char tmp[64]; int i; | 505 char tmp[64]; int i; |
406 AddMenuItem( DVDSubtitleLanguageMenu,MSGTR_MENU_None,( (unsigned short)-1 << 16 ) + evSetDVDSubtitle ); | 506 AddMenuItem( window1, (const char*)empty1px_xpm, DVDSubtitleLanguageMenu,MSGTR_MENU_None,( (unsigned short)-1 << 16 ) + evSetDVDSubtitle ); |
407 for ( i=0;i < guiIntfStruct.DVD.nr_of_subtitles;i++ ) | 507 for ( i=0;i < guiIntfStruct.DVD.nr_of_subtitles;i++ ) |
408 { | 508 { |
409 snprintf( tmp,64,"%s",GetLanguage( guiIntfStruct.DVD.subtitles[i].language ) ); | 509 snprintf( tmp,64,"%s",GetLanguage( guiIntfStruct.DVD.subtitles[i].language ) ); |
410 AddMenuCheckItem( DVDSubtitleLanguageMenu,tmp, | 510 AddMenuCheckItem( window1, (const char*)empty1px_xpm, DVDSubtitleLanguageMenu,tmp, |
411 dvdsub_id == guiIntfStruct.DVD.subtitles[i].id, | 511 dvdsub_id == guiIntfStruct.DVD.subtitles[i].id, |
412 ( guiIntfStruct.DVD.subtitles[i].id << 16 ) + evSetDVDSubtitle ); | 512 ( guiIntfStruct.DVD.subtitles[i].id << 16 ) + evSetDVDSubtitle ); |
413 } | 513 } |
414 } | 514 } |
415 else | 515 else |
416 { | 516 { |
417 MenuItem=AddMenuItem( DVDSubtitleLanguageMenu,MSGTR_MENU_None,evNone ); | 517 MenuItem=AddMenuItem( window1, (const char*)empty_xpm, DVDSubtitleLanguageMenu,MSGTR_MENU_None,evNone ); |
418 gtk_widget_set_sensitive( MenuItem,FALSE ); | 518 gtk_widget_set_sensitive( MenuItem,FALSE ); |
419 } | 519 } |
420 #endif | 520 #endif |
421 | 521 |
422 // if ( guiIntfStruct.Playing ) | 522 // if ( guiIntfStruct.Playing ) |
423 { | 523 { |
424 AspectMenu=AddSubMenu( Menu,MSGTR_MENU_AspectRatio ); | 524 AspectMenu=AddSubMenu( window1, (const char*)aspect_xpm, Menu,MSGTR_MENU_AspectRatio ); |
425 AddMenuItem( AspectMenu,MSGTR_MENU_Original,( 1 << 16 ) + evSetAspect ); | 525 AddMenuItem( window1, (const char*)a11_xpm, AspectMenu,MSGTR_MENU_Original,( 1 << 16 ) + evSetAspect ); |
426 AddMenuItem( AspectMenu,"16:9",( 2 << 16 ) + evSetAspect ); | 526 AddMenuItem( window1, (const char*)a169_xpm, AspectMenu,"16:9",( 2 << 16 ) + evSetAspect ); |
427 AddMenuItem( AspectMenu,"4:3",( 3 << 16 ) + evSetAspect ); | 527 AddMenuItem( window1, (const char*)a43_xpm, AspectMenu,"4:3",( 3 << 16 ) + evSetAspect ); |
428 AddMenuItem( AspectMenu,"2.35",( 4 << 16 ) + evSetAspect ); | 528 AddMenuItem( window1, (const char*)a235_xpm, AspectMenu,"2.35",( 4 << 16 ) + evSetAspect ); |
429 } | 529 } |
430 | 530 |
431 if ( guiIntfStruct.Playing && guiIntfStruct.demuxer && guiIntfStruct.StreamType != STREAMTYPE_DVD ) | 531 if ( guiIntfStruct.Playing && guiIntfStruct.demuxer && guiIntfStruct.StreamType != STREAMTYPE_DVD ) |
432 { | 532 { |
433 int i,c = 0; | 533 int i,c = 0; |
435 for ( i=0;i < MAX_A_STREAMS;i++ ) | 535 for ( i=0;i < MAX_A_STREAMS;i++ ) |
436 if ( ((demuxer_t *)guiIntfStruct.demuxer)->a_streams[i] ) c++; | 536 if ( ((demuxer_t *)guiIntfStruct.demuxer)->a_streams[i] ) c++; |
437 | 537 |
438 if ( c > 1 ) | 538 if ( c > 1 ) |
439 { | 539 { |
440 SubMenu=AddSubMenu( Menu,MSGTR_MENU_AudioTrack ); | 540 SubMenu=AddSubMenu( window1, (const char*)empty_xpm, Menu,MSGTR_MENU_AudioTrack ); |
441 for ( i=0;i < MAX_A_STREAMS;i++ ) | 541 for ( i=0;i < MAX_A_STREAMS;i++ ) |
442 if ( ((demuxer_t *)guiIntfStruct.demuxer)->a_streams[i] ) | 542 if ( ((demuxer_t *)guiIntfStruct.demuxer)->a_streams[i] ) |
443 { | 543 { |
444 char tmp[32]; | 544 char tmp[32]; |
445 snprintf( tmp,32,MSGTR_MENU_Track,i ); | 545 snprintf( tmp,32,MSGTR_MENU_Track,i ); |
446 AddMenuItem( SubMenu,tmp,( i << 16 ) + evSetAudio ); | 546 AddMenuItem( window1, (const char*)empty_xpm, SubMenu,tmp,( i << 16 ) + evSetAudio ); |
447 } | 547 } |
448 } | 548 } |
449 | 549 |
450 for ( c=0,i=0;i < MAX_V_STREAMS;i++ ) | 550 for ( c=0,i=0;i < MAX_V_STREAMS;i++ ) |
451 if ( ((demuxer_t *)guiIntfStruct.demuxer)->v_streams[i] ) c++; | 551 if ( ((demuxer_t *)guiIntfStruct.demuxer)->v_streams[i] ) c++; |
452 | 552 |
453 if ( c > 1 ) | 553 if ( c > 1 ) |
454 { | 554 { |
455 SubMenu=AddSubMenu( Menu,MSGTR_MENU_VideoTrack ); | 555 SubMenu=AddSubMenu( window1, (const char*)empty_xpm, Menu,MSGTR_MENU_VideoTrack ); |
456 for ( i=0;i < MAX_V_STREAMS;i++ ) | 556 for ( i=0;i < MAX_V_STREAMS;i++ ) |
457 if ( ((demuxer_t *)guiIntfStruct.demuxer)->v_streams[i] ) | 557 if ( ((demuxer_t *)guiIntfStruct.demuxer)->v_streams[i] ) |
458 { | 558 { |
459 char tmp[32]; | 559 char tmp[32]; |
460 snprintf( tmp,32,MSGTR_MENU_Track,i ); | 560 snprintf( tmp,32,MSGTR_MENU_Track,i ); |
461 AddMenuItem( SubMenu,tmp,( i << 16 ) + evSetVideo ); | 561 AddMenuItem( window1, (const char*)empty_xpm, SubMenu,tmp,( i << 16 ) + evSetVideo ); |
462 } | 562 } |
463 } | 563 } |
464 } | 564 } |
465 | 565 |
466 AddSeparator( Menu ); | 566 AddSeparator( Menu ); |
467 MenuItem=AddMenuCheckItem( Menu,MSGTR_MENU_Mute,mixer.muted,evMute ); | 567 MenuItem=AddMenuCheckItem( window1, (const char*)sound_xpm, Menu,MSGTR_MENU_Mute,mixer.muted,evMute ); |
468 if ( !guiIntfStruct.AudioType ) gtk_widget_set_sensitive( MenuItem,FALSE ); | 568 if ( !guiIntfStruct.AudioType ) gtk_widget_set_sensitive( MenuItem,FALSE ); |
469 AddMenuItem( Menu,MSGTR_MENU_PlayList, evPlayList ); | 569 AddMenuItem( window1, (const char*)pl_xpm, Menu,MSGTR_MENU_PlayList, evPlayList ); |
470 AddMenuItem( Menu,MSGTR_MENU_SkinBrowser, evSkinBrowser ); | 570 AddMenuItem( window1, (const char*)skin_xpm, Menu,MSGTR_MENU_SkinBrowser, evSkinBrowser ); |
471 AddMenuItem( Menu,MSGTR_MENU_Preferences, evPreferences ); | 571 AddMenuItem( window1, (const char*)prefs_xpm, Menu,MSGTR_MENU_Preferences, evPreferences ); |
472 AddMenuItem( Menu,MSGTR_Equalizer, evEqualizer ); | 572 AddMenuItem( window1, (const char*)eq_xpm, Menu,MSGTR_Equalizer, evEqualizer ); |
473 | 573 |
474 if ( guiIntfStruct.NoWindow == False ) | 574 if ( guiIntfStruct.NoWindow == False ) |
475 { | 575 { |
476 int b1 = 0, b2 = 0; | 576 int b1 = 0, b2 = 0; |
477 AddSeparator( Menu ); | 577 AddSeparator( Menu ); |
479 { | 579 { |
480 if ( ( appMPlayer.subWindow.Width == guiIntfStruct.MovieWidth * 2 )&& | 580 if ( ( appMPlayer.subWindow.Width == guiIntfStruct.MovieWidth * 2 )&& |
481 ( appMPlayer.subWindow.Height == guiIntfStruct.MovieHeight * 2 ) ) b2=1; | 581 ( appMPlayer.subWindow.Height == guiIntfStruct.MovieHeight * 2 ) ) b2=1; |
482 else b1=1; | 582 else b1=1; |
483 } else b1=!appMPlayer.subWindow.isFullScreen; | 583 } else b1=!appMPlayer.subWindow.isFullScreen; |
484 N=AddMenuCheckItem( Menu,MSGTR_MENU_NormalSize" ",b1,evNormalSize ); | 584 N=AddMenuCheckItem( window1, (const char*)normal_xpm, Menu,MSGTR_MENU_NormalSize" ",b1,evNormalSize ); |
485 D=AddMenuCheckItem( Menu,MSGTR_MENU_DoubleSize,b2,evDoubleSize ); | 585 D=AddMenuCheckItem( window1, (const char*)double_xpm, Menu,MSGTR_MENU_DoubleSize,b2,evDoubleSize ); |
486 F=AddMenuCheckItem( Menu,MSGTR_MENU_FullScreen,appMPlayer.subWindow.isFullScreen,evFullScreen ); | 586 F=AddMenuCheckItem( window1, (const char*)fs_xpm, Menu,MSGTR_MENU_FullScreen,appMPlayer.subWindow.isFullScreen,evFullScreen ); |
487 } | 587 } |
488 | 588 |
489 if ( !gtkShowVideoWindow && !guiIntfStruct.Playing ) | 589 if ( !gtkShowVideoWindow && !guiIntfStruct.Playing ) |
490 { | 590 { |
491 gtk_widget_set_sensitive( N,FALSE ); | 591 gtk_widget_set_sensitive( N,FALSE ); |
492 gtk_widget_set_sensitive( D,FALSE ); | 592 gtk_widget_set_sensitive( D,FALSE ); |
493 gtk_widget_set_sensitive( F,FALSE ); | 593 gtk_widget_set_sensitive( F,FALSE ); |
494 } | 594 } |
495 | 595 |
496 AddSeparator( Menu ); | 596 AddSeparator( Menu ); |
497 AddMenuItem( Menu,MSGTR_MENU_Exit, evExit ); | 597 AddMenuItem( window1, (const char*)exit_xpm, Menu,MSGTR_MENU_Exit, evExit ); |
498 | 598 |
499 return Menu; | 599 return Menu; |
500 } | 600 } |