Mercurial > mplayer.hg
annotate gui/dialog/menu.c @ 37159:d4fbf2eb4a04
Ensure up-to-dateness of global_sub information upon request.
Some demuxers (like mpg) can detect subtitles only while playing,
which is the reason why MPlayer always - indirectly - calls
update_global_sub_size() prior to dealing with subtitles.
Functions mpctx_get_global_sub_size() and mpctx_get_global_sub_pos(),
however, merely return last determined values, thus missing information
that may have been arisen after MPlayer has checked last for subtitles
(when playback started).
Merge the two mpctx_get_global_sub_*() functions into one for easier
handling.
Retrieve global_sub pos by a mp_property_do("sub") command which
performs the necessary update of both global_sub variables, pos and
size.
Reported by Lode Leroy, lode.leroy gmail com.
author | ib |
---|---|
date | Sun, 17 Aug 2014 18:06:56 +0000 |
parents | e8559b9913ff |
children |
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> | |
36708
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
22 #include <strings.h> |
33572 | 23 |
24 #include "config.h" | |
25 #include "help_mp.h" | |
26 #include "access_mpcontext.h" | |
27 #include "mixer.h" | |
28 #include "mpcommon.h" | |
36705 | 29 #include "mp_core.h" |
36707 | 30 #include "path.h" |
36706 | 31 #include "sub/sub.h" |
32 #include "sub/vobsub.h" | |
36707 | 33 #ifdef CONFIG_ASS |
34 #include "libass/ass_types.h" | |
35 #endif | |
33572 | 36 |
37 #include "menu.h" | |
35529 | 38 #include "dialog.h" |
35772 | 39 #include "gui/ui/actions.h" |
35525 | 40 #include "gui/app/app.h" |
41 #include "gui/app/gui.h" | |
33738 | 42 #include "gui/interface.h" |
33572 | 43 |
44 #include "stream/stream.h" | |
36273 | 45 #include "libavutil/common.h" |
46 #include "libmpcodecs/vd.h" | |
33572 | 47 #include "libmpdemux/demuxer.h" |
48 #include "libmpdemux/stheader.h" | |
49 #include "libavutil/avstring.h" | |
50 | |
35526 | 51 #include "pixmaps/about.xpm" |
52 #include "pixmaps/half.xpm" | |
53 #include "pixmaps/normal.xpm" | |
54 #include "pixmaps/double.xpm" | |
55 #include "pixmaps/full.xpm" | |
56 #include "pixmaps/exit.xpm" | |
57 #include "pixmaps/prefs.xpm" | |
58 #include "pixmaps/equalizer.xpm" | |
59 #include "pixmaps/playlist.xpm" | |
60 #include "pixmaps/skin.xpm" | |
61 #include "pixmaps/sound.xpm" | |
62 #include "pixmaps/open.xpm" | |
63 #include "pixmaps/play.xpm" | |
64 #include "pixmaps/stop.xpm" | |
65 #include "pixmaps/pause.xpm" | |
66 #include "pixmaps/prev.xpm" | |
67 #include "pixmaps/next.xpm" | |
68 #include "pixmaps/aspect.xpm" | |
69 #include "pixmaps/aspect11.xpm" | |
70 #include "pixmaps/aspect169.xpm" | |
71 #include "pixmaps/aspect235.xpm" | |
72 #include "pixmaps/aspect43.xpm" | |
73 #include "pixmaps/file2.xpm" | |
74 #include "pixmaps/url.xpm" | |
75 #include "pixmaps/sub.xpm" | |
76 #include "pixmaps/nosub.xpm" | |
77 #include "pixmaps/empty.xpm" | |
78 #include "pixmaps/loadeaf.xpm" | |
79 #include "pixmaps/title.xpm" | |
80 #include "pixmaps/subtitle.xpm" | |
34387 | 81 #ifdef CONFIG_CDDA |
35526 | 82 #include "pixmaps/cd.xpm" |
83 #include "pixmaps/playcd.xpm" | |
34387 | 84 #endif |
34077 | 85 #ifdef CONFIG_VCD |
35526 | 86 #include "pixmaps/vcd.xpm" |
87 #include "pixmaps/playvcd.xpm" | |
34077 | 88 #endif |
33572 | 89 #ifdef CONFIG_DVDREAD |
35526 | 90 #include "pixmaps/dvd.xpm" |
91 #include "pixmaps/playdvd.xpm" | |
92 #include "pixmaps/chapter.xpm" | |
93 #include "pixmaps/dolby.xpm" | |
36665 | 94 #include "pixmaps/audio.xpm" |
36666 | 95 #include "pixmaps/video.xpm" |
34422
b1f2949ca18d
Use empty1px.xpm instead of empty.xpm for check item (and similar) menus.
ib
parents:
34421
diff
changeset
|
96 #endif |
36429 | 97 #ifdef CONFIG_TV |
98 #include "pixmaps/tv.xpm" | |
99 #endif | |
35526 | 100 #include "pixmaps/empty1px.xpm" |
37081 | 101 #include "pixmaps/rotate.xpm" |
102 #include "pixmaps/rotate0.xpm" | |
103 #include "pixmaps/rotate180.xpm" | |
104 #include "pixmaps/rotate90ccw.xpm" | |
105 #include "pixmaps/rotate90cw.xpm" | |
33572 | 106 |
36029
49be954ad61a
Move variable declarations and definitions where they belong.
ib
parents:
36028
diff
changeset
|
107 int gtkPopupMenu; |
49be954ad61a
Move variable declarations and definitions where they belong.
ib
parents:
36028
diff
changeset
|
108 int gtkPopupMenuParam; |
49be954ad61a
Move variable declarations and definitions where they belong.
ib
parents:
36028
diff
changeset
|
109 |
33572 | 110 static void ActivateMenuItem( int Item ) |
111 { | |
112 // fprintf( stderr,"[menu] item: %d.%d\n",Item&0xffff,Item>>16 ); | |
113 gtkPopupMenu=Item & 0x0000ffff; | |
114 gtkPopupMenuParam=Item >> 16; | |
35773 | 115 uiEvent( Item & 0x0000ffff,Item >> 16 ); |
33572 | 116 } |
117 | |
118 static GtkWidget * AddMenuCheckItem(GtkWidget *window1, const char * immagine_xpm, GtkWidget* Menu,const char* label, gboolean state, int Number) | |
119 { | |
120 GtkWidget * Label = NULL; | |
121 GtkWidget * Pixmap = NULL; | |
122 GtkWidget * hbox = NULL; | |
123 GtkWidget * Item = NULL; | |
124 | |
125 GdkPixmap *PixmapIcon = NULL; | |
126 GdkColor transparent; | |
127 GdkBitmap *MaskIcon = NULL; | |
128 | |
129 PixmapIcon = gdk_pixmap_create_from_xpm_d (window1->window, &MaskIcon, &transparent,(gchar **)immagine_xpm ); | |
130 Pixmap = gtk_pixmap_new (PixmapIcon, MaskIcon); | |
131 gdk_pixmap_unref (PixmapIcon); | |
132 | |
133 Item=gtk_check_menu_item_new(); | |
134 Label = gtk_label_new (label); | |
135 | |
136 hbox = gtk_hbox_new (FALSE, 8); | |
137 gtk_box_pack_start (GTK_BOX (hbox), Pixmap, FALSE, FALSE, 0); | |
138 gtk_box_pack_start (GTK_BOX (hbox), Label, FALSE, FALSE, 0); | |
139 gtk_container_add (GTK_CONTAINER (Item), hbox); | |
140 | |
141 gtk_menu_append( GTK_MENU( Menu ),Item ); | |
142 | |
143 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(Item),state); | |
144 gtk_signal_connect_object( GTK_OBJECT(Item),"activate", | |
36776 | 145 GTK_SIGNAL_FUNC(ActivateMenuItem),GINT_TO_POINTER(Number) ); |
33572 | 146 gtk_menu_item_right_justify (GTK_MENU_ITEM (Item)); |
147 gtk_widget_show_all(Item); | |
148 | |
149 return Item; | |
150 } | |
151 GtkWidget * AddMenuItem( GtkWidget *window1, const char * immagine_xpm, GtkWidget * SubMenu,const char * label,int Number ) | |
152 { | |
153 GtkWidget * Label = NULL; | |
154 GtkWidget * Pixmap = NULL; | |
155 GtkWidget * hbox = NULL; | |
156 GtkWidget * Item = NULL; | |
157 GdkPixmap * PixmapIcon = NULL; | |
158 GdkColor transparent; | |
159 GdkBitmap * MaskIcon = NULL; | |
160 | |
161 PixmapIcon = gdk_pixmap_create_from_xpm_d (window1->window, &MaskIcon, &transparent,(gchar **)immagine_xpm ); | |
162 Pixmap = gtk_pixmap_new (PixmapIcon, MaskIcon); | |
163 gdk_pixmap_unref (PixmapIcon); | |
164 | |
165 Item=gtk_menu_item_new(); | |
166 Label = gtk_label_new (label); | |
167 | |
168 hbox = gtk_hbox_new (FALSE, 8); | |
169 gtk_box_pack_start (GTK_BOX (hbox), Pixmap, FALSE, FALSE, 0); | |
170 gtk_box_pack_start (GTK_BOX (hbox), Label, FALSE, FALSE, 0); | |
171 gtk_container_add (GTK_CONTAINER (Item), hbox); | |
172 | |
173 | |
174 gtk_menu_append( GTK_MENU( SubMenu ),Item ); | |
175 gtk_signal_connect_object( GTK_OBJECT(Item),"activate", | |
36776 | 176 GTK_SIGNAL_FUNC(ActivateMenuItem),GINT_TO_POINTER(Number) ); |
33572 | 177 |
178 gtk_menu_item_right_justify (GTK_MENU_ITEM (Item)); | |
179 gtk_widget_show_all(Item); | |
180 return Item; | |
181 } | |
182 | |
183 | |
184 GtkWidget * AddSubMenu( GtkWidget *window1, const char * immagine_xpm, GtkWidget * Menu,const char * label ) | |
185 { | |
186 GtkWidget * Label = NULL; | |
187 GtkWidget * Pixmap = NULL; | |
188 GtkWidget * hbox = NULL; | |
189 GtkWidget * Item = NULL; | |
190 GtkWidget * SubItem = NULL; | |
191 GdkPixmap * PixmapIcon = NULL; | |
192 GdkColor transparent; | |
193 GdkBitmap * MaskIcon = NULL; | |
194 | |
195 PixmapIcon = gdk_pixmap_create_from_xpm_d (window1->window, &MaskIcon, &transparent,(gchar **)immagine_xpm); | |
196 Pixmap = gtk_pixmap_new (PixmapIcon, MaskIcon); | |
197 gdk_pixmap_unref (PixmapIcon); | |
198 | |
199 SubItem=gtk_menu_item_new(); | |
200 Item=gtk_menu_new(); | |
201 Label = gtk_label_new (label); | |
202 | |
203 hbox = gtk_hbox_new (FALSE, 8); | |
204 gtk_box_pack_start (GTK_BOX (hbox), Pixmap, FALSE, FALSE, 0); | |
205 gtk_box_pack_start (GTK_BOX (hbox), Label, FALSE, FALSE, 0); | |
206 gtk_container_add (GTK_CONTAINER (SubItem), hbox); | |
207 | |
208 gtk_menu_append( GTK_MENU( Menu ),SubItem ); | |
209 gtk_menu_item_set_submenu( GTK_MENU_ITEM( SubItem ),Item ); | |
210 | |
211 gtk_widget_show_all( SubItem ); | |
212 return Item; | |
213 } | |
214 | |
215 GtkWidget * AddSeparator( GtkWidget * Menu ) | |
216 { | |
217 GtkWidget * Item = NULL; | |
218 | |
219 Item=gtk_menu_item_new (); | |
220 gtk_widget_show( Item ); | |
221 gtk_container_add( GTK_CONTAINER( Menu ),Item ); | |
222 gtk_widget_set_sensitive( Item,FALSE ); | |
223 | |
224 return Item; | |
225 } | |
226 | |
227 typedef struct | |
228 { | |
229 int id; | |
36708
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
230 const char * id2; |
33572 | 231 const char * name; |
232 } Languages_t; | |
233 | |
34454 | 234 #ifdef CONFIG_DVDREAD |
33572 | 235 #define lng( a,b ) ( (int)(a) * 256 + b ) |
236 static Languages_t Languages[] = | |
36708
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
237 { |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
238 { lng( 'a','a' ), "aar", "ʿAfár af" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
239 { lng( 'a','b' ), "abk", "аҧсуа бызшәа" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
240 { lng( 'a','f' ), "afr", "Afrikaans" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
241 { lng( 'a','m' ), "amh", "ኣማርኛ" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
242 { lng( 'a','r' ), "ara", "العربية" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
243 { lng( 'a','s' ), "asm", "অসমীয়া" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
244 { lng( 'a','y' ), "aym", "Aymar Aru" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
245 { lng( 'a','z' ), "aze", "Azərbaycanca" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
246 { lng( 'b','a' ), "bak", "Башҡорт теле" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
247 { lng( 'b','e' ), "bel", "беларуская мова" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
248 { lng( 'b','g' ), "bul", "български език" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
249 { lng( 'b','i' ), "bis", "Bislama" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
250 { lng( 'b','n' ), "ben", "বাংলা" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
251 { lng( 'b','o' ), "bod", "བོད་སྐད" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
252 { lng( 'b','o' ), "tib", "བོད་སྐད" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
253 { lng( 'b','r' ), "bre", "Brezhoneg" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
254 { lng( 'b','s' ), "bos", "Bosanski" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
255 { lng( 'c','a' ), "cat", "Català" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
256 { lng( 'c','e' ), "che", "Нохчийн мотт" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
257 { lng( 'c','h' ), "cha", "Chamoru" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
258 { lng( 'c','o' ), "cos", "Corsu" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
259 { lng( 'c','s' ), "ces", "Čeština" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
260 { lng( 'c','s' ), "cze", "Čeština" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
261 { lng( 'c','v' ), "chv", "Чӑвашла" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
262 { lng( 'c','y' ), "cym", "Cymraeg" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
263 { lng( 'c','y' ), "wel", "Cymraeg" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
264 { lng( 'd','a' ), "dan", "Dansk" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
265 { lng( 'd','e' ), "deu", "Deutsch" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
266 { lng( 'd','e' ), "ger", "Deutsch" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
267 { lng( 'd','z' ), "dzo", "ཇོང་ཁ" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
268 { lng( 'e','l' ), "ell", "Ελληνικά" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
269 { lng( 'e','l' ), "gre", "Ελληνικά" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
270 { lng( 'e','n' ), "eng", "English" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
271 { lng( 'e','o' ), "epo", "Esperanto" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
272 { lng( 'e','s' ), "spa", "Español" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
273 { lng( 'e','t' ), "est", "Eesti keel" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
274 { lng( 'e','u' ), "eus", "Euskara" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
275 { lng( 'e','u' ), "baq", "Euskara" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
276 { lng( 'f','a' ), "fas", "فارسی" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
277 { lng( 'f','a' ), "per", "فارسی" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
278 { lng( 'f','i' ), "fin", "Suomi" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
279 { lng( 'f','j' ), "fij", "Vakaviti" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
280 { lng( 'f','o' ), "fao", "Føroyskt" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
281 { lng( 'f','r' ), "fra", "Français" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
282 { lng( 'f','r' ), "fre", "Français" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
283 { lng( 'f','y' ), "fry", "Frysk" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
284 { lng( 'g','a' ), "gle", "Gaeilge" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
285 { lng( 'g','d' ), "gla", "Gàidhlig" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
286 { lng( 'g','l' ), "glg", "Galego" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
287 { lng( 'g','n' ), "grn", "Avañe'ẽ" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
288 { lng( 'g','u' ), "guj", "ગુજરાતી" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
289 { lng( 'h','a' ), "hau", "هَوُسَ" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
290 { lng( 'h','e' ), "heb", "עִבְרִית" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
291 { lng( 'h','i' ), "hin", "हिन्दी" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
292 { lng( 'h','r' ), "hrv", "Hrvatska" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
293 { lng( 'h','u' ), "hun", "Magyar" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
294 { lng( 'h','y' ), "hye", "Հայերեն" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
295 { lng( 'h','y' ), "arm", "Հայերեն" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
296 { lng( 'h','z' ), "her", "Otjiherero" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
297 { lng( 'i','d' ), "ind", "Bahasa Indonesia" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
298 { lng( 'i','s' ), "isl", "Íslenska" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
299 { lng( 'i','s' ), "ice", "Íslenska" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
300 { lng( 'i','t' ), "ita", "Italiano" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
301 { lng( 'i','u' ), "iku", "ᐃᓄᒃᑎᑐᑦ" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
302 { lng( 'j','a' ), "jpn", "日本語" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
303 { lng( 'j','v' ), "jav", "Basa Jawa" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
304 { lng( 'k','a' ), "kat", "ქართული" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
305 { lng( 'k','a' ), "geo", "ქართული" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
306 { lng( 'k','i' ), "kik", "Gĩkũyũ" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
307 { lng( 'k','j' ), "kua", "Kuanyama" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
308 { lng( 'k','k' ), "kaz", "Қазақ тілі" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
309 { lng( 'k','l' ), "kal", "Kalaallisut" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
310 { lng( 'k','m' ), "khm", "ភាសាខ្មែរ" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
311 { lng( 'k','n' ), "kan", "ಕನ್ನಡ" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
312 { lng( 'k','o' ), "kor", "한국어" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
313 { lng( 'k','s' ), "kas", "कॉशुर" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
314 { lng( 'k','u' ), "kur", "کوردی" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
315 { lng( 'k','v' ), "kom", "коми кыв" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
316 { lng( 'k','y' ), "kir", "Кыргызча" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
317 { lng( 'l','a' ), "lat", "Lingua latina" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
318 { lng( 'l','b' ), "ltz", "Lëtzebuergesch" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
319 { lng( 'l','n' ), "lin", "Lingála" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
320 { lng( 'l','o' ), "lao", "ພາສາລາວ" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
321 { lng( 'l','t' ), "lit", "Lietuvių kalba" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
322 { lng( 'l','v' ), "lav", "Latviešu" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
323 { lng( 'm','g' ), "mlg", "Malagasy" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
324 { lng( 'm','h' ), "mah", "Kajin M̧ajeļ" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
325 { lng( 'm','i' ), "mri", "Te Reo Māori" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
326 { lng( 'm','i' ), "mao", "Te Reo Māori" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
327 { lng( 'm','k' ), "mkd", "Македонски јазик" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
328 { lng( 'm','k' ), "mac", "Македонски јазик" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
329 { lng( 'm','l' ), "mal", "മലയാളം" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
330 { lng( 'm','n' ), "mon", "ᠮᠣᠨᠭᠭᠣᠯ" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
331 { lng( 'm','r' ), "mar", "मराठी" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
332 { lng( 'm','s' ), "msa", "Bahasa Melayu" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
333 { lng( 'm','s' ), "may", "Bahasa Melayu" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
334 { lng( 'm','t' ), "mlt", "Malti" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
335 { lng( 'm','y' ), "mya", "မြန်မာစကား" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
336 { lng( 'm','y' ), "bur", "မြန်မာစကား" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
337 { lng( 'n','b' ), "nob", "Bokmål" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
338 { lng( 'n','d' ), "nde", "isiNdebele" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
339 { lng( 'n','e' ), "nep", "नेपाली" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
340 { lng( 'n','l' ), "nld", "Nederlands" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
341 { lng( 'n','l' ), "dut", "Nederlands" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
342 { lng( 'n','n' ), "nno", "Nynorsk" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
343 { lng( 'n','r' ), "nbl", "isiNdebele" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
344 { lng( 'n','v' ), "nav", "Diné bizaad" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
345 { lng( 'n','y' ), "nya", "Chichewa" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
346 { lng( 'o','c' ), "oci", "Occitan" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
347 { lng( 'o','m' ), "orm", "Afaan Oromoo" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
348 { lng( 'o','r' ), "ori", "ଓଡ଼ିଆ" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
349 { lng( 'o','s' ), "oss", "Ирон ӕвзаг" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
350 { lng( 'p','a' ), "pan", "ਪੰਜਾਬੀ" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
351 { lng( 'p','l' ), "pol", "Język polski" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
352 { lng( 'p','s' ), "pus", "پښتو" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
353 { lng( 'p','t' ), "por", "Português" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
354 { lng( 'q','u' ), "que", "Runa Simi" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
355 { lng( 'r','m' ), "roh", "Rätoromanisch" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
356 { lng( 'r','n' ), "run", "íkiRǔndi" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
357 { lng( 'r','o' ), "ron", "Română)" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
358 { lng( 'r','o' ), "rum", "Română)" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
359 { lng( 'r','u' ), "rus", "Русский" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
360 { lng( 'r','w' ), "kin", "Ikinyarwanda" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
361 { lng( 's','c' ), "srd", "Sardu" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
362 { lng( 's','d' ), "snd", "سنڌي" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
363 { lng( 's','g' ), "sag", "Sängö" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
364 { lng( 's','i' ), "sin", "සිංහල" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
365 { lng( 's','k' ), "slk", "Slovenčina" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
366 { lng( 's','k' ), "slo", "Slovenčina" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
367 { lng( 's','l' ), "slv", "Slovenščina" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
368 { lng( 's','m' ), "smo", "Gagana Sāmoa" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
369 { lng( 's','n' ), "sna", "chiShona" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
370 { lng( 's','o' ), "som", "Af-ka Soomaali-ga" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
371 { lng( 's','q' ), "sqi", "Shqip" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
372 { lng( 's','q' ), "alb", "Shqip" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
373 { lng( 's','r' ), "srp", "Српски" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
374 { lng( 's','s' ), "ssw", "siSwati" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
375 { lng( 's','t' ), "sot", "seSotho" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
376 { lng( 's','u' ), "sun", "Basa Sunda" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
377 { lng( 's','v' ), "swe", "Svenska" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
378 { lng( 's','w' ), "swa", "Kiswahili" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
379 { lng( 't','a' ), "tam", "தமிழ்" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
380 { lng( 't','e' ), "tel", "తెలుగు" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
381 { lng( 't','g' ), "tgk", "тоҷикӣ" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
382 { lng( 't','h' ), "tha", "ภาษาไทย" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
383 { lng( 't','i' ), "tir", "ትግርኛ" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
384 { lng( 't','k' ), "tuk", "Türkmençe" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
385 { lng( 't','l' ), "tgl", "Tagalog" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
386 { lng( 't','n' ), "tsn", "Setswana" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
387 { lng( 't','o' ), "ton", "Lea fakatonga" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
388 { lng( 't','r' ), "tur", "Türkçe" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
389 { lng( 't','s' ), "tso", "Xitsonga" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
390 { lng( 't','t' ), "tat", "татарча" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
391 { lng( 't','w' ), "twi", "Twi" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
392 { lng( 't','y' ), "tah", "Reo Tahiti" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
393 { lng( 'u','g' ), "uig", "ئۇيغۇرچە" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
394 { lng( 'u','k' ), "ukr", "Українська" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
395 { lng( 'u','r' ), "urd", "اردو" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
396 { lng( 'u','z' ), "uzb", "Oʻzbek tili" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
397 { lng( 'v','i' ), "vie", "Tiếng Việt" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
398 { lng( 'w','o' ), "wol", "Wolof" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
399 { lng( 'x','h' ), "xho", "isiXhosa" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
400 { lng( 'y','i' ), "yid", "יידיש" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
401 { lng( 'y','o' ), "yor", "Yorùbá" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
402 { lng( 'z','a' ), "zha", "壮语" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
403 { lng( 'z','h' ), "zho", "漢語" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
404 { lng( 'z','h' ), "chi", "漢語" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
405 { lng( 'z','u' ), "zul", "isiZulu" }, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
406 }; |
33572 | 407 |
408 static char * ChannelTypes[] = | |
37023 | 409 { "Dolby Digital","","Mpeg1","Mpeg2","PCM","","Digital Theatre System" }; |
33572 | 410 static char * ChannelNumbers[] = |
37023 | 411 { "","Stereo","","","","5.1" }; |
33572 | 412 |
36708
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
413 enum |
33572 | 414 { |
36708
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
415 GET_LANG_INT, |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
416 GET_LANG_CHR |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
417 }; |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
418 |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
419 static const char * GetLanguage( void *language, int type ) |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
420 { |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
421 int l; |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
422 char *p; |
33572 | 423 unsigned int i; |
36708
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
424 if ( type == GET_LANG_INT ) l = *(int *) language; |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
425 else |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
426 { |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
427 p = language; |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
428 |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
429 if ( p[2] == 0) |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
430 { |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
431 l = lng( p[0], p[1] ); |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
432 type = GET_LANG_INT; |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
433 } |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
434 else if ( p[3] != 0) return language; |
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
435 } |
33572 | 436 for ( i=0;i<sizeof( Languages ) / sizeof( Languages_t );i++ ) |
36708
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
437 if ( type == GET_LANG_INT ? Languages[i].id == l : strcasecmp(Languages[i].id2, p) == 0 ) return Languages[i].name; |
36701 | 438 return MSGTR_GUI_Unknown; |
33572 | 439 } |
36708
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
440 #undef lng |
34454 | 441 #endif |
33572 | 442 |
443 | |
36028 | 444 static GtkWidget * DVDSubMenu; |
33572 | 445 GtkWidget * DVDTitleMenu; |
446 GtkWidget * DVDChapterMenu; | |
447 GtkWidget * DVDAudioLanguageMenu; | |
448 GtkWidget * DVDSubtitleLanguageMenu; | |
449 GtkWidget * AspectMenu; | |
37081 | 450 GtkWidget * RotationMenu; |
33572 | 451 GtkWidget * VCDSubMenu; |
452 GtkWidget * VCDTitleMenu; | |
34387 | 453 GtkWidget * CDSubMenu; |
454 GtkWidget * CDTitleMenu; | |
33572 | 455 |
35996 | 456 GtkWidget * CreatePopUpMenu( void ) |
33572 | 457 { |
458 GtkWidget * window1; | |
459 GtkWidget * Menu = NULL; | |
460 GtkWidget * SubMenu = NULL; | |
461 GtkWidget * MenuItem = NULL; | |
462 GtkWidget * H, * N, * D, * F; | |
33657 | 463 demuxer_t *demuxer = mpctx_get_demuxer(guiInfo.mpcontext); |
33572 | 464 mixer_t *mixer = mpctx_get_mixer(guiInfo.mpcontext); |
37159
d4fbf2eb4a04
Ensure up-to-dateness of global_sub information upon request.
ib
parents:
37081
diff
changeset
|
465 int subs = 0, sub_pos; |
33572 | 466 |
467 Menu=gtk_menu_new(); | |
468 gtk_widget_realize (Menu); | |
469 window1 = gtk_widget_get_toplevel(Menu); | |
470 | |
471 | |
36694 | 472 AddMenuItem( window1, (const char*)about_xpm, Menu,MSGTR_GUI_AboutMPlayer" ", evAbout ); |
33572 | 473 AddSeparator( Menu ); |
36694 | 474 SubMenu=AddSubMenu( window1, (const char*)open_xpm, Menu,MSGTR_GUI_Open ); |
475 AddMenuItem( window1, (const char*)file2_xpm, SubMenu,MSGTR_GUI_File"... ", evLoadPlay ); | |
34387 | 476 #ifdef CONFIG_CDDA |
36694 | 477 AddMenuItem( window1, (const char*)playcd_xpm, SubMenu,MSGTR_GUI_CD, evPlayCD ); |
478 CDSubMenu=AddSubMenu( window1, (const char*)cd_xpm, Menu,MSGTR_GUI_CD ); | |
479 AddMenuItem( window1, (const char*)playcd_xpm, CDSubMenu,MSGTR_GUI_Play,evPlayCD ); | |
34387 | 480 AddSeparator( CDSubMenu ); |
36694 | 481 CDTitleMenu=AddSubMenu( window1, (const char*)title_xpm, CDSubMenu,MSGTR_GUI_Titles ); |
34420 | 482 if ( guiInfo.Tracks && ( guiInfo.StreamType == STREAMTYPE_CDDA ) ) |
34387 | 483 { |
484 char tmp[32]; int i; | |
485 for ( i=1;i <= guiInfo.Tracks;i++ ) | |
486 { | |
36694 | 487 snprintf( tmp,32,MSGTR_GUI_TitleNN,i ); |
34387 | 488 //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
|
489 AddMenuCheckItem(window1, (const char*)empty1px_xpm, CDTitleMenu,tmp, guiInfo.Track == i, ( i << 16 ) + ivSetCDTrack ); |
34387 | 490 } |
491 } | |
492 else | |
493 { | |
36694 | 494 MenuItem=AddMenuItem( window1, (const char*)empty1px_xpm, CDTitleMenu,MSGTR_GUI__none_,evNone ); |
34387 | 495 gtk_widget_set_sensitive( MenuItem,FALSE ); |
496 } | |
497 #endif | |
33572 | 498 #ifdef CONFIG_VCD |
36694 | 499 AddMenuItem( window1, (const char*)playvcd_xpm, SubMenu,MSGTR_GUI_VCD, evPlayVCD ); |
500 VCDSubMenu=AddSubMenu( window1, (const char*)vcd_xpm, Menu,MSGTR_GUI_VCD ); | |
501 AddMenuItem( window1, (const char*)playvcd_xpm, VCDSubMenu,MSGTR_GUI_Play,evPlayVCD ); | |
33572 | 502 AddSeparator( VCDSubMenu ); |
36694 | 503 VCDTitleMenu=AddSubMenu( window1, (const char*)title_xpm, VCDSubMenu,MSGTR_GUI_Titles ); |
34420 | 504 if ( guiInfo.Tracks && ( guiInfo.StreamType == STREAMTYPE_VCD ) ) |
33572 | 505 { |
506 char tmp[32]; int i; | |
33876
4789b8eed97e
Get rid of a bunch of needless or redundant guiInfo members.
ib
parents:
33874
diff
changeset
|
507 for ( i=1;i < guiInfo.Tracks;i++ ) |
33572 | 508 { |
36694 | 509 snprintf( tmp,32,MSGTR_GUI_TitleNN,i ); |
34333 | 510 //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
|
511 AddMenuCheckItem(window1, (const char*)empty1px_xpm, VCDTitleMenu,tmp, guiInfo.Track == i + 1, ( ( i + 1 ) << 16 ) + ivSetVCDTrack ); |
33572 | 512 } |
513 } | |
514 else | |
515 { | |
36694 | 516 MenuItem=AddMenuItem( window1, (const char*)empty1px_xpm, VCDTitleMenu,MSGTR_GUI__none_,evNone ); |
33572 | 517 gtk_widget_set_sensitive( MenuItem,FALSE ); |
518 } | |
519 #endif | |
520 #ifdef CONFIG_DVDREAD | |
36694 | 521 AddMenuItem( window1, (const char*)playdvd_xpm, SubMenu,MSGTR_GUI_DVD, evPlayDVD ); |
522 DVDSubMenu=AddSubMenu( window1, (const char*)dvd_xpm, Menu,MSGTR_GUI_DVD ); | |
523 AddMenuItem( window1, (const char*)playdvd_xpm, DVDSubMenu,MSGTR_GUI_Play" ", evPlayDVD ); | |
33572 | 524 // AddMenuItem( DVDSubMenu,MSGTR_MENU_ShowDVDMenu, evNone ); |
525 AddSeparator( DVDSubMenu ); | |
36694 | 526 DVDTitleMenu=AddSubMenu( window1, (const char*)title_xpm, DVDSubMenu,MSGTR_GUI_Titles ); |
34420 | 527 if ( guiInfo.Tracks && ( guiInfo.StreamType == STREAMTYPE_DVD ) ) |
33572 | 528 { |
529 char tmp[32]; int i; | |
33876
4789b8eed97e
Get rid of a bunch of needless or redundant guiInfo members.
ib
parents:
33874
diff
changeset
|
530 for ( i=1 ; i<= guiInfo.Tracks;i++ ) |
33572 | 531 { |
36694 | 532 snprintf( tmp,32,MSGTR_GUI_TitleNN,i); |
33572 | 533 AddMenuCheckItem( window1, (const char*)empty1px_xpm, DVDTitleMenu,tmp, |
37023 | 534 guiInfo.Track == i, |
535 (i << 16) + ivSetDVDTitle ); | |
33572 | 536 } |
537 } | |
538 else | |
539 { | |
36694 | 540 MenuItem=AddMenuItem( window1, (const char*)empty1px_xpm, DVDTitleMenu,MSGTR_GUI__none_,evNone ); |
33572 | 541 gtk_widget_set_sensitive( MenuItem,FALSE ); |
542 } | |
36694 | 543 DVDChapterMenu=AddSubMenu( window1, (const char*)chapter_xpm, DVDSubMenu,MSGTR_GUI_Chapters ); |
34420 | 544 if ( guiInfo.Chapters && ( guiInfo.StreamType == STREAMTYPE_DVD ) ) |
33572 | 545 { |
546 char tmp[32]; int i; | |
33876
4789b8eed97e
Get rid of a bunch of needless or redundant guiInfo members.
ib
parents:
33874
diff
changeset
|
547 for ( i=1;i <= guiInfo.Chapters;i++ ) |
33572 | 548 { |
36694 | 549 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
|
550 AddMenuCheckItem( window1, (const char*)empty1px_xpm, DVDChapterMenu,tmp,guiInfo.Chapter == i, |
37023 | 551 ( i << 16 ) + ivSetDVDChapter ); |
33572 | 552 } |
553 } | |
554 else | |
555 { | |
36694 | 556 MenuItem=AddMenuItem( window1, (const char*)empty1px_xpm, DVDChapterMenu,MSGTR_GUI__none_,evNone ); |
33572 | 557 gtk_widget_set_sensitive( MenuItem,FALSE ); |
558 } | |
36694 | 559 DVDAudioLanguageMenu=AddSubMenu( window1, (const char*)audio_xpm, DVDSubMenu,MSGTR_GUI_AudioTracks ); |
36700 | 560 if ( guiInfo.AudioStreams && demuxer && ( guiInfo.StreamType == STREAMTYPE_DVD ) ) |
33572 | 561 { |
36700 | 562 char tmp[64]; int i; |
33902 | 563 for ( i=0;i < guiInfo.AudioStreams;i++ ) |
33572 | 564 { |
37023 | 565 snprintf( tmp,64,"%s - %s %s",GetLanguage( &guiInfo.AudioStream[i].language, GET_LANG_INT ), |
566 ChannelTypes[ guiInfo.AudioStream[i].type ], | |
567 ChannelNumbers[ guiInfo.AudioStream[i].channels ] ); | |
33572 | 568 AddMenuCheckItem( window1, (const char*)dolby_xpm, DVDAudioLanguageMenu,tmp, |
37023 | 569 demuxer->audio->id == guiInfo.AudioStream[i].id, |
570 ( guiInfo.AudioStream[i].id << 16 ) + ivSetDVDAudio ); | |
33572 | 571 } |
572 } | |
573 else | |
574 { | |
36694 | 575 MenuItem=AddMenuItem( window1, (const char*)empty1px_xpm, DVDAudioLanguageMenu,MSGTR_GUI__none_,evNone ); |
33572 | 576 gtk_widget_set_sensitive( MenuItem,FALSE ); |
577 } | |
36694 | 578 DVDSubtitleLanguageMenu=AddSubMenu( window1, (const char*)subtitle_xpm, DVDSubMenu,MSGTR_GUI_Subtitles ); |
34420 | 579 if ( guiInfo.Subtitles && ( guiInfo.StreamType == STREAMTYPE_DVD ) ) |
33572 | 580 { |
581 char tmp[64]; int i; | |
36694 | 582 AddMenuItem( window1, (const char*)empty1px_xpm, DVDSubtitleLanguageMenu,MSGTR_GUI__none_,( (unsigned short)-1 << 16 ) + ivSetDVDSubtitle ); |
33902 | 583 for ( i=0;i < guiInfo.Subtitles;i++ ) |
33572 | 584 { |
36708
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
585 av_strlcpy( tmp,GetLanguage( &guiInfo.Subtitle[i].language, GET_LANG_INT ),sizeof(tmp) ); |
33572 | 586 AddMenuCheckItem( window1, (const char*)empty1px_xpm, DVDSubtitleLanguageMenu,tmp, |
37023 | 587 dvdsub_id == guiInfo.Subtitle[i].id, |
588 ( guiInfo.Subtitle[i].id << 16 ) + ivSetDVDSubtitle ); | |
33572 | 589 } |
590 } | |
591 else | |
592 { | |
36694 | 593 MenuItem=AddMenuItem( window1, (const char*)empty1px_xpm, DVDSubtitleLanguageMenu,MSGTR_GUI__none_,evNone ); |
33572 | 594 gtk_widget_set_sensitive( MenuItem,FALSE ); |
595 } | |
596 #endif | |
36694 | 597 AddMenuItem( window1, (const char*)url_xpm, SubMenu,MSGTR_GUI_URL"...", evLoadURL ); |
36429 | 598 #ifdef CONFIG_TV |
36694 | 599 AddMenuItem( window1, (const char*)tv_xpm, SubMenu,MSGTR_GUI_TV, evPlayTV ); |
36429 | 600 #endif |
36663 | 601 AddSeparator( SubMenu ); |
36694 | 602 AddMenuItem( window1, (const char*)loadeaf_xpm, SubMenu,MSGTR_GUI_AudioTrack"...", evLoadAudioFile ); |
603 AddMenuItem( window1, (const char*)sub_xpm, SubMenu,MSGTR_GUI_Subtitle"... ", evLoadSubtitle ); | |
604 AddMenuItem( window1, (const char*)nosub_xpm, SubMenu,MSGTR_GUI_DropSubtitle,evDropSubtitle ); | |
605 SubMenu=AddSubMenu(window1, (const char*)play_xpm, Menu,MSGTR_GUI_Playback ); | |
606 AddMenuItem( window1, (const char*)play_xpm, SubMenu,MSGTR_GUI_Play" ", evPlay ); | |
607 AddMenuItem( window1, (const char*)pause_xpm, SubMenu,MSGTR_GUI_Pause, evPause ); | |
608 AddMenuItem( window1, (const char*)stop_xpm, SubMenu,MSGTR_GUI_Stop, evStop ); | |
609 AddMenuItem( window1, (const char*)next_xpm, SubMenu,MSGTR_GUI_Next, evNext ); | |
610 AddMenuItem( window1, (const char*)prev_xpm, SubMenu,MSGTR_GUI_Previous, evPrev ); | |
34419 | 611 // AddSeparator( SubMenu ); |
612 // AddMenuItem( SubMenu,"Back 10 sec", evBackward10sec ); | |
613 // AddMenuItem( SubMenu,"Fwd 10 sec", evForward10sec ); | |
614 // AddMenuItem( SubMenu,"Back 1 min", evBackward1min ); | |
615 // AddMenuItem( SubMenu,"Fwd 1 min", evForward1min ); | |
616 // SubMenu=AddSubMenu( Menu,MSGTR_MENU_Size ); | |
36694 | 617 // AddMenuItem( SubMenu,MSGTR_GUI_SizeNormal" ", evNormalSize ); |
618 // AddMenuItem( SubMenu,MSGTR_GUI_SizeDouble, evDoubleSize ); | |
619 // AddMenuItem( SubMenu,MSGTR_GUI_SizeFullscreen, evFullScreen + ( True << 16 ) ); | |
33572 | 620 |
36261
ca1d4a7bb751
Disable aspect ratio menu in the absence of video playback.
ib
parents:
36029
diff
changeset
|
621 if ( guiInfo.VideoWindow ) |
33572 | 622 { |
37081 | 623 AddSeparator( Menu ); |
624 RotationMenu=AddSubMenu( window1, (const char*)rotate_xpm, Menu,MSGTR_GUI_Rotation ); | |
625 N=AddMenuCheckItem( window1, (const char*)rotate0_xpm, RotationMenu,MSGTR_GUI__none_, guiInfo.Rotation == -1, evSetRotation ); | |
626 D=AddMenuCheckItem( window1, (const char*)rotate90cw_xpm, RotationMenu,MSGTR_GUI_Rotation90CW, guiInfo.Rotation == 1, evSetRotation + ( 90 << 16 ) ); | |
627 F=AddMenuCheckItem( window1, (const char*)rotate90ccw_xpm, RotationMenu,MSGTR_GUI_Rotation90CCW, guiInfo.Rotation == 2, evSetRotation + ( -90 << 16 ) ); | |
628 H=AddMenuCheckItem( window1, (const char*)rotate180_xpm, RotationMenu,MSGTR_GUI_Rotation180, guiInfo.Rotation == 8, evSetRotation + ( 180 << 16 ) ); | |
629 | |
630 if ( !guiInfo.Playing ) | |
631 { | |
632 gtk_widget_set_sensitive( N,FALSE ); | |
633 gtk_widget_set_sensitive( D,FALSE ); | |
634 gtk_widget_set_sensitive( F,FALSE ); | |
635 gtk_widget_set_sensitive( H,FALSE ); | |
636 } | |
637 } | |
638 | |
639 if ( guiInfo.VideoWindow ) | |
640 { | |
36273 | 641 int a11 = False, a169 = False, a43 = False, a235 = False; |
37081 | 642 |
36316
139f2b064ef9
Don't subsequently calculate original_aspect from last movie_aspect.
ib
parents:
36297
diff
changeset
|
643 if (movie_aspect == -1.0f) a11 = True; |
36273 | 644 else |
645 { | |
646 a169 = (FFABS(movie_aspect - 16.0f / 9.0f) <= 0.01f); | |
647 a43 = (FFABS(movie_aspect - 4.0f / 3.0f) <= 0.01f); | |
36276 | 648 a235 = (FFABS(movie_aspect - 2.35f) <= 0.01f); |
36273 | 649 } |
650 | |
36694 | 651 AspectMenu=AddSubMenu( window1, (const char*)aspect_xpm, Menu,MSGTR_GUI_AspectRatio ); |
652 H=AddMenuCheckItem( window1, (const char*)aspect11_xpm, AspectMenu,MSGTR_GUI_Original, a11, evSetAspect + ( 1 << 16 ) ); | |
36273 | 653 N=AddMenuCheckItem( window1, (const char*)aspect169_xpm, AspectMenu,"16:9", a169, evSetAspect + ( 2 << 16 ) ); |
654 D=AddMenuCheckItem( window1, (const char*)aspect43_xpm, AspectMenu,"4:3", a43, evSetAspect + ( 3 << 16 ) ); | |
36694 | 655 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
|
656 |
37059 | 657 if ( !guiInfo.Playing ) |
658 { | |
659 gtk_widget_set_sensitive( H,FALSE ); | |
660 gtk_widget_set_sensitive( N,FALSE ); | |
661 gtk_widget_set_sensitive( D,FALSE ); | |
662 gtk_widget_set_sensitive( F,FALSE ); | |
663 } | |
33572 | 664 } |
665 | |
36622
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
666 if ( guiInfo.VideoWindow ) |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
667 { |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
668 int b1 = False, b2 = False, b_half = False; |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
669 |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
670 if ( !guiApp.videoWindow.isFullScreen && guiInfo.Playing ) |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
671 { |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
672 if ( ( guiApp.videoWindow.Width == guiInfo.VideoWidth * 2 )&& |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
673 ( guiApp.videoWindow.Height == guiInfo.VideoHeight * 2 ) ) b2=True; |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
674 else if ( ( guiApp.videoWindow.Width == guiInfo.VideoWidth / 2 ) && |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
675 ( 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
|
676 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
|
677 } else b1=!guiApp.videoWindow.isFullScreen; |
36694 | 678 F=AddMenuCheckItem( window1, (const char*)full_xpm, Menu,MSGTR_GUI_SizeFullscreen,guiApp.videoWindow.isFullScreen,evFullScreen + ( True << 16 ) ); |
679 D=AddMenuCheckItem( window1, (const char*)double_xpm, Menu,MSGTR_GUI_SizeDouble,b2,evDoubleSize ); | |
680 N=AddMenuCheckItem( window1, (const char*)normal_xpm, Menu,MSGTR_GUI_SizeNormal" ",b1,evNormalSize ); | |
681 H=AddMenuCheckItem( window1, (const char*)half_xpm, Menu,MSGTR_GUI_SizeHalf,b_half,evHalfSize ); | |
37059 | 682 if ( !guiInfo.Playing ) |
683 { | |
684 gtk_widget_set_sensitive( H,FALSE ); | |
685 gtk_widget_set_sensitive( N,FALSE ); | |
686 gtk_widget_set_sensitive( D,FALSE ); | |
687 gtk_widget_set_sensitive( F,FALSE ); | |
688 } | |
36622
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
689 } |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
690 |
b9dc795036a2
Group video and audio related entries in context menu together.
ib
parents:
36621
diff
changeset
|
691 AddSeparator( Menu ); |
36694 | 692 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
|
693 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
|
694 |
33657 | 695 if ( guiInfo.Playing && demuxer && guiInfo.StreamType != STREAMTYPE_DVD ) |
33572 | 696 { |
697 int i,c = 0; | |
698 | |
699 for ( i=0;i < MAX_A_STREAMS;i++ ) | |
33657 | 700 if ( demuxer->a_streams[i] ) c++; |
33572 | 701 |
702 if ( c > 1 ) | |
703 { | |
36694 | 704 SubMenu=AddSubMenu( window1, (const char*)audio_xpm, Menu,MSGTR_GUI_AudioTracks ); |
33572 | 705 for ( i=0;i < MAX_A_STREAMS;i++ ) |
33657 | 706 if ( demuxer->a_streams[i] ) |
33572 | 707 { |
33657 | 708 int aid = ((sh_audio_t *)demuxer->a_streams[i])->aid; |
36699 | 709 int selected_id = (audio_id == aid || (audio_id == -1 && aid == demuxer_default_audio_track(demuxer))); |
36704 | 710 char lng[32], tmp[64]; |
36708
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
711 if ( demuxer_audio_lang( demuxer, i, lng, sizeof(lng) ) == 0 ) snprintf( tmp,sizeof(tmp),MSGTR_GUI_TrackN" - %s",aid,GetLanguage( lng, GET_LANG_CHR ) ); |
36704 | 712 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
|
713 AddMenuCheckItem( window1, (const char*)empty1px_xpm, SubMenu,tmp,selected_id,( aid << 16 ) + ivSetAudio ); |
33572 | 714 } |
715 } | |
716 | |
717 for ( c=0,i=0;i < MAX_V_STREAMS;i++ ) | |
33657 | 718 if ( demuxer->v_streams[i] ) c++; |
33572 | 719 |
720 if ( c > 1 ) | |
721 { | |
36694 | 722 SubMenu=AddSubMenu( window1, (const char*)video_xpm, Menu,MSGTR_GUI_VideoTracks ); |
33572 | 723 for ( i=0;i < MAX_V_STREAMS;i++ ) |
33657 | 724 if ( demuxer->v_streams[i] ) |
33572 | 725 { |
33657 | 726 int vid = ((sh_video_t *)demuxer->v_streams[i])->vid; |
33572 | 727 char tmp[32]; |
36699 | 728 int selected_id = (video_id == vid || (video_id == -1 && vid == demuxer_default_video_track(demuxer))); |
36694 | 729 snprintf( tmp,32,MSGTR_GUI_TrackN,vid ); |
36683 | 730 AddMenuCheckItem( window1, (const char*)empty1px_xpm, SubMenu,tmp,selected_id,( vid << 16 ) + ivSetVideo ); |
33572 | 731 } |
732 } | |
733 } | |
734 | |
735 /* cheap subtitle switching for non-DVD streams */ | |
37159
d4fbf2eb4a04
Ensure up-to-dateness of global_sub information upon request.
ib
parents:
37081
diff
changeset
|
736 |
d4fbf2eb4a04
Ensure up-to-dateness of global_sub information upon request.
ib
parents:
37081
diff
changeset
|
737 mpctx_get_global_sub_info(guiInfo.mpcontext, &subs, &sub_pos); |
d4fbf2eb4a04
Ensure up-to-dateness of global_sub information upon request.
ib
parents:
37081
diff
changeset
|
738 |
d4fbf2eb4a04
Ensure up-to-dateness of global_sub information upon request.
ib
parents:
37081
diff
changeset
|
739 if ( subs && guiInfo.StreamType != STREAMTYPE_DVD ) |
33572 | 740 { |
37159
d4fbf2eb4a04
Ensure up-to-dateness of global_sub information upon request.
ib
parents:
37081
diff
changeset
|
741 int i, j, subs0 = guiInfo.mpcontext->sub_counts[SUB_SOURCE_SUBS], subs1 = guiInfo.mpcontext->sub_counts[SUB_SOURCE_VOBSUB]; |
36694 | 742 SubMenu=AddSubMenu( window1, (const char*)subtitle_xpm, Menu, MSGTR_GUI_Subtitles ); |
37159
d4fbf2eb4a04
Ensure up-to-dateness of global_sub information upon request.
ib
parents:
37081
diff
changeset
|
743 AddMenuCheckItem( window1, (const char*)empty1px_xpm, SubMenu, MSGTR_GUI__none_, sub_pos == -1, (-1 << 16) + ivSetSubtitle ); |
d4fbf2eb4a04
Ensure up-to-dateness of global_sub information upon request.
ib
parents:
37081
diff
changeset
|
744 for ( i=0;i < subs;i++ ) |
33572 | 745 { |
36705 | 746 int ret = -1; |
36707 | 747 char lng[32], tmp[64], *lang = NULL; |
748 /* file */ | |
749 if ( i < subs0 ) | |
750 { | |
751 if ( guiInfo.mpcontext->set_of_subtitles[i] ) lang = guiInfo.mpcontext->set_of_subtitles[i]->filename; | |
752 #ifdef CONFIG_ASS | |
753 if ( ass_track && ass_track->name ) lang = ass_track->name; | |
754 #endif | |
755 if ( lang ) | |
756 { | |
757 av_strlcpy( lng, mp_basename(lang), sizeof(lng) ); | |
758 ret = 0; | |
759 } | |
760 } | |
36706 | 761 /* VOBsub */ |
36707 | 762 else if ( ( i >= subs0 && i < subs0 + subs1 ) && vo_vobsub ) |
36706 | 763 { |
764 lang = vobsub_get_id( vo_vobsub, vobsub_get_id_by_index( vo_vobsub, i - subs0 ) ); | |
765 | |
766 if ( lang ) | |
767 { | |
768 av_strlcpy( lng, lang, sizeof(lng) ); | |
769 ret = 0; | |
770 } | |
771 } | |
772 /* embedded (demuxer) */ | |
36781 | 773 else if ( ( i >= subs0 + subs1 ) && demuxer ) |
36705 | 774 { |
775 for ( j=0;j < MAX_S_STREAMS;j++ ) | |
776 { | |
777 if ( demuxer->s_streams[j] ) ret++; | |
778 if ( ret == i - subs0 - subs1 ) | |
779 { | |
780 ret = demuxer_sub_lang( demuxer, j, lng, sizeof(lng) ); | |
781 break; | |
782 } | |
783 } | |
784 } | |
36708
9274efe53180
Improve language information on audio and subtitle streams.
ib
parents:
36707
diff
changeset
|
785 if ( ret == 0 ) snprintf( tmp, sizeof(tmp), MSGTR_GUI_TrackN" - %s", i, GetLanguage( lng, GET_LANG_CHR ) ); |
36705 | 786 else snprintf( tmp, sizeof(tmp), MSGTR_GUI_TrackN, i ); |
37159
d4fbf2eb4a04
Ensure up-to-dateness of global_sub information upon request.
ib
parents:
37081
diff
changeset
|
787 AddMenuCheckItem( window1,(const char*)empty1px_xpm,SubMenu,tmp,sub_pos == i,( i << 16 ) + ivSetSubtitle ); |
33572 | 788 } |
789 } | |
790 | |
791 AddSeparator( Menu ); | |
36694 | 792 AddMenuItem( window1, (const char*)equalizer_xpm, Menu,MSGTR_GUI_Equalizer, evEqualizer ); |
793 AddMenuItem( window1, (const char*)playlist_xpm, Menu,MSGTR_GUI_Playlist, evPlaylist ); | |
794 AddMenuItem( window1, (const char*)skin_xpm, Menu,MSGTR_GUI_SkinBrowser, evSkinBrowser ); | |
795 AddMenuItem( window1, (const char*)prefs_xpm, Menu,MSGTR_GUI_Preferences, evPreferences ); | |
36620 | 796 |
797 AddSeparator( Menu ); | |
36694 | 798 AddMenuItem( window1, (const char*)exit_xpm, Menu,MSGTR_GUI_Quit, evExit ); |
33572 | 799 |
800 return Menu; | |
801 } |