Mercurial > mplayer.hg
annotate gui/dialog/menu.c @ 36705:5697842046d2
Add language to embedded subtitle track information.
author | ib |
---|---|
date | Fri, 07 Feb 2014 19:16:22 +0000 |
parents | a37f9abea303 |
children | 8ca87345a6c2 |
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" | |
36705 | 28 #include "mp_core.h" |
33572 | 29 |
30 #include "menu.h" | |
35529 | 31 #include "dialog.h" |
35772 | 32 #include "gui/ui/actions.h" |
35525 | 33 #include "gui/app/app.h" |
34 #include "gui/app/gui.h" | |
33738 | 35 #include "gui/interface.h" |
33572 | 36 |
37 #include "stream/stream.h" | |
36273 | 38 #include "libavutil/common.h" |
39 #include "libmpcodecs/vd.h" | |
33572 | 40 #include "libmpdemux/demuxer.h" |
41 #include "libmpdemux/stheader.h" | |
42 #include "libavutil/avstring.h" | |
43 | |
35526 | 44 #include "pixmaps/about.xpm" |
45 #include "pixmaps/half.xpm" | |
46 #include "pixmaps/normal.xpm" | |
47 #include "pixmaps/double.xpm" | |
48 #include "pixmaps/full.xpm" | |
49 #include "pixmaps/exit.xpm" | |
50 #include "pixmaps/prefs.xpm" | |
51 #include "pixmaps/equalizer.xpm" | |
52 #include "pixmaps/playlist.xpm" | |
53 #include "pixmaps/skin.xpm" | |
54 #include "pixmaps/sound.xpm" | |
55 #include "pixmaps/open.xpm" | |
56 #include "pixmaps/play.xpm" | |
57 #include "pixmaps/stop.xpm" | |
58 #include "pixmaps/pause.xpm" | |
59 #include "pixmaps/prev.xpm" | |
60 #include "pixmaps/next.xpm" | |
61 #include "pixmaps/aspect.xpm" | |
62 #include "pixmaps/aspect11.xpm" | |
63 #include "pixmaps/aspect169.xpm" | |
64 #include "pixmaps/aspect235.xpm" | |
65 #include "pixmaps/aspect43.xpm" | |
66 #include "pixmaps/file2.xpm" | |
67 #include "pixmaps/url.xpm" | |
68 #include "pixmaps/sub.xpm" | |
69 #include "pixmaps/nosub.xpm" | |
70 #include "pixmaps/empty.xpm" | |
71 #include "pixmaps/loadeaf.xpm" | |
72 #include "pixmaps/title.xpm" | |
73 #include "pixmaps/subtitle.xpm" | |
34387 | 74 #ifdef CONFIG_CDDA |
35526 | 75 #include "pixmaps/cd.xpm" |
76 #include "pixmaps/playcd.xpm" | |
34387 | 77 #endif |
34077 | 78 #ifdef CONFIG_VCD |
35526 | 79 #include "pixmaps/vcd.xpm" |
80 #include "pixmaps/playvcd.xpm" | |
34077 | 81 #endif |
33572 | 82 #ifdef CONFIG_DVDREAD |
35526 | 83 #include "pixmaps/dvd.xpm" |
84 #include "pixmaps/playdvd.xpm" | |
85 #include "pixmaps/chapter.xpm" | |
86 #include "pixmaps/dolby.xpm" | |
36665 | 87 #include "pixmaps/audio.xpm" |
36666 | 88 #include "pixmaps/video.xpm" |
34422
b1f2949ca18d
Use empty1px.xpm instead of empty.xpm for check item (and similar) menus.
ib
parents:
34421
diff
changeset
|
89 #endif |
36429 | 90 #ifdef CONFIG_TV |
91 #include "pixmaps/tv.xpm" | |
92 #endif | |
35526 | 93 #include "pixmaps/empty1px.xpm" |
33572 | 94 |
36029
49be954ad61a
Move variable declarations and definitions where they belong.
ib
parents:
36028
diff
changeset
|
95 int gtkPopupMenu; |
49be954ad61a
Move variable declarations and definitions where they belong.
ib
parents:
36028
diff
changeset
|
96 int gtkPopupMenuParam; |
49be954ad61a
Move variable declarations and definitions where they belong.
ib
parents:
36028
diff
changeset
|
97 |
33572 | 98 static void ActivateMenuItem( int Item ) |
99 { | |
100 // fprintf( stderr,"[menu] item: %d.%d\n",Item&0xffff,Item>>16 ); | |
101 gtkPopupMenu=Item & 0x0000ffff; | |
102 gtkPopupMenuParam=Item >> 16; | |
35773 | 103 uiEvent( Item & 0x0000ffff,Item >> 16 ); |
33572 | 104 } |
105 | |
106 static GtkWidget * AddMenuCheckItem(GtkWidget *window1, const char * immagine_xpm, GtkWidget* Menu,const char* label, gboolean state, int Number) | |
107 { | |
108 GtkWidget * Label = NULL; | |
109 GtkWidget * Pixmap = NULL; | |
110 GtkWidget * hbox = NULL; | |
111 GtkWidget * Item = NULL; | |
112 | |
113 GdkPixmap *PixmapIcon = NULL; | |
114 GdkColor transparent; | |
115 GdkBitmap *MaskIcon = NULL; | |
116 | |
117 PixmapIcon = gdk_pixmap_create_from_xpm_d (window1->window, &MaskIcon, &transparent,(gchar **)immagine_xpm ); | |
118 Pixmap = gtk_pixmap_new (PixmapIcon, MaskIcon); | |
119 gdk_pixmap_unref (PixmapIcon); | |
120 | |
121 Item=gtk_check_menu_item_new(); | |
122 Label = gtk_label_new (label); | |
123 | |
124 hbox = gtk_hbox_new (FALSE, 8); | |
125 gtk_box_pack_start (GTK_BOX (hbox), Pixmap, FALSE, FALSE, 0); | |
126 gtk_box_pack_start (GTK_BOX (hbox), Label, FALSE, FALSE, 0); | |
127 gtk_container_add (GTK_CONTAINER (Item), hbox); | |
128 | |
129 gtk_menu_append( GTK_MENU( Menu ),Item ); | |
130 | |
131 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(Item),state); | |
132 gtk_signal_connect_object( GTK_OBJECT(Item),"activate", | |
133 GTK_SIGNAL_FUNC(ActivateMenuItem),(gpointer)Number ); | |
134 gtk_menu_item_right_justify (GTK_MENU_ITEM (Item)); | |
135 gtk_widget_show_all(Item); | |
136 | |
137 return Item; | |
138 } | |
139 GtkWidget * AddMenuItem( GtkWidget *window1, const char * immagine_xpm, GtkWidget * SubMenu,const char * label,int Number ) | |
140 { | |
141 GtkWidget * Label = NULL; | |
142 GtkWidget * Pixmap = NULL; | |
143 GtkWidget * hbox = NULL; | |
144 GtkWidget * Item = NULL; | |
145 GdkPixmap * PixmapIcon = NULL; | |
146 GdkColor transparent; | |
147 GdkBitmap * MaskIcon = NULL; | |
148 | |
149 PixmapIcon = gdk_pixmap_create_from_xpm_d (window1->window, &MaskIcon, &transparent,(gchar **)immagine_xpm ); | |
150 Pixmap = gtk_pixmap_new (PixmapIcon, MaskIcon); | |
151 gdk_pixmap_unref (PixmapIcon); | |
152 | |
153 Item=gtk_menu_item_new(); | |
154 Label = gtk_label_new (label); | |
155 | |
156 hbox = gtk_hbox_new (FALSE, 8); | |
157 gtk_box_pack_start (GTK_BOX (hbox), Pixmap, FALSE, FALSE, 0); | |
158 gtk_box_pack_start (GTK_BOX (hbox), Label, FALSE, FALSE, 0); | |
159 gtk_container_add (GTK_CONTAINER (Item), hbox); | |
160 | |
161 | |
162 gtk_menu_append( GTK_MENU( SubMenu ),Item ); | |
163 gtk_signal_connect_object( GTK_OBJECT(Item),"activate", | |
164 GTK_SIGNAL_FUNC(ActivateMenuItem),(gpointer)Number ); | |
165 | |
166 gtk_menu_item_right_justify (GTK_MENU_ITEM (Item)); | |
167 gtk_widget_show_all(Item); | |
168 return Item; | |
169 } | |
170 | |
171 | |
172 GtkWidget * AddSubMenu( GtkWidget *window1, const char * immagine_xpm, GtkWidget * Menu,const char * label ) | |
173 { | |
174 GtkWidget * Label = NULL; | |
175 GtkWidget * Pixmap = NULL; | |
176 GtkWidget * hbox = NULL; | |
177 GtkWidget * Item = NULL; | |
178 GtkWidget * SubItem = NULL; | |
179 GdkPixmap * PixmapIcon = NULL; | |
180 GdkColor transparent; | |
181 GdkBitmap * MaskIcon = NULL; | |
182 | |
183 PixmapIcon = gdk_pixmap_create_from_xpm_d (window1->window, &MaskIcon, &transparent,(gchar **)immagine_xpm); | |
184 Pixmap = gtk_pixmap_new (PixmapIcon, MaskIcon); | |
185 gdk_pixmap_unref (PixmapIcon); | |
186 | |
187 SubItem=gtk_menu_item_new(); | |
188 Item=gtk_menu_new(); | |
189 Label = gtk_label_new (label); | |
190 | |
191 hbox = gtk_hbox_new (FALSE, 8); | |
192 gtk_box_pack_start (GTK_BOX (hbox), Pixmap, FALSE, FALSE, 0); | |
193 gtk_box_pack_start (GTK_BOX (hbox), Label, FALSE, FALSE, 0); | |
194 gtk_container_add (GTK_CONTAINER (SubItem), hbox); | |
195 | |
196 gtk_menu_append( GTK_MENU( Menu ),SubItem ); | |
197 gtk_menu_item_set_submenu( GTK_MENU_ITEM( SubItem ),Item ); | |
198 | |
199 gtk_widget_show_all( SubItem ); | |
200 return Item; | |
201 } | |
202 | |
203 GtkWidget * AddSeparator( GtkWidget * Menu ) | |
204 { | |
205 GtkWidget * Item = NULL; | |
206 | |
207 Item=gtk_menu_item_new (); | |
208 gtk_widget_show( Item ); | |
209 gtk_container_add( GTK_CONTAINER( Menu ),Item ); | |
210 gtk_widget_set_sensitive( Item,FALSE ); | |
211 | |
212 return Item; | |
213 } | |
214 | |
215 typedef struct | |
216 { | |
217 int id; | |
218 const char * name; | |
219 } Languages_t; | |
220 | |
34454 | 221 #ifdef CONFIG_DVDREAD |
33572 | 222 #define lng( a,b ) ( (int)(a) * 256 + b ) |
223 static Languages_t Languages[] = | |
224 { | |
36702
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
225 { lng( 'a','a' ), "ʿAfár af" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
226 { lng( 'a','b' ), "аҧсуа бызшәа" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
227 { lng( 'a','f' ), "Afrikaans" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
228 { lng( 'a','m' ), "ኣማርኛ" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
229 { lng( 'a','r' ), "العربية" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
230 { lng( 'a','s' ), "অসমীয়া" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
231 { lng( 'a','y' ), "Aymar Aru" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
232 { lng( 'a','z' ), "Azərbaycanca" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
233 { lng( 'b','a' ), "Башҡорт теле" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
234 { lng( 'b','e' ), "беларуская мова" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
235 { lng( 'b','g' ), "български език" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
236 { lng( 'b','i' ), "Bislama" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
237 { lng( 'b','n' ), "বাংলা" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
238 { lng( 'b','o' ), "བོད་སྐད" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
239 { lng( 'b','r' ), "Brezhoneg" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
240 { lng( 'b','s' ), "Bosanski" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
241 { lng( 'c','a' ), "Català" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
242 { lng( 'c','e' ), "Нохчийн мотт" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
243 { lng( 'c','h' ), "Chamoru" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
244 { lng( 'c','o' ), "Corsu" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
245 { lng( 'c','s' ), "Čeština" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
246 { lng( 'c','v' ), "Чӑвашла" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
247 { lng( 'c','y' ), "Cymraeg" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
248 { lng( 'd','a' ), "Dansk" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
249 { lng( 'd','e' ), "Deutsch" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
250 { lng( 'd','z' ), "ཇོང་ཁ" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
251 { lng( 'e','l' ), "Ελληνικά" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
252 { lng( 'e','n' ), "English" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
253 { lng( 'e','o' ), "Esperanto" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
254 { lng( 'e','s' ), "Español" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
255 { lng( 'e','t' ), "Eesti keel" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
256 { lng( 'e','u' ), "Euskara" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
257 { lng( 'f','a' ), "فارسی" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
258 { lng( 'f','i' ), "Suomi" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
259 { lng( 'f','j' ), "Vakaviti" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
260 { lng( 'f','o' ), "Føroyskt" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
261 { lng( 'f','r' ), "Français" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
262 { lng( 'f','y' ), "Frysk" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
263 { lng( 'g','a' ), "Gaeilge" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
264 { lng( 'g','d' ), "Gàidhlig" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
265 { lng( 'g','l' ), "Galego" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
266 { lng( 'g','n' ), "Avañe'ẽ" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
267 { lng( 'g','u' ), "ગુજરાતી" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
268 { lng( 'h','a' ), "هَوُسَ" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
269 { lng( 'h','e' ), "עִבְרִית" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
270 { lng( 'h','i' ), "हिन्दी" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
271 { lng( 'h','r' ), "Hrvatska" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
272 { lng( 'h','u' ), "Magyar" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
273 { lng( 'h','y' ), "Հայերեն" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
274 { lng( 'h','z' ), "Otjiherero" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
275 { lng( 'i','d' ), "Bahasa Indonesia" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
276 { lng( 'i','s' ), "Íslenska" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
277 { lng( 'i','t' ), "Italiano" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
278 { lng( 'i','u' ), "ᐃᓄᒃᑎᑐᑦ" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
279 { lng( 'j','a' ), "日本語" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
280 { lng( 'j','i' ), "יידיש" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
281 { lng( 'j','v' ), "Basa Jawa" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
282 { lng( 'k','a' ), "ქართული" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
283 { lng( 'k','i' ), "Gĩkũyũ" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
284 { lng( 'k','j' ), "Kuanyama" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
285 { lng( 'k','k' ), "Қазақ тілі" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
286 { lng( 'k','l' ), "Kalaallisut" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
287 { lng( 'k','m' ), "ភាសាខ្មែរ" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
288 { lng( 'k','n' ), "ಕನ್ನಡ" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
289 { lng( 'k','o' ), "한국어" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
290 { lng( 'k','s' ), "कॉशुर" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
291 { lng( 'k','u' ), "کوردی" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
292 { lng( 'k','v' ), "коми кыв" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
293 { lng( 'k','y' ), "Кыргызча" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
294 { lng( 'l','a' ), "Lingua latina" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
295 { lng( 'l','b' ), "Lëtzebuergesch" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
296 { lng( 'l','n' ), "Lingála" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
297 { lng( 'l','o' ), "ພາສາລາວ" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
298 { lng( 'l','t' ), "Lietuvių kalba" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
299 { lng( 'l','v' ), "Latviešu" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
300 { lng( 'm','g' ), "Malagasy" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
301 { lng( 'm','h' ), "Kajin M̧ajeļ" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
302 { lng( 'm','i' ), "Te Reo Māori" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
303 { lng( 'm','k' ), "Македонски јазик" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
304 { lng( 'm','l' ), "മലയാളം" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
305 { lng( 'm','n' ), "ᠮᠣᠨᠭᠭᠣᠯ" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
306 { lng( 'm','r' ), "मराठी" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
307 { lng( 'm','s' ), "Bahasa Melayu" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
308 { lng( 'm','t' ), "Malti" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
309 { lng( 'm','y' ), "မြန်မာစကား" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
310 { lng( 'n','b' ), "Bokmål" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
311 { lng( 'n','d' ), "isiNdebele" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
312 { lng( 'n','e' ), "नेपाली" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
313 { lng( 'n','l' ), "Nederlands" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
314 { lng( 'n','n' ), "Nynorsk" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
315 { lng( 'n','r' ), "isiNdebele" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
316 { lng( 'n','v' ), "Diné bizaad" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
317 { lng( 'n','y' ), "Chichewa" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
318 { lng( 'o','c' ), "Occitan" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
319 { lng( 'o','m' ), "Afaan Oromoo" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
320 { lng( 'o','r' ), "ଓଡ଼ିଆ" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
321 { lng( 'o','s' ), "Ирон ӕвзаг" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
322 { lng( 'p','a' ), "ਪੰਜਾਬੀ" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
323 { lng( 'p','l' ), "Język polski" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
324 { lng( 'p','s' ), "پښتو" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
325 { lng( 'p','t' ), "Português" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
326 { lng( 'q','u' ), "Runa Simi" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
327 { lng( 'r','m' ), "Rätoromanisch" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
328 { lng( 'r','n' ), "íkiRǔndi" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
329 { lng( 'r','o' ), "Română)" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
330 { lng( 'r','u' ), "Русский" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
331 { lng( 'r','w' ), "Ikinyarwanda" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
332 { lng( 's','c' ), "Sardu" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
333 { lng( 's','d' ), "سنڌي" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
334 { lng( 's','g' ), "Sängö" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
335 { lng( 's','i' ), "සිංහල" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
336 { lng( 's','k' ), "Slovenčina" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
337 { lng( 's','l' ), "Slovenščina" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
338 { lng( 's','m' ), "Gagana Sāmoa" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
339 { lng( 's','n' ), "chiShona" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
340 { lng( 's','o' ), "Af-ka Soomaali-ga" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
341 { lng( 's','q' ), "Shqip" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
342 { lng( 's','r' ), "Српски" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
343 { lng( 's','s' ), "siSwati" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
344 { lng( 's','t' ), "seSotho" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
345 { lng( 's','u' ), "Basa Sunda" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
346 { lng( 's','v' ), "Svenska" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
347 { lng( 's','w' ), "Kiswahili" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
348 { lng( 't','a' ), "தமிழ்" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
349 { lng( 't','e' ), "తెలుగు" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
350 { lng( 't','g' ), "тоҷикӣ" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
351 { lng( 't','h' ), "ภาษาไทย" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
352 { lng( 't','i' ), "ትግርኛ" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
353 { lng( 't','k' ), "Türkmençe" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
354 { lng( 't','l' ), "Tagalog" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
355 { lng( 't','n' ), "Setswana" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
356 { lng( 't','o' ), "Lea fakatonga" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
357 { lng( 't','r' ), "Türkçe" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
358 { lng( 't','s' ), "Xitsonga" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
359 { lng( 't','t' ), "татарча" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
360 { lng( 't','w' ), "Twi" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
361 { lng( 't','y' ), "Reo Tahiti" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
362 { lng( 'u','g' ), "ئۇيغۇرچە" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
363 { lng( 'u','k' ), "Українська" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
364 { lng( 'u','r' ), "اردو" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
365 { lng( 'u','z' ), "Oʻzbek tili" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
366 { lng( 'v','i' ), "Tiếng Việt" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
367 { lng( 'w','o' ), "Wolof" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
368 { lng( 'x','h' ), "isiXhosa" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
369 { lng( 'y','i' ), "ייִדיש" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
370 { lng( 'y','o' ), "Yorùbá" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
371 { lng( 'z','a' ), "壮语" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
372 { lng( 'z','h' ), "漢語" }, |
fb14d0cfc36d
Use native names of languages instead of English ones.
ib
parents:
36701
diff
changeset
|
373 { lng( 'z','u' ), "isiZulu" }, |
33572 | 374 }; |
375 #undef lng | |
376 | |
377 static char * ChannelTypes[] = | |
378 { "Dolby Digital","","Mpeg1","Mpeg2","PCM","","Digital Theatre System" }; | |
379 static char * ChannelNumbers[] = | |
380 { "","Stereo","","","","5.1" }; | |
381 | |
382 static const char * GetLanguage( int language ) | |
383 { | |
384 unsigned int i; | |
385 for ( i=0;i<sizeof( Languages ) / sizeof( Languages_t );i++ ) | |
386 if ( Languages[i].id == language ) return Languages[i].name; | |
36701 | 387 return MSGTR_GUI_Unknown; |
33572 | 388 } |
34454 | 389 #endif |
33572 | 390 |
391 | |
36028 | 392 static GtkWidget * DVDSubMenu; |
33572 | 393 GtkWidget * DVDTitleMenu; |
394 GtkWidget * DVDChapterMenu; | |
395 GtkWidget * DVDAudioLanguageMenu; | |
396 GtkWidget * DVDSubtitleLanguageMenu; | |
397 GtkWidget * AspectMenu; | |
398 GtkWidget * VCDSubMenu; | |
399 GtkWidget * VCDTitleMenu; | |
34387 | 400 GtkWidget * CDSubMenu; |
401 GtkWidget * CDTitleMenu; | |
33572 | 402 |
35996 | 403 GtkWidget * CreatePopUpMenu( void ) |
33572 | 404 { |
405 GtkWidget * window1; | |
406 GtkWidget * Menu = NULL; | |
407 GtkWidget * SubMenu = NULL; | |
408 GtkWidget * MenuItem = NULL; | |
409 GtkWidget * H, * N, * D, * F; | |
33657 | 410 demuxer_t *demuxer = mpctx_get_demuxer(guiInfo.mpcontext); |
33572 | 411 mixer_t *mixer = mpctx_get_mixer(guiInfo.mpcontext); |
412 int global_sub_size = mpctx_get_global_sub_size(guiInfo.mpcontext); | |
413 | |
414 Menu=gtk_menu_new(); | |
415 gtk_widget_realize (Menu); | |
416 window1 = gtk_widget_get_toplevel(Menu); | |
417 | |
418 | |
36694 | 419 AddMenuItem( window1, (const char*)about_xpm, Menu,MSGTR_GUI_AboutMPlayer" ", evAbout ); |
33572 | 420 AddSeparator( Menu ); |
36694 | 421 SubMenu=AddSubMenu( window1, (const char*)open_xpm, Menu,MSGTR_GUI_Open ); |
422 AddMenuItem( window1, (const char*)file2_xpm, SubMenu,MSGTR_GUI_File"... ", evLoadPlay ); | |
34387 | 423 #ifdef CONFIG_CDDA |
36694 | 424 AddMenuItem( window1, (const char*)playcd_xpm, SubMenu,MSGTR_GUI_CD, evPlayCD ); |
425 CDSubMenu=AddSubMenu( window1, (const char*)cd_xpm, Menu,MSGTR_GUI_CD ); | |
426 AddMenuItem( window1, (const char*)playcd_xpm, CDSubMenu,MSGTR_GUI_Play,evPlayCD ); | |
34387 | 427 AddSeparator( CDSubMenu ); |
36694 | 428 CDTitleMenu=AddSubMenu( window1, (const char*)title_xpm, CDSubMenu,MSGTR_GUI_Titles ); |
34420 | 429 if ( guiInfo.Tracks && ( guiInfo.StreamType == STREAMTYPE_CDDA ) ) |
34387 | 430 { |
431 char tmp[32]; int i; | |
432 for ( i=1;i <= guiInfo.Tracks;i++ ) | |
433 { | |
36694 | 434 snprintf( tmp,32,MSGTR_GUI_TitleNN,i ); |
34387 | 435 //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
|
436 AddMenuCheckItem(window1, (const char*)empty1px_xpm, CDTitleMenu,tmp, guiInfo.Track == i, ( i << 16 ) + ivSetCDTrack ); |
34387 | 437 } |
438 } | |
439 else | |
440 { | |
36694 | 441 MenuItem=AddMenuItem( window1, (const char*)empty1px_xpm, CDTitleMenu,MSGTR_GUI__none_,evNone ); |
34387 | 442 gtk_widget_set_sensitive( MenuItem,FALSE ); |
443 } | |
444 #endif | |
33572 | 445 #ifdef CONFIG_VCD |
36694 | 446 AddMenuItem( window1, (const char*)playvcd_xpm, SubMenu,MSGTR_GUI_VCD, evPlayVCD ); |
447 VCDSubMenu=AddSubMenu( window1, (const char*)vcd_xpm, Menu,MSGTR_GUI_VCD ); | |
448 AddMenuItem( window1, (const char*)playvcd_xpm, VCDSubMenu,MSGTR_GUI_Play,evPlayVCD ); | |
33572 | 449 AddSeparator( VCDSubMenu ); |
36694 | 450 VCDTitleMenu=AddSubMenu( window1, (const char*)title_xpm, VCDSubMenu,MSGTR_GUI_Titles ); |
34420 | 451 if ( guiInfo.Tracks && ( guiInfo.StreamType == STREAMTYPE_VCD ) ) |
33572 | 452 { |
453 char tmp[32]; int i; | |
33876
4789b8eed97e
Get rid of a bunch of needless or redundant guiInfo members.
ib
parents:
33874
diff
changeset
|
454 for ( i=1;i < guiInfo.Tracks;i++ ) |
33572 | 455 { |
36694 | 456 snprintf( tmp,32,MSGTR_GUI_TitleNN,i ); |
34333 | 457 //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
|
458 AddMenuCheckItem(window1, (const char*)empty1px_xpm, VCDTitleMenu,tmp, guiInfo.Track == i + 1, ( ( i + 1 ) << 16 ) + ivSetVCDTrack ); |
33572 | 459 } |
460 } | |
461 else | |
462 { | |
36694 | 463 MenuItem=AddMenuItem( window1, (const char*)empty1px_xpm, VCDTitleMenu,MSGTR_GUI__none_,evNone ); |
33572 | 464 gtk_widget_set_sensitive( MenuItem,FALSE ); |
465 } | |
466 #endif | |
467 #ifdef CONFIG_DVDREAD | |
36694 | 468 AddMenuItem( window1, (const char*)playdvd_xpm, SubMenu,MSGTR_GUI_DVD, evPlayDVD ); |
469 DVDSubMenu=AddSubMenu( window1, (const char*)dvd_xpm, Menu,MSGTR_GUI_DVD ); | |
470 AddMenuItem( window1, (const char*)playdvd_xpm, DVDSubMenu,MSGTR_GUI_Play" ", evPlayDVD ); | |
33572 | 471 // AddMenuItem( DVDSubMenu,MSGTR_MENU_ShowDVDMenu, evNone ); |
472 AddSeparator( DVDSubMenu ); | |
36694 | 473 DVDTitleMenu=AddSubMenu( window1, (const char*)title_xpm, DVDSubMenu,MSGTR_GUI_Titles ); |
34420 | 474 if ( guiInfo.Tracks && ( guiInfo.StreamType == STREAMTYPE_DVD ) ) |
33572 | 475 { |
476 char tmp[32]; int i; | |
33876
4789b8eed97e
Get rid of a bunch of needless or redundant guiInfo members.
ib
parents:
33874
diff
changeset
|
477 for ( i=1 ; i<= guiInfo.Tracks;i++ ) |
33572 | 478 { |
36694 | 479 snprintf( tmp,32,MSGTR_GUI_TitleNN,i); |
33572 | 480 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
|
481 guiInfo.Track == i, |
34333 | 482 (i << 16) + ivSetDVDTitle ); |
33572 | 483 } |
484 } | |
485 else | |
486 { | |
36694 | 487 MenuItem=AddMenuItem( window1, (const char*)empty1px_xpm, DVDTitleMenu,MSGTR_GUI__none_,evNone ); |
33572 | 488 gtk_widget_set_sensitive( MenuItem,FALSE ); |
489 } | |
36694 | 490 DVDChapterMenu=AddSubMenu( window1, (const char*)chapter_xpm, DVDSubMenu,MSGTR_GUI_Chapters ); |
34420 | 491 if ( guiInfo.Chapters && ( guiInfo.StreamType == STREAMTYPE_DVD ) ) |
33572 | 492 { |
493 char tmp[32]; int i; | |
33876
4789b8eed97e
Get rid of a bunch of needless or redundant guiInfo members.
ib
parents:
33874
diff
changeset
|
494 for ( i=1;i <= guiInfo.Chapters;i++ ) |
33572 | 495 { |
36694 | 496 snprintf( tmp,32,MSGTR_GUI_ChapterNN,i ); |
33876
4789b8eed97e
Get rid of a bunch of needless or redundant guiInfo members.
ib
parents:
33874
diff
changeset
|
497 AddMenuCheckItem( window1, (const char*)empty1px_xpm, DVDChapterMenu,tmp,guiInfo.Chapter == i, |
34333 | 498 ( i << 16 ) + ivSetDVDChapter ); |
33572 | 499 } |
500 } | |
501 else | |
502 { | |
36694 | 503 MenuItem=AddMenuItem( window1, (const char*)empty1px_xpm, DVDChapterMenu,MSGTR_GUI__none_,evNone ); |
33572 | 504 gtk_widget_set_sensitive( MenuItem,FALSE ); |
505 } | |
36694 | 506 DVDAudioLanguageMenu=AddSubMenu( window1, (const char*)audio_xpm, DVDSubMenu,MSGTR_GUI_AudioTracks ); |
36700 | 507 if ( guiInfo.AudioStreams && demuxer && ( guiInfo.StreamType == STREAMTYPE_DVD ) ) |
33572 | 508 { |
36700 | 509 char tmp[64]; int i; |
33902 | 510 for ( i=0;i < guiInfo.AudioStreams;i++ ) |
33572 | 511 { |
33902 | 512 snprintf( tmp,64,"%s - %s %s",GetLanguage( guiInfo.AudioStream[i].language ), |
513 ChannelTypes[ guiInfo.AudioStream[i].type ], | |
514 ChannelNumbers[ guiInfo.AudioStream[i].channels ] ); | |
33572 | 515 AddMenuCheckItem( window1, (const char*)dolby_xpm, DVDAudioLanguageMenu,tmp, |
36700 | 516 demuxer->audio->id == guiInfo.AudioStream[i].id, |
34333 | 517 ( guiInfo.AudioStream[i].id << 16 ) + ivSetDVDAudio ); |
33572 | 518 } |
519 } | |
520 else | |
521 { | |
36694 | 522 MenuItem=AddMenuItem( window1, (const char*)empty1px_xpm, DVDAudioLanguageMenu,MSGTR_GUI__none_,evNone ); |
33572 | 523 gtk_widget_set_sensitive( MenuItem,FALSE ); |
524 } | |
36694 | 525 DVDSubtitleLanguageMenu=AddSubMenu( window1, (const char*)subtitle_xpm, DVDSubMenu,MSGTR_GUI_Subtitles ); |
34420 | 526 if ( guiInfo.Subtitles && ( guiInfo.StreamType == STREAMTYPE_DVD ) ) |
33572 | 527 { |
528 char tmp[64]; int i; | |
36694 | 529 AddMenuItem( window1, (const char*)empty1px_xpm, DVDSubtitleLanguageMenu,MSGTR_GUI__none_,( (unsigned short)-1 << 16 ) + ivSetDVDSubtitle ); |
33902 | 530 for ( i=0;i < guiInfo.Subtitles;i++ ) |
33572 | 531 { |
33902 | 532 av_strlcpy( tmp,GetLanguage( guiInfo.Subtitle[i].language ),sizeof(tmp) ); |
33572 | 533 AddMenuCheckItem( window1, (const char*)empty1px_xpm, DVDSubtitleLanguageMenu,tmp, |
33902 | 534 dvdsub_id == guiInfo.Subtitle[i].id, |
34333 | 535 ( guiInfo.Subtitle[i].id << 16 ) + ivSetDVDSubtitle ); |
33572 | 536 } |
537 } | |
538 else | |
539 { | |
36694 | 540 MenuItem=AddMenuItem( window1, (const char*)empty1px_xpm, DVDSubtitleLanguageMenu,MSGTR_GUI__none_,evNone ); |
33572 | 541 gtk_widget_set_sensitive( MenuItem,FALSE ); |
542 } | |
543 #endif | |
36694 | 544 AddMenuItem( window1, (const char*)url_xpm, SubMenu,MSGTR_GUI_URL"...", evLoadURL ); |
36429 | 545 #ifdef CONFIG_TV |
36694 | 546 AddMenuItem( window1, (const char*)tv_xpm, SubMenu,MSGTR_GUI_TV, evPlayTV ); |
36429 | 547 #endif |
36663 | 548 AddSeparator( SubMenu ); |
36694 | 549 AddMenuItem( window1, (const char*)loadeaf_xpm, SubMenu,MSGTR_GUI_AudioTrack"...", evLoadAudioFile ); |
550 AddMenuItem( window1, (const char*)sub_xpm, SubMenu,MSGTR_GUI_Subtitle"... ", evLoadSubtitle ); | |
551 AddMenuItem( window1, (const char*)nosub_xpm, SubMenu,MSGTR_GUI_DropSubtitle,evDropSubtitle ); | |
552 SubMenu=AddSubMenu(window1, (const char*)play_xpm, Menu,MSGTR_GUI_Playback ); | |
553 AddMenuItem( window1, (const char*)play_xpm, SubMenu,MSGTR_GUI_Play" ", evPlay ); | |
554 AddMenuItem( window1, (const char*)pause_xpm, SubMenu,MSGTR_GUI_Pause, evPause ); | |
555 AddMenuItem( window1, (const char*)stop_xpm, SubMenu,MSGTR_GUI_Stop, evStop ); | |
556 AddMenuItem( window1, (const char*)next_xpm, SubMenu,MSGTR_GUI_Next, evNext ); | |
557 AddMenuItem( window1, (const char*)prev_xpm, SubMenu,MSGTR_GUI_Previous, evPrev ); | |
34419 | 558 // AddSeparator( SubMenu ); |
559 // AddMenuItem( SubMenu,"Back 10 sec", evBackward10sec ); | |
560 // AddMenuItem( SubMenu,"Fwd 10 sec", evForward10sec ); | |
561 // AddMenuItem( SubMenu,"Back 1 min", evBackward1min ); | |
562 // AddMenuItem( SubMenu,"Fwd 1 min", evForward1min ); | |
563 // SubMenu=AddSubMenu( Menu,MSGTR_MENU_Size ); | |
36694 | 564 // AddMenuItem( SubMenu,MSGTR_GUI_SizeNormal" ", evNormalSize ); |
565 // AddMenuItem( SubMenu,MSGTR_GUI_SizeDouble, evDoubleSize ); | |
566 // AddMenuItem( SubMenu,MSGTR_GUI_SizeFullscreen, evFullScreen + ( True << 16 ) ); | |
33572 | 567 |
36261
ca1d4a7bb751
Disable aspect ratio menu in the absence of video playback.
ib
parents:
36029
diff
changeset
|
568 if ( guiInfo.VideoWindow ) |
33572 | 569 { |
36273 | 570 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
|
571 AddSeparator( Menu ); |
36316
139f2b064ef9
Don't subsequently calculate original_aspect from last movie_aspect.
ib
parents:
36297
diff
changeset
|
572 if (movie_aspect == -1.0f) a11 = True; |
36273 | 573 else |
574 { | |
575 a169 = (FFABS(movie_aspect - 16.0f / 9.0f) <= 0.01f); | |
576 a43 = (FFABS(movie_aspect - 4.0f / 3.0f) <= 0.01f); | |
36276 | 577 a235 = (FFABS(movie_aspect - 2.35f) <= 0.01f); |
36273 | 578 } |
579 | |
36694 | 580 AspectMenu=AddSubMenu( window1, (const char*)aspect_xpm, Menu,MSGTR_GUI_AspectRatio ); |
581 H=AddMenuCheckItem( window1, (const char*)aspect11_xpm, AspectMenu,MSGTR_GUI_Original, a11, evSetAspect + ( 1 << 16 ) ); | |
36273 | 582 N=AddMenuCheckItem( window1, (const char*)aspect169_xpm, AspectMenu,"16:9", a169, evSetAspect + ( 2 << 16 ) ); |
583 D=AddMenuCheckItem( window1, (const char*)aspect43_xpm, AspectMenu,"4:3", a43, evSetAspect + ( 3 << 16 ) ); | |
36694 | 584 F=AddMenuCheckItem( window1, (const char*)aspect235_xpm, AspectMenu,MSGTR_GUI_235To1, a235, evSetAspect + ( 4 << 16 ) ); |
36261
ca1d4a7bb751
Disable aspect ratio menu in the absence of video playback.
ib
parents:
36029
diff
changeset
|
585 |
ca1d4a7bb751
Disable aspect ratio menu in the absence of video playback.
ib
parents:
36029
diff
changeset
|
586 if ( !guiInfo.Playing ) |
ca1d4a7bb751
Disable aspect ratio menu in the absence of video playback.
ib
parents:
36029
diff
changeset
|
587 { |
ca1d4a7bb751
Disable aspect ratio menu in the absence of video playback.
ib
parents:
36029
diff
changeset
|
588 gtk_widget_set_sensitive( H,FALSE ); |
ca1d4a7bb751
Disable aspect ratio menu in the absence of video playback.
ib
parents:
36029
diff
changeset
|
589 gtk_widget_set_sensitive( N,FALSE ); |
ca1d4a7bb751
Disable aspect ratio menu in the absence of video playback.
ib
parents:
36029
diff
changeset
|
590 gtk_widget_set_sensitive( D,FALSE ); |
ca1d4a7bb751
Disable aspect ratio menu in the absence of video playback.
ib
parents:
36029
diff
changeset
|
591 gtk_widget_set_sensitive( F,FALSE ); |
ca1d4a7bb751
Disable aspect ratio menu in the absence of video playback.
ib
parents:
36029
diff
changeset
|
592 } |
33572 | 593 } |
594 | |
36622
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
595 if ( guiInfo.VideoWindow ) |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
596 { |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
597 int b1 = False, b2 = False, b_half = False; |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
598 |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
599 if ( !guiApp.videoWindow.isFullScreen && guiInfo.Playing ) |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
600 { |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
601 if ( ( guiApp.videoWindow.Width == guiInfo.VideoWidth * 2 )&& |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
602 ( guiApp.videoWindow.Height == guiInfo.VideoHeight * 2 ) ) b2=True; |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
603 else if ( ( guiApp.videoWindow.Width == guiInfo.VideoWidth / 2 ) && |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
604 ( 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
|
605 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
|
606 } else b1=!guiApp.videoWindow.isFullScreen; |
36694 | 607 F=AddMenuCheckItem( window1, (const char*)full_xpm, Menu,MSGTR_GUI_SizeFullscreen,guiApp.videoWindow.isFullScreen,evFullScreen + ( True << 16 ) ); |
608 D=AddMenuCheckItem( window1, (const char*)double_xpm, Menu,MSGTR_GUI_SizeDouble,b2,evDoubleSize ); | |
609 N=AddMenuCheckItem( window1, (const char*)normal_xpm, Menu,MSGTR_GUI_SizeNormal" ",b1,evNormalSize ); | |
610 H=AddMenuCheckItem( window1, (const char*)half_xpm, Menu,MSGTR_GUI_SizeHalf,b_half,evHalfSize ); | |
36622
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
611 if ( !guiInfo.Playing ) |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
612 { |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
613 gtk_widget_set_sensitive( H,FALSE ); |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
614 gtk_widget_set_sensitive( N,FALSE ); |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
615 gtk_widget_set_sensitive( D,FALSE ); |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
616 gtk_widget_set_sensitive( F,FALSE ); |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
617 } |
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 |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
620 AddSeparator( Menu ); |
36694 | 621 MenuItem=AddMenuCheckItem( window1, (const char*)sound_xpm, Menu,MSGTR_GUI_Mute,mixer->muted,evMute ); |
36622
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
622 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
|
623 |
33657 | 624 if ( guiInfo.Playing && demuxer && guiInfo.StreamType != STREAMTYPE_DVD ) |
33572 | 625 { |
626 int i,c = 0; | |
627 | |
628 for ( i=0;i < MAX_A_STREAMS;i++ ) | |
33657 | 629 if ( demuxer->a_streams[i] ) c++; |
33572 | 630 |
631 if ( c > 1 ) | |
632 { | |
36694 | 633 SubMenu=AddSubMenu( window1, (const char*)audio_xpm, Menu,MSGTR_GUI_AudioTracks ); |
33572 | 634 for ( i=0;i < MAX_A_STREAMS;i++ ) |
33657 | 635 if ( demuxer->a_streams[i] ) |
33572 | 636 { |
33657 | 637 int aid = ((sh_audio_t *)demuxer->a_streams[i])->aid; |
36699 | 638 int selected_id = (audio_id == aid || (audio_id == -1 && aid == demuxer_default_audio_track(demuxer))); |
36704 | 639 char lng[32], tmp[64]; |
640 if ( demuxer_audio_lang( demuxer, i, lng, sizeof(lng) ) == 0 ) snprintf( tmp,sizeof(tmp),MSGTR_GUI_TrackN" - %s",aid,lng ); | |
641 else snprintf( tmp,sizeof(tmp),MSGTR_GUI_TrackN,aid ); | |
34555
da67e2df97be
Emphasize the default audio track in the selection list.
ib
parents:
34479
diff
changeset
|
642 AddMenuCheckItem( window1, (const char*)empty1px_xpm, SubMenu,tmp,selected_id,( aid << 16 ) + ivSetAudio ); |
33572 | 643 } |
644 } | |
645 | |
646 for ( c=0,i=0;i < MAX_V_STREAMS;i++ ) | |
33657 | 647 if ( demuxer->v_streams[i] ) c++; |
33572 | 648 |
649 if ( c > 1 ) | |
650 { | |
36694 | 651 SubMenu=AddSubMenu( window1, (const char*)video_xpm, Menu,MSGTR_GUI_VideoTracks ); |
33572 | 652 for ( i=0;i < MAX_V_STREAMS;i++ ) |
33657 | 653 if ( demuxer->v_streams[i] ) |
33572 | 654 { |
33657 | 655 int vid = ((sh_video_t *)demuxer->v_streams[i])->vid; |
33572 | 656 char tmp[32]; |
36699 | 657 int selected_id = (video_id == vid || (video_id == -1 && vid == demuxer_default_video_track(demuxer))); |
36694 | 658 snprintf( tmp,32,MSGTR_GUI_TrackN,vid ); |
36683 | 659 AddMenuCheckItem( window1, (const char*)empty1px_xpm, SubMenu,tmp,selected_id,( vid << 16 ) + ivSetVideo ); |
33572 | 660 } |
661 } | |
662 } | |
663 | |
664 /* cheap subtitle switching for non-DVD streams */ | |
665 if ( global_sub_size && guiInfo.StreamType != STREAMTYPE_DVD ) | |
666 { | |
36705 | 667 int pos, i, j, subs0 = guiInfo.mpcontext->sub_counts[SUB_SOURCE_SUBS], subs1 = guiInfo.mpcontext->sub_counts[SUB_SOURCE_VOBSUB]; |
36458 | 668 pos = mpctx_get_global_sub_pos(guiInfo.mpcontext); |
36694 | 669 SubMenu=AddSubMenu( window1, (const char*)subtitle_xpm, Menu, MSGTR_GUI_Subtitles ); |
670 AddMenuCheckItem( window1, (const char*)empty1px_xpm, SubMenu, MSGTR_GUI__none_, pos == -1, (-1 << 16) + ivSetSubtitle ); | |
33572 | 671 for ( i=0;i < global_sub_size;i++ ) |
672 { | |
36705 | 673 int ret = -1; |
674 char lng[32], tmp[64]; | |
675 if ( i >= subs0 + subs1 ) | |
676 { | |
677 for ( j=0;j < MAX_S_STREAMS;j++ ) | |
678 { | |
679 if ( demuxer->s_streams[j] ) ret++; | |
680 if ( ret == i - subs0 - subs1 ) | |
681 { | |
682 ret = demuxer_sub_lang( demuxer, j, lng, sizeof(lng) ); | |
683 break; | |
684 } | |
685 } | |
686 } | |
687 if ( ret == 0 ) snprintf( tmp, sizeof(tmp), MSGTR_GUI_TrackN" - %s", i, lng ); | |
688 else snprintf( tmp, sizeof(tmp), MSGTR_GUI_TrackN, i ); | |
36458 | 689 AddMenuCheckItem( window1,(const char*)empty1px_xpm,SubMenu,tmp,pos == i,( i << 16 ) + ivSetSubtitle ); |
33572 | 690 } |
691 } | |
692 | |
693 AddSeparator( Menu ); | |
36694 | 694 AddMenuItem( window1, (const char*)equalizer_xpm, Menu,MSGTR_GUI_Equalizer, evEqualizer ); |
695 AddMenuItem( window1, (const char*)playlist_xpm, Menu,MSGTR_GUI_Playlist, evPlaylist ); | |
696 AddMenuItem( window1, (const char*)skin_xpm, Menu,MSGTR_GUI_SkinBrowser, evSkinBrowser ); | |
697 AddMenuItem( window1, (const char*)prefs_xpm, Menu,MSGTR_GUI_Preferences, evPreferences ); | |
36620 | 698 |
699 AddSeparator( Menu ); | |
36694 | 700 AddMenuItem( window1, (const char*)exit_xpm, Menu,MSGTR_GUI_Quit, evExit ); |
33572 | 701 |
702 return Menu; | |
703 } |