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