annotate Gui/mplayer/gtk/menu.c @ 8435:930acd4ce715

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