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