Mercurial > mplayer.hg
annotate gui/ui/gtk/preferences.c @ 34309:119af6360b00
Discard frames where the size does not match the AVCodecContext width/height.
This avoids possible crashes on video size changes. The problem
is that we reinitialize the vo on get_buffer but due to codec
delay libavcodec might still return frames with the old size
afterwards, which the vo might no longer be able to handle.
Ideally libavcodec should not show this behaviour, since it
requires that any application using DR1 can handle frames of
different sizes simultaneously - which seems a bit extreme.
author | reimar |
---|---|
date | Mon, 05 Dec 2011 18:08:29 +0000 |
parents | 8beec562ce0e |
children | 5a45efc630b8 |
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 <stdlib.h> | |
20 #include <sys/types.h> | |
21 #include <sys/stat.h> | |
22 #include <unistd.h> | |
23 #include <string.h> | |
24 | |
25 #include <gdk/gdkkeysyms.h> | |
26 #include <gtk/gtk.h> | |
27 | |
28 #include "config.h" | |
29 #include "help_mp.h" | |
30 #include "mixer.h" | |
31 #include "mpcommon.h" | |
32 #include "libao2/audio_out.h" | |
33 #include "sub/sub.h" | |
34 #include "libvo/video_out.h" | |
35 #include "libvo/x11_common.h" | |
36 #include "stream/stream.h" | |
37 #include "libmpdemux/demuxer.h" | |
38 #include "libmpdemux/stheader.h" | |
39 #include "libmpcodecs/dec_video.h" | |
40 #include "sub/font_load.h" | |
41 | |
42 #include "gui/app.h" | |
43 #include "gui/cfg.h" | |
44 #include "gui/interface.h" | |
45 #include "gui/ui/gmplayer.h" | |
46 #include "gui/ui/widgets.h" | |
33741 | 47 #include "gui/util/list.h" |
33739 | 48 #include "gui/util/mem.h" |
33737 | 49 #include "gui/util/string.h" |
33572 | 50 #include "preferences.h" |
51 #include "fileselect.h" | |
52 #include "tools.h" | |
53 | |
54 // for mpcodecs_[av]d_drivers: | |
55 #include "libmpcodecs/vd.h" | |
56 #include "libmpcodecs/ad.h" | |
57 | |
58 GtkWidget * Preferences = NULL; | |
59 static GtkWidget * AConfig; | |
60 static GtkWidget * VConfig; | |
61 //static GtkWidget * BLoadSubtitle; | |
62 static GtkWidget * BLoadFont; | |
63 static GtkWidget * BOk; | |
64 static GtkWidget * BCancel; | |
65 | |
66 static GtkWidget * CLADrivers; | |
67 static GtkWidget * CLVDrivers; | |
68 | |
69 //static GtkWidget * ESubtitleName; | |
70 GtkWidget * prEFontName; | |
71 GtkWidget * prEDVDDevice; | |
72 GtkWidget * prECDRomDevice; | |
73 static GtkWidget * EVFM; | |
74 static GtkWidget * EAFM; | |
75 | |
76 static GtkWidget * CBVFM; | |
77 static GtkWidget * CBAFM; | |
78 static GtkWidget * CBAudioEqualizer; | |
79 //static GtkWidget * CBSurround; | |
80 static GtkWidget * CBExtraStereo; | |
81 static GtkWidget * CBNormalize; | |
82 static GtkWidget * CBSoftwareMixer; | |
83 static GtkWidget * CBDoubleBuffer; | |
84 static GtkWidget * CBDR; | |
85 static GtkWidget * CBFramedrop; | |
86 static GtkWidget * CBHFramedrop; | |
87 //static GtkWidget * CBFullScreen; | |
88 static GtkWidget * CBShowVideoWindow; | |
89 static GtkWidget * CBNonInterlaved; | |
90 static GtkWidget * CBIndex; | |
91 static GtkWidget * CBFlip; | |
92 static GtkWidget * CBNoAutoSub; | |
93 static GtkWidget * CBSubUnicode; | |
94 static GtkWidget * CBSubOverlap; | |
95 static GtkWidget * CBDumpMPSub; | |
96 static GtkWidget * CBDumpSrt; | |
97 static GtkWidget * CBUseASS; | |
98 static GtkWidget * CBASSUseMargins; | |
99 static GtkWidget * SBASSTopMargin; | |
100 static GtkWidget * SBASSBottomMargin; | |
101 static GtkWidget * CBPostprocess; | |
102 static GtkWidget * CBCache; | |
103 static GtkWidget * CBLoadFullscreen; | |
104 static GtkWidget * CBSaveWinPos; | |
105 static GtkWidget * CBStopXScreenSaver; | |
106 static GtkWidget * CBPlayBar; | |
107 static GtkWidget * CBNoIdle; | |
108 | |
109 static GtkWidget * SBCache; | |
110 static GtkAdjustment * SBCacheadj; | |
111 | |
112 static GtkWidget * CBAutoSync; | |
113 static GtkWidget * SBAutoSync; | |
114 static GtkAdjustment * SBAutoSyncadj; | |
115 | |
116 static GtkWidget * RBOSDNone; | |
33777
235c6f2514be
Arrange OSD preferences according to option 'osdlevel'.
ib
parents:
33769
diff
changeset
|
117 static GtkWidget * RBOSDIndicator; |
33572 | 118 static GtkWidget * RBOSDTandP; |
119 static GtkWidget * RBOSDTPTT; | |
120 | |
121 static GtkWidget * HSAudioDelay; | |
122 static GtkWidget * HSExtraStereoMul; | |
123 static GtkWidget * HSPanscan; | |
124 static GtkWidget * HSSubDelay; | |
125 static GtkWidget * HSSubPosition; | |
126 static GtkWidget * HSSubFPS; | |
127 static GtkWidget * HSPPQuality; | |
128 static GtkWidget * HSFPS; | |
129 | |
130 static GtkAdjustment * HSExtraStereoMuladj, * HSAudioDelayadj, * HSPanscanadj, * HSSubDelayadj; | |
131 static GtkAdjustment * HSSubPositionadj, * HSSubFPSadj, * HSPPQualityadj, * HSFPSadj; | |
132 | |
133 #ifndef CONFIG_FREETYPE | |
134 static GtkWidget * HSFontFactor; | |
135 static GtkAdjustment * HSFontFactoradj; | |
136 #else | |
137 static GtkWidget * HSFontBlur, * HSFontOutLine, * HSFontTextScale, * HSFontOSDScale; | |
138 static GtkAdjustment * HSFontBluradj, * HSFontOutLineadj, * HSFontTextScaleadj, * HSFontOSDScaleadj; | |
139 static GtkWidget * CBFontEncoding, * EFontEncoding; | |
140 static GtkWidget * RBFontNoAutoScale, * RBFontAutoScaleWidth, * RBFontAutoScaleHeight, * RBFontAutoScaleDiagonal; | |
141 //static GtkWidget * AutoScale; | |
142 #endif | |
143 | |
144 #ifdef CONFIG_ICONV | |
145 static GtkWidget * CBSubEncoding, * ESubEncoding; | |
146 #endif | |
147 | |
148 #if defined(CONFIG_FREETYPE) || defined(CONFIG_ICONV) | |
149 static struct | |
150 { | |
151 char * name; | |
152 char * comment; | |
153 } lEncoding[] = | |
154 { | |
155 { "unicode", MSGTR_PREFERENCES_FontEncoding1 }, | |
156 { "iso-8859-1", MSGTR_PREFERENCES_FontEncoding2 }, | |
157 { "iso-8859-15", MSGTR_PREFERENCES_FontEncoding3 }, | |
158 { "iso-8859-2", MSGTR_PREFERENCES_FontEncoding4 }, | |
159 { "cp1250", MSGTR_PREFERENCES_FontEncoding22}, | |
160 { "iso-8859-3", MSGTR_PREFERENCES_FontEncoding5 }, | |
161 { "iso-8859-4", MSGTR_PREFERENCES_FontEncoding6 }, | |
162 { "iso-8859-5", MSGTR_PREFERENCES_FontEncoding7 }, | |
163 { "cp1251", MSGTR_PREFERENCES_FontEncoding21}, | |
164 { "iso-8859-6", MSGTR_PREFERENCES_FontEncoding8 }, | |
165 { "cp1256", MSGTR_PREFERENCES_FontEncoding23 }, | |
166 { "iso-8859-7", MSGTR_PREFERENCES_FontEncoding9 }, | |
167 { "iso-8859-9", MSGTR_PREFERENCES_FontEncoding10 }, | |
168 { "iso-8859-13", MSGTR_PREFERENCES_FontEncoding11 }, | |
169 { "iso-8859-14", MSGTR_PREFERENCES_FontEncoding12 }, | |
170 { "iso-8859-8", MSGTR_PREFERENCES_FontEncoding13 }, | |
171 { "koi8-r", MSGTR_PREFERENCES_FontEncoding14 }, | |
172 { "koi8-u/ru", MSGTR_PREFERENCES_FontEncoding15 }, | |
173 { "cp936", MSGTR_PREFERENCES_FontEncoding16 }, | |
174 { "big5", MSGTR_PREFERENCES_FontEncoding17 }, | |
175 { "shift-jis", MSGTR_PREFERENCES_FontEncoding18 }, | |
176 { "cp949", MSGTR_PREFERENCES_FontEncoding19 }, | |
177 { "cp874", MSGTR_PREFERENCES_FontEncoding20 }, | |
178 { NULL,NULL } | |
179 }; | |
180 #endif | |
181 | |
182 static int old_audio_driver = 0; | |
183 static char * ao_driver[3]; | |
184 static char * vo_driver[3]; | |
185 static int old_video_driver = 0; | |
186 | |
187 #ifdef CONFIG_DXR3 | |
188 void ShowDXR3Config( void ); | |
189 void HideDXR3Config( void ); | |
190 #endif | |
191 void ShowAudioConfig( void ); | |
192 void HideAudioConfig( void ); | |
193 | |
194 static gboolean prHScaler( GtkWidget * widget,GdkEventMotion * event,gpointer user_data ); | |
195 static void prToggled( GtkToggleButton * togglebutton,gpointer user_data ); | |
196 static void prCListRow( GtkCList * clist,gint row,gint column,GdkEvent * event,gpointer user_data ); | |
197 #if defined(CONFIG_FREETYPE) || defined(CONFIG_ICONV) | |
198 static void prEntry( GtkContainer * container,gpointer user_data ); | |
199 #endif | |
200 | |
201 void ShowPreferences( void ) | |
202 { | |
203 if ( Preferences ) gtkActive( Preferences ); | |
204 else Preferences=create_Preferences(); | |
205 | |
206 // -- 1. page | |
207 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBAudioEqualizer ),gtkEnableAudioEqualizer ); | |
208 #if 0 | |
209 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBSurround ),gtkAOSurround ); | |
210 #endif | |
211 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBExtraStereo ),gtkAOExtraStereo ); | |
212 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBNormalize ),gtkAONorm ); | |
213 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBSoftwareMixer ),soft_vol ); | |
214 gtk_adjustment_set_value( HSExtraStereoMuladj,gtkAOExtraStereoMul ); | |
215 { | |
216 int i = 0; | |
217 char * tmp[3]; tmp[2]=""; | |
218 old_audio_driver=-1; | |
219 if ( CLADrivers ) gtk_clist_clear( GTK_CLIST( CLADrivers ) ); | |
220 while ( audio_out_drivers[i] ) | |
221 { | |
222 const ao_info_t *info = audio_out_drivers[i++]->info; | |
223 if ( !strcmp( info->short_name,"plugin" ) ) continue; | |
224 if ( audio_driver_list ) | |
225 { | |
226 char * name = gstrdup( audio_driver_list[0] ); | |
227 char * sep = gstrchr( audio_driver_list[0],':' ); | |
228 if ( sep ) *sep=0; | |
229 if ( !gstrcmp( name,(char *)info->short_name ) ) old_audio_driver=i - 1; | |
230 free( name ); | |
231 } | |
232 tmp[0]=(char *)info->short_name; tmp[1]=(char *)info->name; gtk_clist_append( GTK_CLIST( CLADrivers ),tmp ); | |
233 } | |
234 if ( old_audio_driver > -1 ) | |
235 { | |
236 gtk_clist_select_row( GTK_CLIST( CLADrivers ),old_audio_driver,0 ); | |
237 gtk_clist_get_text( GTK_CLIST( CLADrivers ),old_audio_driver,0,(char **)&ao_driver ); | |
238 gtk_widget_set_sensitive( AConfig,FALSE ); | |
239 if ( !strncmp( ao_driver[0],"oss",3 ) || | |
240 !strncmp( ao_driver[0],"alsa",4 ) || | |
241 !strncmp( ao_driver[0],"esd",3 ) || | |
242 !strncmp( ao_driver[0],"sdl",3 ) ) | |
243 gtk_widget_set_sensitive( AConfig,TRUE ); | |
244 } | |
245 } | |
246 | |
247 // -- 2. page | |
248 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBDoubleBuffer ),vo_doublebuffering ); | |
249 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBDR ),vo_directrendering ); | |
250 | |
251 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBFramedrop ),FALSE ); | |
252 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBHFramedrop ),FALSE ); | |
253 switch ( frame_dropping ) | |
254 { | |
255 case 2: gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBHFramedrop ),TRUE ); | |
256 case 1: gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBFramedrop ),TRUE ); | |
257 } | |
258 | |
259 if (flip != -1) | |
260 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBFlip ),flip ); | |
261 gtk_adjustment_set_value( HSPanscanadj,vo_panscan ); | |
262 | |
263 { | |
264 int i = 0, c = 0; | |
265 char * tmp[3]; tmp[2]=""; | |
266 old_video_driver=0; | |
267 if ( CLVDrivers ) gtk_clist_clear( GTK_CLIST( CLVDrivers ) ); | |
268 while ( video_out_drivers[i] ) | |
269 if ( video_out_drivers[i++]->control( VOCTRL_GUISUPPORT,NULL ) == VO_TRUE ) | |
270 { | |
271 if ( video_driver_list && !gstrcmp( video_driver_list[0],(char *)video_out_drivers[i - 1]->info->short_name ) ) old_video_driver=c; c++; | |
272 tmp[0]=(char *)video_out_drivers[i - 1]->info->short_name; tmp[1]=(char *)video_out_drivers[i - 1]->info->name; | |
273 gtk_clist_append( GTK_CLIST( CLVDrivers ),tmp ); | |
274 } | |
275 gtk_clist_select_row( GTK_CLIST( CLVDrivers ),old_video_driver,0 ); | |
276 gtk_clist_get_text( GTK_CLIST( CLVDrivers ),old_video_driver,0,(char **)&vo_driver ); | |
277 gtk_widget_set_sensitive( VConfig,FALSE ); | |
278 #ifdef CONFIG_DXR3 | |
279 if ( !gstrcmp( vo_driver[0],"dxr3" ) ) gtk_widget_set_sensitive( VConfig,TRUE ); | |
280 #endif | |
281 } | |
282 | |
283 gtk_adjustment_set_value( HSFPSadj,force_fps ); | |
284 | |
285 // -- 3. page | |
286 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBSubOverlap ),suboverlap_enabled ); | |
287 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBNoAutoSub ),!sub_auto ); | |
288 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBDumpMPSub ),gtkSubDumpMPSub ); | |
289 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBDumpSrt ),gtkSubDumpSrt ); | |
290 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBSubUnicode ),sub_unicode ); | |
291 #ifdef CONFIG_ASS | |
292 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBUseASS ),gtkASS.enabled ); | |
293 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBASSUseMargins ),gtkASS.use_margins ); | |
294 gtk_spin_button_set_value( (GtkSpinButton *)SBASSTopMargin,(gdouble)gtkASS.top_margin ); | |
295 gtk_spin_button_set_value( (GtkSpinButton *)SBASSBottomMargin,(gdouble)gtkASS.bottom_margin ); | |
296 | |
297 if ( !gtkASS.enabled ) | |
298 { | |
299 gtk_widget_set_sensitive( CBASSUseMargins,FALSE ); | |
300 gtk_widget_set_sensitive( SBASSTopMargin,FALSE ); | |
301 gtk_widget_set_sensitive( SBASSBottomMargin,FALSE ); | |
302 } | |
303 #endif | |
304 | |
305 gtk_adjustment_set_value( HSSubDelayadj,sub_delay ); | |
306 gtk_adjustment_set_value( HSSubFPSadj,sub_fps ); | |
307 gtk_adjustment_set_value( HSSubPositionadj,sub_pos ); | |
308 switch ( osd_level ) | |
309 { | |
310 case 0: gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( RBOSDNone ),TRUE ); break; | |
311 case 1: gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( RBOSDIndicator ),TRUE ); break; | |
312 case 2: gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( RBOSDTandP ),TRUE ); break; | |
313 case 3: gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( RBOSDTPTT ),TRUE ); break; | |
314 } | |
315 #if 0 | |
33897 | 316 if ( guiInfo.SubtitleFilename ) gtk_entry_set_text( GTK_ENTRY( ESubtitleName ),guiInfo.SubtitleFilename ); |
33572 | 317 #endif |
318 | |
319 #ifdef CONFIG_ICONV | |
320 if ( sub_cp ) | |
321 { | |
322 int i; | |
323 for ( i=0;lEncoding[i].name;i++ ) | |
33786 | 324 if ( !gstrcasecmp( sub_cp,lEncoding[i].name ) ) break; |
33785 | 325 if ( lEncoding[i].name ) gtk_entry_set_text( GTK_ENTRY( ESubEncoding ),lEncoding[i].comment ); |
33572 | 326 } |
327 #endif | |
328 | |
329 // --- 4. page | |
330 // font ... | |
331 if ( font_name ) gtk_entry_set_text( GTK_ENTRY( prEFontName ),font_name ); | |
332 #ifndef CONFIG_FREETYPE | |
333 gtk_adjustment_set_value( HSFontFactoradj,font_factor ); | |
334 #else | |
335 gtk_adjustment_set_value( HSFontBluradj,( subtitle_font_radius / 8.0f ) * 100.0f ); | |
336 gtk_adjustment_set_value( HSFontOutLineadj,( subtitle_font_thickness / 8.0f ) * 100.0f ); | |
337 gtk_adjustment_set_value( HSFontTextScaleadj,text_font_scale_factor ); | |
338 gtk_adjustment_set_value( HSFontOSDScaleadj,osd_font_scale_factor ); | |
339 if ( subtitle_font_encoding ) | |
340 { | |
341 int i; | |
342 for ( i=0;lEncoding[i].name;i++ ) | |
33786 | 343 if ( !gstrcasecmp( subtitle_font_encoding,lEncoding[i].name ) ) break; |
33785 | 344 if ( lEncoding[i].name ) gtk_entry_set_text( GTK_ENTRY( EFontEncoding ),lEncoding[i].comment ); |
33572 | 345 } |
346 switch ( subtitle_autoscale ) | |
347 { | |
348 case 0: gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( RBFontNoAutoScale ),TRUE ); break; | |
349 case 1: gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( RBFontAutoScaleHeight ),TRUE ); break; | |
350 case 2: gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( RBFontAutoScaleWidth ),TRUE ); break; | |
351 case 3: gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( RBFontAutoScaleDiagonal ),TRUE ); break; | |
352 } | |
353 #endif | |
354 | |
355 // -- 5. page | |
356 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBNonInterlaved ),force_ni ); | |
357 if ( index_mode == 1 ) gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBIndex ),1 ); | |
358 { | |
359 int i; | |
360 GList * Items = NULL; | |
361 char * name = NULL; | |
362 | |
363 Items=g_list_append( Items,MSGTR_PREFERENCES_None ); | |
364 for( i=0;mpcodecs_vd_drivers[i];i++ ) | |
365 { | |
366 Items=g_list_append( Items,(char *)mpcodecs_vd_drivers[i]->info->name ); | |
367 if ( video_fm_list && !gstrcmp( video_fm_list[0],(char *)mpcodecs_vd_drivers[i]->info->short_name ) ) name=(char *)mpcodecs_vd_drivers[i]->info->name; | |
368 } | |
369 gtk_combo_set_popdown_strings( GTK_COMBO( CBVFM ),Items ); | |
370 g_list_free( Items ); | |
371 if ( name ) gtk_entry_set_text( GTK_ENTRY( EVFM ),name ); | |
372 } | |
373 | |
374 { | |
375 int i; | |
376 GList * Items = NULL; | |
377 char * name = NULL; | |
378 | |
379 Items=g_list_append( Items,MSGTR_PREFERENCES_None ); | |
380 for( i=0;mpcodecs_ad_drivers[i];i++ ) | |
381 { | |
382 Items=g_list_append( Items,(char *)mpcodecs_ad_drivers[i]->info->name ); | |
383 if ( audio_fm_list && !gstrcmp( audio_fm_list[0],(char *)mpcodecs_ad_drivers[i]->info->short_name ) ) name=(char *)mpcodecs_ad_drivers[i]->info->name; | |
384 } | |
385 gtk_combo_set_popdown_strings( GTK_COMBO( CBAFM ),Items ); | |
386 g_list_free( Items ); | |
387 if ( name ) gtk_entry_set_text( GTK_ENTRY( EAFM ),name ); | |
388 } | |
389 | |
390 // --- 6. page | |
391 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBPostprocess ),gtkVfPP ); | |
392 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBLoadFullscreen ),gtkLoadFullscreen ); | |
393 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBSaveWinPos ),gui_save_pos ); | |
394 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBShowVideoWindow ),gtkShowVideoWindow ); | |
395 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBStopXScreenSaver ),stop_xscreensaver ); | |
396 gtk_adjustment_set_value( HSPPQualityadj,auto_quality ); | |
397 | |
398 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBPlayBar ),gtkEnablePlayBar ); | |
399 if ( !guiApp.playbarIsPresent ) | |
400 { | |
401 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBPlayBar ),0 ); | |
402 gtk_widget_set_sensitive( CBPlayBar,FALSE ); | |
403 } | |
404 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBNoIdle ),!player_idle_mode ); | |
405 | |
406 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBCache ),0 ); | |
407 gtk_adjustment_set_value( SBCacheadj,(float)gtkCacheSize ); | |
408 if ( !gtkCacheOn ) gtk_widget_set_sensitive( SBCache,FALSE ); | |
409 else gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBCache ),TRUE ); | |
410 | |
411 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBAutoSync ),0 ); | |
412 gtk_adjustment_set_value( SBAutoSyncadj,(float)gtkAutoSync ); | |
413 if ( !gtkAutoSyncOn ) gtk_widget_set_sensitive( SBAutoSync,FALSE ); | |
414 else gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBAutoSync ),TRUE ); | |
415 | |
416 if ( dvd_device ) gtk_entry_set_text( GTK_ENTRY( prEDVDDevice ),dvd_device ); | |
417 else gtk_entry_set_text( GTK_ENTRY( prEDVDDevice ),DEFAULT_DVD_DEVICE ); | |
418 if ( cdrom_device ) gtk_entry_set_text( GTK_ENTRY( prECDRomDevice ),cdrom_device ); | |
419 else gtk_entry_set_text( GTK_ENTRY( prECDRomDevice ),DEFAULT_CDROM_DEVICE ); | |
420 | |
421 // -- disables | |
422 #ifndef CONFIG_ASS | |
423 gtk_widget_set_sensitive( CBUseASS,FALSE ); | |
424 gtk_widget_set_sensitive( CBASSUseMargins,FALSE ); | |
425 gtk_widget_set_sensitive( SBASSTopMargin,FALSE ); | |
426 gtk_widget_set_sensitive( SBASSBottomMargin,FALSE ); | |
427 #endif | |
428 | |
429 // -- signals | |
430 gtk_signal_connect( GTK_OBJECT( CBExtraStereo ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)0 ); | |
431 gtk_signal_connect( GTK_OBJECT( CBNormalize ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)1 ); | |
432 gtk_signal_connect( GTK_OBJECT( CBSoftwareMixer ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)1 ); | |
433 gtk_signal_connect( GTK_OBJECT( CBAudioEqualizer ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)2 ); | |
434 gtk_signal_connect( GTK_OBJECT( CBShowVideoWindow ),"toggled",GTK_SIGNAL_FUNC( prToggled ), (void*)3 ); | |
435 #ifdef CONFIG_FREETYPE | |
436 gtk_signal_connect( GTK_OBJECT( RBFontNoAutoScale ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)4 ); | |
437 gtk_signal_connect( GTK_OBJECT( RBFontAutoScaleHeight ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)5 ); | |
438 gtk_signal_connect( GTK_OBJECT( RBFontAutoScaleWidth ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)6 ); | |
439 gtk_signal_connect( GTK_OBJECT( RBFontAutoScaleDiagonal ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)7 ); | |
440 #endif | |
441 gtk_signal_connect( GTK_OBJECT( CBCache ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)8); | |
442 gtk_signal_connect( GTK_OBJECT( CBAutoSync ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)9); | |
443 #ifdef CONFIG_ASS | |
444 gtk_signal_connect( GTK_OBJECT( CBUseASS ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)10); | |
445 #endif | |
446 | |
447 gtk_signal_connect( GTK_OBJECT( HSExtraStereoMul ),"motion_notify_event",GTK_SIGNAL_FUNC( prHScaler ),(void*)0 ); | |
448 gtk_signal_connect( GTK_OBJECT( HSAudioDelay ),"motion_notify_event",GTK_SIGNAL_FUNC( prHScaler ),(void*)1 ); | |
449 gtk_signal_connect( GTK_OBJECT( HSPanscan ),"motion_notify_event",GTK_SIGNAL_FUNC( prHScaler ),(void*)2 ); | |
450 gtk_signal_connect( GTK_OBJECT( HSSubDelay ),"motion_notify_event",GTK_SIGNAL_FUNC( prHScaler ),(void*)3 ); | |
451 gtk_signal_connect( GTK_OBJECT( HSSubPosition ),"motion_notify_event",GTK_SIGNAL_FUNC( prHScaler ),(void*)4 ); | |
452 #ifndef CONFIG_FREETYPE | |
453 gtk_signal_connect( GTK_OBJECT( HSFontFactor ),"motion_notify_event",GTK_SIGNAL_FUNC( prHScaler ),(void*)5 ); | |
454 #else | |
455 gtk_signal_connect( GTK_OBJECT( HSFontBlur ),"motion_notify_event",GTK_SIGNAL_FUNC( prHScaler ),(void*)6 ); | |
456 gtk_signal_connect( GTK_OBJECT( HSFontOutLine ),"motion_notify_event",GTK_SIGNAL_FUNC( prHScaler ),(void*)7 ); | |
457 gtk_signal_connect( GTK_OBJECT( HSFontTextScale ),"motion_notify_event",GTK_SIGNAL_FUNC( prHScaler ),(void*)8 ); | |
458 gtk_signal_connect( GTK_OBJECT( HSFontOSDScale ),"motion_notify_event",GTK_SIGNAL_FUNC( prHScaler ),(void*)9 ); | |
459 gtk_signal_connect( GTK_OBJECT( EFontEncoding ),"changed",GTK_SIGNAL_FUNC( prEntry ),(void *)0 ); | |
460 #endif | |
461 #ifdef CONFIG_ICONV | |
462 gtk_signal_connect( GTK_OBJECT( ESubEncoding ),"changed",GTK_SIGNAL_FUNC( prEntry ),(void *)1 ); | |
463 #endif | |
464 gtk_signal_connect( GTK_OBJECT( HSPPQuality ),"motion_notify_event",GTK_SIGNAL_FUNC( prHScaler ),(void*)10 ); | |
465 | |
466 gtk_signal_connect( GTK_OBJECT( CLADrivers ),"select_row",GTK_SIGNAL_FUNC( prCListRow ),(void*)0 ); | |
467 gtk_signal_connect( GTK_OBJECT( CLVDrivers ),"select_row",GTK_SIGNAL_FUNC( prCListRow ),(void*)1 ); | |
468 | |
469 gtk_widget_show( Preferences ); | |
470 gtkSetLayer( Preferences ); | |
471 { | |
472 static int visible = 1; | |
473 if ( visible ) | |
474 { | |
475 gtkMessageBox( GTK_MB_WARNING,MSGTR_PREFERENCES_Message ); | |
476 visible=0; | |
477 } | |
478 } | |
479 } | |
480 | |
481 static void HidePreferences( void ) | |
482 { | |
483 if ( !Preferences ) return; | |
484 gtk_widget_hide( Preferences ); | |
485 gtk_widget_destroy( Preferences ); | |
486 Preferences=NULL; | |
487 HideAudioConfig(); | |
488 #ifdef CONFIG_DXR3 | |
489 HideDXR3Config(); | |
490 #endif | |
491 } | |
492 | |
493 #if defined(CONFIG_FREETYPE) || defined(CONFIG_ICONV) | |
494 static void prEntry( GtkContainer * container,gpointer user_data ) | |
495 { | |
496 const char * comment; | |
497 int i; | |
498 | |
499 switch( (int)user_data ) | |
500 { | |
501 #ifdef CONFIG_FREETYPE | |
502 case 0: // font encoding | |
503 comment=gtk_entry_get_text( GTK_ENTRY( EFontEncoding ) ); | |
504 for ( i=0;lEncoding[i].name;i++ ) | |
505 if ( !gstrcmp( lEncoding[i].comment,comment ) ) break; | |
33766 | 506 if ( lEncoding[i].comment ) mplayer( MPLAYER_SET_FONT_ENCODING,0,lEncoding[i].name ); |
33572 | 507 break; |
508 #endif | |
509 #ifdef CONFIG_ICONV | |
510 case 1: // sub encoding | |
511 comment=gtk_entry_get_text( GTK_ENTRY( ESubEncoding ) ); | |
512 for ( i=0;lEncoding[i].name;i++ ) | |
513 if ( !gstrcmp( lEncoding[i].comment,comment ) ) break; | |
33766 | 514 if ( lEncoding[i].comment ) mplayer( MPLAYER_SET_SUB_ENCODING,0,lEncoding[i].name ); |
515 else mplayer( MPLAYER_SET_SUB_ENCODING,0,NULL ); | |
33572 | 516 break; |
517 #endif | |
518 } | |
519 } | |
520 #endif | |
521 | |
522 #define bAConfig 0 | |
523 #define bVconfig 1 | |
524 #define bOk 2 | |
525 #define bCancel 3 | |
526 #define bLSubtitle 4 | |
527 #define bLFont 5 | |
528 | |
529 static void prButton( GtkButton * button, gpointer user_data ) | |
530 { | |
531 switch ( (int)user_data ) | |
532 { | |
533 case bOk: | |
534 // -- 1. page | |
535 gtkEnableAudioEqualizer=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBAudioEqualizer ) ); | |
536 gtkAOExtraStereo=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBExtraStereo ) ); | |
537 gtkAONorm=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBNormalize ) ); | |
538 soft_vol=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBSoftwareMixer ) ); | |
33769 | 539 mplayer( MPLAYER_SET_EXTRA_STEREO,HSExtraStereoMuladj->value,0 ); |
33572 | 540 audio_delay=HSAudioDelayadj->value; |
541 | |
542 gaddlist( &audio_driver_list,ao_driver[0] ); | |
543 gaddlist( &video_driver_list,vo_driver[0] ); | |
544 | |
545 // -- 2. page | |
546 vo_doublebuffering=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBDoubleBuffer ) ); | |
547 vo_directrendering=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBDR ) ); | |
548 | |
549 frame_dropping=0; | |
550 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBFramedrop ) ) == TRUE ) frame_dropping=1; | |
551 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBHFramedrop ) ) == TRUE ) frame_dropping=2; | |
552 | |
553 flip=-1; | |
554 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBFlip ) ) ) flip=1; | |
555 | |
556 force_fps=HSFPSadj->value; | |
557 | |
558 // -- 3. page | |
559 suboverlap_enabled=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBSubOverlap ) ); | |
560 sub_auto=!gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBNoAutoSub ) ); | |
561 gtkSubDumpMPSub=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBDumpMPSub ) ); | |
562 gtkSubDumpSrt=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBDumpSrt ) ); | |
563 sub_unicode=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBSubUnicode ) ); | |
564 #ifdef CONFIG_ASS | |
565 gtkASS.enabled=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBUseASS ) ); | |
566 gtkASS.use_margins=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBASSUseMargins ) ); | |
567 gtkASS.top_margin=gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( SBASSTopMargin ) ); | |
568 gtkASS.bottom_margin=gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( SBASSBottomMargin ) ); | |
569 #endif | |
570 sub_delay=HSSubDelayadj->value; | |
571 sub_fps=HSSubFPSadj->value; | |
572 sub_pos=(int)HSSubPositionadj->value; | |
573 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBOSDNone ) ) ) osd_level=0; | |
574 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBOSDIndicator ) ) ) osd_level=1; | |
575 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBOSDTandP ) ) ) osd_level=2; | |
576 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBOSDTPTT ) ) ) osd_level=3; | |
577 | |
578 | |
579 // --- 4. page | |
33740
2c02269701bd
Remove macros guiSetFilename() and guiSetDF() from interface.h.
ib
parents:
33739
diff
changeset
|
580 setdup( &font_name,gtk_entry_get_text( GTK_ENTRY( prEFontName ) ) ); |
33572 | 581 #ifndef CONFIG_FREETYPE |
33769 | 582 mplayer( MPLAYER_SET_FONT_FACTOR,HSFontFactoradj->value,0 ); |
33572 | 583 #else |
33769 | 584 mplayer( MPLAYER_SET_FONT_BLUR,HSFontBluradj->value,0 ); |
585 mplayer( MPLAYER_SET_FONT_OUTLINE,HSFontOutLineadj->value,0 ); | |
586 mplayer( MPLAYER_SET_FONT_TEXTSCALE,HSFontTextScaleadj->value,0 ); | |
587 mplayer( MPLAYER_SET_FONT_OSDSCALE,HSFontOSDScaleadj->value,0 ); | |
588 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBFontNoAutoScale ) ) ) mplayer( MPLAYER_SET_FONT_AUTOSCALE,0,0 ); | |
589 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBFontAutoScaleHeight ) ) ) mplayer( MPLAYER_SET_FONT_AUTOSCALE,1,0 ); | |
590 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBFontAutoScaleWidth ) ) ) mplayer( MPLAYER_SET_FONT_AUTOSCALE,2,0 ); | |
591 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBFontAutoScaleDiagonal ) ) ) mplayer( MPLAYER_SET_FONT_AUTOSCALE,3,0 ); | |
33572 | 592 #endif |
593 | |
594 // -- 5. page | |
595 force_ni=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBNonInterlaved ) ); | |
596 index_mode=-1; | |
597 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBIndex ) ) ) index_mode=1; | |
598 | |
599 { | |
600 int i; | |
601 const char * tmp = gtk_entry_get_text( GTK_ENTRY( EVFM ) ); | |
602 for( i=0;mpcodecs_vd_drivers[i];i++ ) | |
603 if ( !gstrcmp( tmp,(char *)mpcodecs_vd_drivers[i]->info->name ) ) | |
604 { gaddlist( &video_fm_list,(char *)mpcodecs_vd_drivers[i]->info->short_name ); break; } | |
605 } | |
606 | |
607 { | |
608 int i; | |
609 const char * tmp = gtk_entry_get_text( GTK_ENTRY( EAFM ) ); | |
610 for( i=0;mpcodecs_ad_drivers[i];i++ ) | |
611 if ( !gstrcmp( tmp,(char *)mpcodecs_ad_drivers[i]->info->name ) ) | |
612 { gaddlist( &audio_fm_list,(char *)mpcodecs_ad_drivers[i]->info->short_name ); break; } | |
613 } | |
614 | |
615 // --- 6. page | |
616 gtkVfPP=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBPostprocess ) ); | |
617 gtkLoadFullscreen=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBLoadFullscreen ) ); | |
618 gui_save_pos=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBSaveWinPos ) ); | |
619 gtkShowVideoWindow=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBShowVideoWindow ) ); | |
620 stop_xscreensaver=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBStopXScreenSaver ) ); | |
621 gtkEnablePlayBar=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBPlayBar ) ); | |
622 player_idle_mode=!gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBNoIdle ) ); | |
33769 | 623 mplayer( MPLAYER_SET_AUTO_QUALITY,HSPPQualityadj->value,0 ); |
33572 | 624 |
625 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBCache ) ) ) { gtkCacheSize=(int)SBCacheadj->value; gtkCacheOn=1; } | |
626 else gtkCacheOn=0; | |
627 | |
628 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBAutoSync ) ) ) { gtkAutoSync=(int)SBAutoSyncadj->value; gtkAutoSyncOn=1; } | |
629 else gtkAutoSyncOn=0; | |
630 | |
33740
2c02269701bd
Remove macros guiSetFilename() and guiSetDF() from interface.h.
ib
parents:
33739
diff
changeset
|
631 setdup( &dvd_device,gtk_entry_get_text( GTK_ENTRY( prEDVDDevice ) ) ); |
2c02269701bd
Remove macros guiSetFilename() and guiSetDF() from interface.h.
ib
parents:
33739
diff
changeset
|
632 setdup( &cdrom_device,gtk_entry_get_text( GTK_ENTRY( prECDRomDevice ) ) ); |
33572 | 633 |
634 case bCancel: | |
635 HidePreferences(); | |
636 break; | |
637 case bAConfig: | |
638 if ( !ao_driver[0] ) break; | |
639 gtk_widget_set_sensitive( AConfig,FALSE ); | |
640 if ( !strncmp( ao_driver[0],"oss",3 ) || | |
641 !strncmp( ao_driver[0],"alsa",4 ) || | |
642 !strncmp( ao_driver[0],"esd",3 ) || | |
643 !strncmp( ao_driver[0],"sdl",3 ) ) { | |
644 ShowAudioConfig(); | |
645 gtk_widget_set_sensitive( AConfig,TRUE ); | |
646 } | |
647 break; | |
648 case bVconfig: | |
649 if ( !vo_driver[0] ) break; | |
650 gtk_widget_set_sensitive( VConfig,FALSE ); | |
651 #ifdef CONFIG_DXR3 | |
652 if ( !gstrcmp( vo_driver[0],"dxr3" ) ) { ShowDXR3Config(); gtk_widget_set_sensitive( VConfig,TRUE ); } | |
653 #endif | |
654 break; | |
655 #if 0 | |
656 case bLSubtitle: | |
657 break; | |
658 #endif | |
659 case bLFont: | |
660 ShowFileSelect( fsFontSelector,FALSE ); | |
661 gtkSetLayer( fsFileSelect ); | |
662 break; | |
663 } | |
664 } | |
665 | |
666 static gboolean prHScaler( GtkWidget * widget,GdkEventMotion * event,gpointer user_data ) | |
667 { | |
668 switch ( (int)user_data ) | |
669 { | |
670 case 0: // extra stereo coefficient | |
671 if ( !guiInfo.Playing ) break; | |
33769 | 672 mplayer( MPLAYER_SET_EXTRA_STEREO,HSExtraStereoMuladj->value,0 ); |
33572 | 673 break; |
674 case 1: // audio delay | |
675 audio_delay=HSAudioDelayadj->value; | |
676 break; | |
677 case 2: // panscan | |
33769 | 678 mplayer( MPLAYER_SET_PANSCAN,HSPanscanadj->value,0 ); |
33572 | 679 break; |
680 case 3: // sub delay | |
681 sub_delay=HSSubDelayadj->value; | |
682 break; | |
683 case 4: // sub position | |
684 sub_pos=(int)HSSubPositionadj->value; | |
685 break; | |
686 #ifndef CONFIG_FREETYPE | |
687 case 5: // font factor | |
33769 | 688 mplayer( MPLAYER_SET_FONT_FACTOR,HSFontFactoradj->value,0 ); |
33572 | 689 break; |
690 #else | |
691 case 6: // font blur | |
33769 | 692 mplayer( MPLAYER_SET_FONT_BLUR,HSFontBluradj->value,0 ); |
33572 | 693 break; |
694 case 7: // font outline | |
33769 | 695 mplayer( MPLAYER_SET_FONT_OUTLINE,HSFontOutLineadj->value,0 ); |
33572 | 696 break; |
697 case 8: // text scale | |
33769 | 698 mplayer( MPLAYER_SET_FONT_TEXTSCALE,HSFontTextScaleadj->value,0 ); |
33572 | 699 break; |
700 case 9: // osd scale | |
33769 | 701 mplayer( MPLAYER_SET_FONT_OSDSCALE,HSFontOSDScaleadj->value,0 ); |
33572 | 702 break; |
703 #endif | |
704 case 10: // auto quality | |
33769 | 705 mplayer( MPLAYER_SET_AUTO_QUALITY,HSPPQualityadj->value,0 ); |
33572 | 706 break; |
707 } | |
708 return FALSE; | |
709 } | |
710 | |
711 static void prToggled( GtkToggleButton * togglebutton,gpointer user_data ) | |
712 { | |
713 int window; | |
714 switch ( (int)user_data ) | |
715 { | |
716 case 0: // extra stereo coefficient | |
717 if ( guiInfo.Playing ) | |
718 gtk_widget_set_sensitive( HSExtraStereoMul,gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBExtraStereo ) ) ); | |
719 break; | |
720 // case 1: // normalize | |
721 // case 2: // equalizer | |
722 // if ( guiInfo.Playing ) gtkMessageBox( GTK_MB_WARNING,"Please remember, this function need restart the playing." ); | |
723 // break; | |
724 case 3: | |
725 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBShowVideoWindow ) ) ) | |
726 { | |
727 window=wsShowWindow; | |
728 gtkActive( Preferences ); | |
729 } else window=wsHideWindow; | |
33941
8beec562ce0e
Remove dependency between gtkShowVideoWindow and gtkLoadFullscreen
ib
parents:
33938
diff
changeset
|
730 // NOTE TO MYSELF: doesn't work with a fullscreen window |
33572 | 731 if ( !guiInfo.Playing ) wsVisibleWindow( &guiApp.subWindow,window ); |
732 break; | |
733 case 4: | |
734 case 5: | |
735 case 6: | |
736 case 7: | |
33769 | 737 mplayer( MPLAYER_SET_FONT_AUTOSCALE,(int)user_data - 4,0 ); |
33572 | 738 break; |
739 case 8: | |
740 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBCache ) ) ) gtk_widget_set_sensitive( SBCache,TRUE ); | |
741 else gtk_widget_set_sensitive( SBCache,FALSE ); | |
742 break; | |
743 case 9: | |
744 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBAutoSync ) ) ) gtk_widget_set_sensitive( SBAutoSync,TRUE ); | |
745 else gtk_widget_set_sensitive( SBAutoSync,FALSE ); | |
746 break; | |
747 #ifdef CONFIG_ASS | |
748 case 10: | |
749 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBUseASS ) ) ) | |
750 { | |
751 gtk_widget_set_sensitive( CBASSUseMargins,TRUE ); | |
752 gtk_widget_set_sensitive( SBASSTopMargin,TRUE ); | |
753 gtk_widget_set_sensitive( SBASSBottomMargin,TRUE ); | |
754 } | |
755 else | |
756 { | |
757 gtk_widget_set_sensitive( CBASSUseMargins,FALSE ); | |
758 gtk_widget_set_sensitive( SBASSTopMargin,FALSE ); | |
759 gtk_widget_set_sensitive( SBASSBottomMargin,FALSE ); | |
760 } | |
761 break; | |
762 #endif | |
763 } | |
764 } | |
765 | |
766 static void prCListRow( GtkCList * clist,gint row,gint column,GdkEvent * event,gpointer user_data ) | |
767 { | |
768 switch ( (int)user_data ) | |
769 { | |
770 case 0: // audio driver | |
771 gtk_clist_get_text( GTK_CLIST( CLADrivers ),row,0,(char **)&ao_driver ); | |
772 gtk_widget_set_sensitive( AConfig,FALSE ); | |
773 if ( !strncmp( ao_driver[0],"oss",3 ) || | |
774 !strncmp( ao_driver[0],"alsa",4 ) || | |
775 !strncmp( ao_driver[0],"esd",3 ) || | |
776 !strncmp( ao_driver[0],"sdl",3 ) ) | |
777 gtk_widget_set_sensitive( AConfig,TRUE ); | |
778 #ifndef CONFIG_GTK2 | |
779 if ( !strncmp( ao_driver[0],"arts",4 ) ) | |
780 gtkMessageBox(GTK_MB_WARNING|GTK_MB_SIMPLE, MSGTR_PREFERENCES_ArtsBroken); | |
781 #endif | |
782 break; | |
783 case 1: // video driver | |
784 gtk_clist_get_text( GTK_CLIST( CLVDrivers ),row,0,(char **)&vo_driver ); | |
785 gtk_widget_set_sensitive( VConfig,FALSE ); | |
786 #ifdef CONFIG_DXR3 | |
787 if ( !gstrcmp( vo_driver[0],"dxr3" ) ) gtk_widget_set_sensitive( VConfig,TRUE ); | |
788 #endif | |
789 break; | |
790 } | |
791 } | |
792 | |
793 GtkWidget * create_Preferences( void ) | |
794 { | |
795 GtkWidget * label; | |
796 GtkWidget * frame; | |
797 | |
798 GtkWidget * vbox1; | |
799 GtkWidget * notebook1; | |
800 GtkWidget * hbox1; | |
801 GtkWidget * vbox2; | |
802 GtkWidget * scrolledwindow3; | |
803 GtkWidget * vbox3; | |
804 GtkWidget * hbox8; | |
805 GtkWidget * hbox2; | |
806 GtkWidget * vbox4; | |
807 GtkWidget * scrolledwindow2; | |
808 GtkWidget * hbuttonbox3; | |
809 GtkWidget * vbox5; | |
810 GtkWidget * vbox6; | |
811 GtkWidget * vbox600; | |
812 GSList * OSD_group = NULL; | |
813 #ifdef CONFIG_ICONV | |
814 GSList * Font_group = NULL; | |
815 GList * CBFontEncoding_items = NULL; | |
816 GList * CBSubEncoding_items = NULL; | |
817 #endif | |
818 GtkWidget * vbox7; | |
819 GtkWidget * vbox8; | |
820 GtkWidget * table1; | |
821 GtkWidget * vbox9; | |
822 GtkWidget * vbox603; | |
823 GtkWidget * hbox6; | |
824 GtkWidget * hbuttonbox5; | |
825 #ifndef CONFIG_FREETYPE | |
826 GtkWidget * hbox7; | |
827 #endif | |
828 GtkWidget * vbox601; | |
829 GtkWidget * vbox602; | |
830 GtkWidget * hbox5; | |
831 GtkWidget * hbuttonbox1; | |
832 GtkAccelGroup * accel_group; | |
833 | |
834 GtkWidget * hbox9; | |
835 GtkWidget * hbox91; | |
836 GtkWidget * hbox92; | |
837 | |
838 accel_group=gtk_accel_group_new(); | |
839 | |
840 Preferences=gtk_window_new( GTK_WINDOW_TOPLEVEL ); | |
841 gtk_widget_set_name( Preferences,"Preferences" ); | |
842 gtk_object_set_data( GTK_OBJECT( Preferences ),"Preferences",Preferences ); | |
843 gtk_window_set_title( GTK_WINDOW( Preferences ),MSGTR_Preferences ); | |
844 gtk_window_set_position( GTK_WINDOW( Preferences ),GTK_WIN_POS_CENTER ); | |
845 // gtk_window_set_policy( GTK_WINDOW( Preferences ),FALSE,FALSE,FALSE ); | |
846 gtk_window_set_wmclass( GTK_WINDOW( Preferences ),"Preferences","MPlayer" ); | |
847 | |
848 gtk_widget_realize( Preferences ); | |
849 gtkAddIcon( Preferences ); | |
850 | |
851 vbox1=AddVBox( AddDialogFrame( Preferences ),0 ); | |
852 notebook1=gtk_notebook_new(); | |
853 gtk_widget_set_name( notebook1,"notebook1" ); | |
854 gtk_widget_show( notebook1 ); | |
855 gtk_box_pack_start( GTK_BOX( vbox1 ),notebook1,TRUE,TRUE,0 ); | |
856 | |
857 hbox1=AddVBox( notebook1,0 ); | |
858 | |
859 frame=AddFrame( NULL,GTK_SHADOW_ETCHED_OUT,hbox1,1 ); | |
860 frame=AddFrame( NULL,GTK_SHADOW_NONE,frame,1 ); | |
861 | |
862 // --- 1. page | |
863 | |
864 vbox2=AddVBox( frame,0 ); | |
865 | |
866 scrolledwindow3=gtk_scrolled_window_new( NULL,NULL ); | |
867 gtk_widget_set_name( scrolledwindow3,"scrolledwindow3" ); | |
868 gtk_widget_show( scrolledwindow3 ); | |
869 gtk_box_pack_start( GTK_BOX( vbox2 ),scrolledwindow3,TRUE,TRUE,0 ); | |
870 gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scrolledwindow3 ),GTK_POLICY_NEVER,GTK_POLICY_AUTOMATIC ); | |
871 | |
872 CLADrivers=gtk_clist_new( 2 ); | |
873 gtk_widget_set_name( CLADrivers,"CLADrivers" ); | |
874 gtk_widget_show( CLADrivers ); | |
875 gtk_container_add( GTK_CONTAINER( scrolledwindow3 ),CLADrivers ); | |
876 gtk_clist_set_column_width( GTK_CLIST( CLADrivers ),0,50 ); | |
877 gtk_clist_column_titles_show( GTK_CLIST( CLADrivers ) ); | |
878 gtk_clist_set_shadow_type( GTK_CLIST( CLADrivers ),GTK_SHADOW_NONE ); | |
879 gtk_widget_set_usize( CLADrivers,250,-2 ); | |
880 gtk_clist_set_column_widget( GTK_CLIST( CLADrivers ),0, | |
881 AddLabel( MSGTR_PREFERENCES_AvailableDrivers,NULL ) ); | |
882 | |
883 AConfig=AddButton( MSGTR_ConfigDriver, | |
884 AddHButtonBox( vbox2 ) ); | |
885 | |
886 vbox3=AddVBox( | |
887 AddFrame( NULL,GTK_SHADOW_NONE, | |
888 AddFrame( NULL,GTK_SHADOW_ETCHED_OUT,hbox1,0 ),1 ),0 ); | |
889 gtk_widget_set_usize( vbox3,250,-2 ); | |
890 | |
891 CBNormalize=AddCheckButton( MSGTR_PREFERENCES_NormalizeSound,vbox3 ); | |
892 CBAudioEqualizer=AddCheckButton( MSGTR_PREFERENCES_EnableEqualizer,vbox3 ); | |
893 CBSoftwareMixer=AddCheckButton( MSGTR_PREFERENCES_SoftwareMixer,vbox3 ); | |
894 #if 0 | |
895 CBSurround=AddCheckButton( "Enable surround",vbox3 ); | |
896 #endif | |
897 | |
898 AddHSeparator( vbox3 ); | |
899 CBExtraStereo=AddCheckButton( MSGTR_PREFERENCES_ExtraStereo,vbox3 ); | |
900 hbox8=AddHBox( vbox3,1 ); | |
901 label=AddLabel( MSGTR_PREFERENCES_Coefficient,hbox8 ); | |
902 // gtk_misc_set_padding( GTK_MISC( label ),20,0 ); | |
903 HSExtraStereoMuladj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-10,10,0.1,0,0 ) ); | |
904 HSExtraStereoMul=AddHScaler( HSExtraStereoMuladj,hbox8,1 ); | |
905 AddHSeparator( vbox3 ); | |
906 | |
907 hbox8=AddHBox( vbox3,1 ); | |
908 AddLabel( MSGTR_PREFERENCES_AudioDelay,hbox8 ); | |
909 | |
910 HSAudioDelayadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-10,10,0.01,0,0 ) ); | |
911 HSAudioDelay=AddHScaler( HSAudioDelayadj,hbox8,2 ); | |
912 label=AddLabel( MSGTR_PREFERENCES_Audio,NULL ); | |
913 gtk_notebook_set_tab_label( GTK_NOTEBOOK( notebook1 ),gtk_notebook_get_nth_page( GTK_NOTEBOOK( notebook1 ),0 ),label ); | |
914 | |
915 // --- 2. page | |
916 | |
917 hbox2=AddVBox( notebook1,0 ); | |
918 | |
919 vbox4=AddVBox( | |
920 AddFrame( NULL,GTK_SHADOW_NONE, | |
921 AddFrame( NULL,GTK_SHADOW_ETCHED_OUT,hbox2,1 ),1 ),0 ); | |
922 | |
923 scrolledwindow2=gtk_scrolled_window_new( NULL,NULL ); | |
924 gtk_widget_set_name( scrolledwindow2,"scrolledwindow2" ); | |
925 gtk_widget_show( scrolledwindow2 ); | |
926 gtk_box_pack_start( GTK_BOX( vbox4 ),scrolledwindow2,TRUE,TRUE,0 ); | |
927 gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scrolledwindow2 ),GTK_POLICY_NEVER,GTK_POLICY_AUTOMATIC ); | |
928 | |
929 CLVDrivers=gtk_clist_new( 2 ); | |
930 gtk_widget_set_name( CLVDrivers,"CLVDrivers" ); | |
931 gtk_widget_show( CLVDrivers ); | |
932 gtk_container_add( GTK_CONTAINER( scrolledwindow2 ),CLVDrivers ); | |
933 gtk_clist_set_column_width( GTK_CLIST( CLVDrivers ),0,50 ); | |
934 gtk_clist_column_titles_show( GTK_CLIST( CLVDrivers ) ); | |
935 gtk_clist_set_shadow_type( GTK_CLIST( CLVDrivers ),GTK_SHADOW_NONE ); | |
936 gtk_widget_set_usize( CLVDrivers,250,-2 ); | |
937 | |
938 label=AddLabel( MSGTR_PREFERENCES_AvailableDrivers,NULL ); | |
939 gtk_clist_set_column_widget( GTK_CLIST( CLVDrivers ),0,label ); | |
940 | |
941 hbuttonbox3=AddHButtonBox( vbox4 ); | |
942 VConfig=AddButton( MSGTR_ConfigDriver,hbuttonbox3 ); | |
943 | |
944 vbox5=AddVBox( | |
945 AddFrame( NULL,GTK_SHADOW_NONE, | |
946 AddFrame( NULL,GTK_SHADOW_ETCHED_OUT,hbox2,0 ),1 ),0 ); | |
947 gtk_widget_set_usize( vbox5,250,-2 ); | |
948 | |
949 CBDoubleBuffer=AddCheckButton( MSGTR_PREFERENCES_DoubleBuffer,vbox5 ); | |
950 CBDR=AddCheckButton( MSGTR_PREFERENCES_DirectRender,vbox5 ); | |
951 CBFramedrop=AddCheckButton( MSGTR_PREFERENCES_FrameDrop,vbox5 ); | |
952 CBHFramedrop=AddCheckButton( MSGTR_PREFERENCES_HFrameDrop,vbox5 ); | |
953 CBFlip=AddCheckButton( MSGTR_PREFERENCES_Flip,vbox5 ); | |
954 | |
955 table1=gtk_table_new( 3,2,FALSE ); | |
956 gtk_widget_set_name( table1,"table1" ); | |
957 gtk_widget_show( table1 ); | |
958 gtk_box_pack_start( GTK_BOX( vbox5 ),table1,FALSE,FALSE,0 ); | |
959 | |
960 label=AddLabel( MSGTR_PREFERENCES_Panscan,NULL ); | |
961 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
962 | |
963 label=AddLabel( MSGTR_PREFERENCES_FPS,NULL ); | |
964 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
965 | |
966 HSPanscanadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,1,0.001,0,0 ) ); | |
967 HSPanscan=AddHScaler( HSPanscanadj,NULL,1 ); | |
968 gtk_table_attach( GTK_TABLE( table1 ),HSPanscan,1,2,0,1,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
969 | |
970 HSFPSadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,1000,0.001,0,0 ) ); | |
971 HSFPS=gtk_spin_button_new( GTK_ADJUSTMENT( HSFPSadj ),1,3 ); | |
972 gtk_widget_set_name( HSFPS,"HSFPS" ); | |
973 gtk_widget_show( HSFPS ); | |
974 gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( HSFPS ),TRUE ); | |
975 gtk_table_attach( GTK_TABLE( table1 ),HSFPS,1,2,1,2,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
976 | |
977 label=AddLabel( MSGTR_PREFERENCES_Video,NULL ); | |
978 gtk_notebook_set_tab_label( GTK_NOTEBOOK( notebook1 ),gtk_notebook_get_nth_page( GTK_NOTEBOOK( notebook1 ),1 ),label ); | |
979 | |
980 // --- 3. page | |
981 | |
982 vbox6=AddVBox( notebook1,0 ); | |
983 | |
984 vbox600=AddVBox( | |
985 AddFrame( NULL,GTK_SHADOW_NONE, | |
986 AddFrame( MSGTR_PREFERENCES_FRAME_OSD_Level,GTK_SHADOW_ETCHED_OUT,vbox6,0 ),1 ),0 ); | |
987 | |
33778 | 988 RBOSDNone=AddRadioButton( MSGTR_PREFERENCES_OSD_LEVEL0,&OSD_group,vbox600 ); |
989 RBOSDIndicator=AddRadioButton( MSGTR_PREFERENCES_OSD_LEVEL1,&OSD_group,vbox600 ); | |
990 RBOSDTandP=AddRadioButton( MSGTR_PREFERENCES_OSD_LEVEL2,&OSD_group,vbox600 ); | |
991 RBOSDTPTT=AddRadioButton( MSGTR_PREFERENCES_OSD_LEVEL3,&OSD_group,vbox600 ); | |
33572 | 992 |
993 vbox7=AddVBox( | |
994 AddFrame( NULL,GTK_SHADOW_NONE, | |
995 AddFrame( MSGTR_PREFERENCES_FRAME_Subtitle,GTK_SHADOW_ETCHED_OUT,vbox6,0 ),1 ),0 ); | |
996 | |
997 #if 0 | |
998 hbox4=AddHBox( vbox7,1 ); | |
999 | |
1000 AddLabel( MSGTR_PREFERENCES_Subtitle,hbox4 ); | |
1001 | |
1002 ESubtitleName=gtk_entry_new(); | |
1003 gtk_widget_set_name( ESubtitleName,"ESubtitleName" ); | |
1004 gtk_widget_show( ESubtitleName ); | |
1005 gtk_box_pack_start( GTK_BOX( hbox4 ),ESubtitleName,TRUE,TRUE,0 ); | |
1006 | |
1007 hbuttonbox4=AddHButtonBox( hbuttonbox4 ); | |
1008 gtk_container_set_border_width( GTK_CONTAINER( hbuttonbox4 ),3 ); | |
1009 BLoadSubtitle=AddButton( MSGTR_Browse,hbuttonbox4 ); | |
1010 #endif | |
1011 | |
1012 vbox8=AddVBox( vbox7,0 ); | |
1013 | |
1014 table1=gtk_table_new( 3,2,FALSE ); | |
1015 gtk_widget_set_name( table1,"table1" ); | |
1016 gtk_widget_show( table1 ); | |
1017 gtk_box_pack_start( GTK_BOX( vbox8 ),table1,FALSE,FALSE,0 ); | |
1018 | |
1019 label=AddLabel( MSGTR_PREFERENCES_SUB_Delay,NULL ); | |
1020 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1021 | |
1022 label=AddLabel( MSGTR_PREFERENCES_SUB_POS,NULL ); | |
1023 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1024 | |
1025 label=AddLabel( MSGTR_PREFERENCES_SUB_FPS,NULL ); | |
1026 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,2,3,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1027 | |
1028 #ifdef CONFIG_ICONV | |
1029 label=AddLabel( MSGTR_PREFERENCES_FontEncoding,NULL ); | |
1030 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,3,4,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1031 #endif | |
1032 | |
1033 HSSubDelayadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-10.0,10,0.01,0,0 ) ); | |
1034 HSSubDelay=AddHScaler( HSSubDelayadj,NULL,1 ); | |
1035 gtk_table_attach( GTK_TABLE( table1 ),HSSubDelay,1,2,0,1,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1036 | |
1037 HSSubPositionadj=GTK_ADJUSTMENT( gtk_adjustment_new( 100,0,100,1,0,0 ) ); | |
1038 HSSubPosition=AddHScaler( HSSubPositionadj,NULL,0 ); | |
1039 gtk_table_attach( GTK_TABLE( table1 ),HSSubPosition,1,2,1,2,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1040 | |
1041 HSSubFPSadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,100,0.01,0,0 ) ); | |
1042 HSSubFPS=gtk_spin_button_new( GTK_ADJUSTMENT( HSSubFPSadj ),1,3 ); | |
1043 gtk_widget_set_name( HSSubFPS,"HSSubFPS" ); | |
1044 gtk_widget_show( HSSubFPS ); | |
1045 gtk_widget_set_usize( HSSubFPS,60,-1 ); | |
1046 gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( HSSubFPS ),TRUE ); | |
1047 gtk_table_attach( GTK_TABLE( table1 ),HSSubFPS,1,2,2,3,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1048 | |
1049 #ifdef CONFIG_ICONV | |
1050 CBSubEncoding=gtk_combo_new(); | |
1051 gtk_widget_set_name( CBSubEncoding,"CBSubEncoding" ); | |
1052 gtk_widget_show( CBSubEncoding ); | |
1053 gtk_table_attach( GTK_TABLE( table1 ),CBSubEncoding,1,2,3,4,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1054 CBSubEncoding_items=g_list_append( CBSubEncoding_items,MSGTR_PREFERENCES_None ); | |
1055 { | |
1056 int i; | |
1057 for ( i=0;lEncoding[i].name;i++ ) CBSubEncoding_items=g_list_append( CBSubEncoding_items,lEncoding[i].comment ); | |
1058 } | |
1059 gtk_combo_set_popdown_strings( GTK_COMBO( CBSubEncoding ),CBSubEncoding_items ); | |
1060 g_list_free( CBSubEncoding_items ); | |
1061 | |
1062 ESubEncoding=GTK_COMBO( CBSubEncoding )->entry; | |
1063 gtk_widget_set_name( ESubEncoding,"ESubEncoding" ); | |
1064 gtk_entry_set_editable( GTK_ENTRY( ESubEncoding ),FALSE ); | |
1065 gtk_widget_show( ESubEncoding ); | |
1066 #endif | |
1067 | |
1068 vbox9=AddVBox( vbox8,0 ); | |
1069 | |
1070 CBSubOverlap=AddCheckButton( MSGTR_PREFERENCES_SUB_Overlap,vbox9 ); | |
1071 CBNoAutoSub=AddCheckButton( MSGTR_PREFERENCES_SUB_AutoLoad,vbox9 ); | |
1072 CBSubUnicode=AddCheckButton( MSGTR_PREFERENCES_SUB_Unicode,vbox9 ); | |
1073 CBDumpMPSub=AddCheckButton( MSGTR_PREFERENCES_SUB_MPSUB,vbox9 ); | |
1074 CBDumpSrt=AddCheckButton( MSGTR_PREFERENCES_SUB_SRT,vbox9 ); | |
1075 | |
1076 AddHSeparator( vbox9 ); | |
1077 CBUseASS=AddCheckButton( MSGTR_PREFERENCES_SUB_USE_ASS,vbox9 ); | |
1078 hbox9=AddHBox( vbox9,0 ); | |
1079 CBASSUseMargins=AddCheckButton( MSGTR_PREFERENCES_SUB_ASS_USE_MARGINS,hbox9 ); | |
1080 | |
1081 hbox91=gtk_hbox_new( FALSE,0 ); | |
1082 gtk_widget_set_name( hbox91,"hbox91" ); | |
1083 gtk_box_pack_start( GTK_BOX( hbox9 ),hbox91,TRUE,FALSE,0 ); | |
1084 gtk_widget_show( hbox91 ); | |
1085 SBASSTopMargin=AddSpinButton( MSGTR_PREFERENCES_SUB_ASS_TOP_MARGIN, | |
1086 (GtkAdjustment *)gtk_adjustment_new(0,0,512,1,8,0),hbox91 ); | |
1087 | |
1088 hbox92=gtk_hbox_new( FALSE,0 ); | |
1089 gtk_widget_set_name( hbox92,"hbox92" ); | |
1090 gtk_box_pack_start( GTK_BOX( hbox9 ),hbox92,TRUE,FALSE,0 ); | |
1091 gtk_widget_show( hbox92 ); | |
1092 SBASSBottomMargin=AddSpinButton( MSGTR_PREFERENCES_SUB_ASS_BOTTOM_MARGIN, | |
1093 (GtkAdjustment *)gtk_adjustment_new(0,0,512,1,8,0),hbox92 ); | |
1094 | |
1095 label=AddLabel( MSGTR_PREFERENCES_SubtitleOSD,NULL ); | |
1096 gtk_notebook_set_tab_label( GTK_NOTEBOOK( notebook1 ),gtk_notebook_get_nth_page( GTK_NOTEBOOK( notebook1 ),2 ),label ); | |
1097 vbox601=AddVBox( notebook1,0 ); | |
1098 | |
1099 // --- 4. page | |
1100 | |
1101 vbox603=AddVBox( | |
1102 AddFrame( NULL,GTK_SHADOW_NONE, | |
1103 AddFrame( MSGTR_PREFERENCES_FRAME_Font,GTK_SHADOW_ETCHED_OUT,vbox601,0 ),1 ),0 ); | |
1104 | |
1105 hbox6=AddHBox( vbox603,1 ); | |
1106 AddLabel( MSGTR_PREFERENCES_Font,hbox6 ); | |
1107 prEFontName=gtk_entry_new(); | |
1108 gtk_widget_set_name( prEFontName,"prEFontName" ); | |
1109 gtk_widget_show( prEFontName ); | |
1110 gtk_box_pack_start( GTK_BOX( hbox6 ),prEFontName,TRUE,TRUE,0 ); | |
1111 hbuttonbox5=AddHButtonBox( hbox6 ); | |
1112 gtk_container_set_border_width( GTK_CONTAINER( hbuttonbox5 ),3 ); | |
1113 BLoadFont=AddButton( MSGTR_Browse,hbuttonbox5 ); | |
1114 | |
1115 #ifndef CONFIG_FREETYPE | |
1116 hbox7=AddHBox( vbox603,1 ); | |
1117 AddLabel( MSGTR_PREFERENCES_FontFactor,hbox7 ); | |
1118 HSFontFactoradj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,10,0.05,0,0 ) ); | |
1119 HSFontFactor=AddHScaler( HSFontFactoradj,hbox7,2 ); | |
1120 #else | |
1121 | |
1122 RBFontNoAutoScale=AddRadioButton( MSGTR_PREFERENCES_FontNoAutoScale,&Font_group,vbox603 ); | |
1123 RBFontAutoScaleHeight=AddRadioButton( MSGTR_PREFERENCES_FontPropHeight,&Font_group,vbox603 ); | |
1124 RBFontAutoScaleWidth=AddRadioButton( MSGTR_PREFERENCES_FontPropWidth,&Font_group,vbox603 ); | |
1125 RBFontAutoScaleDiagonal=AddRadioButton( MSGTR_PREFERENCES_FontPropDiagonal,&Font_group,vbox603 ); | |
1126 | |
1127 table1=gtk_table_new( 3,2,FALSE ); | |
1128 gtk_widget_set_name( table1,"table1" ); | |
1129 gtk_widget_show( table1 ); | |
1130 gtk_box_pack_start( GTK_BOX( vbox603 ),table1,FALSE,FALSE,0 ); | |
1131 | |
1132 label=AddLabel( MSGTR_PREFERENCES_FontEncoding,NULL ); | |
1133 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1134 | |
1135 CBFontEncoding=gtk_combo_new(); | |
1136 gtk_widget_set_name( CBFontEncoding,"CBFontEncoding" ); | |
1137 gtk_widget_show( CBFontEncoding ); | |
1138 gtk_table_attach( GTK_TABLE( table1 ),CBFontEncoding,1,2,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1139 { | |
1140 int i; | |
1141 for ( i=0;lEncoding[i].name;i++ ) CBFontEncoding_items=g_list_append( CBFontEncoding_items,lEncoding[i].comment ); | |
1142 } | |
1143 gtk_combo_set_popdown_strings( GTK_COMBO( CBFontEncoding ),CBFontEncoding_items ); | |
1144 g_list_free( CBFontEncoding_items ); | |
1145 | |
1146 EFontEncoding=GTK_COMBO( CBFontEncoding )->entry; | |
1147 gtk_widget_set_name( EFontEncoding,"EFontEncoding" ); | |
1148 gtk_entry_set_editable( GTK_ENTRY( EFontEncoding ),FALSE ); | |
1149 gtk_widget_show( EFontEncoding ); | |
1150 | |
1151 label=AddLabel( MSGTR_PREFERENCES_FontBlur,NULL ); | |
1152 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1153 | |
1154 HSFontBluradj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,100,0.1,0,0 ) ); | |
1155 HSFontBlur=AddHScaler( HSFontBluradj,NULL,2 ); | |
1156 gtk_table_attach( GTK_TABLE( table1 ),HSFontBlur,1,2,1,2,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1157 | |
1158 label=AddLabel( MSGTR_PREFERENCES_FontOutLine,NULL ); | |
1159 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,2,3,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1160 | |
1161 HSFontOutLineadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,100,0.1,0,0 ) ); | |
1162 HSFontOutLine=AddHScaler( HSFontOutLineadj,NULL,2 ); | |
1163 gtk_table_attach( GTK_TABLE( table1 ),HSFontOutLine,1,2,2,3,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1164 | |
1165 label=AddLabel( MSGTR_PREFERENCES_FontTextScale,NULL ); | |
1166 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,3,4,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1167 | |
1168 HSFontTextScaleadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,100,0.1,0,0 ) ); | |
1169 HSFontTextScale=AddHScaler( HSFontTextScaleadj,NULL,2 ); | |
1170 gtk_table_attach( GTK_TABLE( table1 ),HSFontTextScale,1,2,3,4,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1171 | |
1172 label=AddLabel( MSGTR_PREFERENCES_FontOSDScale,NULL ); | |
1173 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,4,5,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1174 | |
1175 HSFontOSDScaleadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,100,0.1,0,0 ) ); | |
1176 HSFontOSDScale=AddHScaler( HSFontOSDScaleadj,NULL,2 ); | |
1177 gtk_table_attach( GTK_TABLE( table1 ),HSFontOSDScale,1,2,4,5,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1178 #endif | |
1179 | |
1180 label=AddLabel( MSGTR_PREFERENCES_FRAME_Font,NULL ); | |
1181 gtk_notebook_set_tab_label( GTK_NOTEBOOK( notebook1 ),gtk_notebook_get_nth_page( GTK_NOTEBOOK( notebook1 ),3 ),label ); | |
1182 | |
1183 // --- 5. page | |
1184 | |
1185 vbox601=AddVBox( notebook1,0 ); | |
1186 | |
1187 vbox602=AddVBox( | |
1188 AddFrame( NULL,GTK_SHADOW_NONE, | |
1189 AddFrame( MSGTR_PREFERENCES_FRAME_CodecDemuxer,GTK_SHADOW_ETCHED_OUT,vbox601,0 ),1 ),0 ); | |
1190 | |
1191 CBNonInterlaved=AddCheckButton( MSGTR_PREFERENCES_NI,vbox602 ); | |
1192 CBIndex=AddCheckButton( MSGTR_PREFERENCES_IDX,vbox602 ); | |
1193 | |
1194 hbox5=AddHBox( vbox602,1 ); | |
1195 | |
1196 AddLabel( MSGTR_PREFERENCES_VideoCodecFamily,hbox5 ); | |
1197 | |
1198 CBVFM=gtk_combo_new(); | |
1199 gtk_widget_set_name( CBVFM,"CBVFM" ); | |
1200 gtk_widget_show( CBVFM ); | |
1201 gtk_box_pack_start( GTK_BOX( hbox5 ),CBVFM,TRUE,TRUE,0 ); | |
1202 | |
1203 EVFM=GTK_COMBO( CBVFM )->entry; | |
1204 gtk_widget_set_name( EVFM,"CEVFM" ); | |
1205 gtk_entry_set_editable( GTK_ENTRY( EVFM ),FALSE ); | |
1206 gtk_widget_show( EVFM ); | |
1207 | |
1208 hbox5=AddHBox( vbox602,1 ); | |
1209 | |
1210 AddLabel( MSGTR_PREFERENCES_AudioCodecFamily,hbox5 ); | |
1211 | |
1212 CBAFM=gtk_combo_new(); | |
1213 gtk_widget_set_name( CBAFM,"CBAFM" ); | |
1214 gtk_widget_show( CBAFM ); | |
1215 gtk_box_pack_start( GTK_BOX( hbox5 ),CBAFM,TRUE,TRUE,0 ); | |
1216 | |
1217 EAFM=GTK_COMBO( CBAFM )->entry; | |
1218 gtk_widget_set_name( EAFM,"EAFM" ); | |
1219 gtk_entry_set_editable( GTK_ENTRY( EAFM ),FALSE ); | |
1220 gtk_widget_show( EAFM ); | |
1221 | |
1222 label=AddLabel( MSGTR_PREFERENCES_Codecs,NULL ); | |
1223 gtk_notebook_set_tab_label( GTK_NOTEBOOK( notebook1 ),gtk_notebook_get_nth_page( GTK_NOTEBOOK( notebook1 ),4 ),label ); | |
1224 | |
1225 vbox601=AddVBox( notebook1,0 ); | |
1226 | |
1227 // --- 6. page | |
1228 | |
1229 vbox602=AddVBox( | |
1230 AddFrame( NULL,GTK_SHADOW_NONE, | |
1231 AddFrame( MSGTR_PREFERENCES_FRAME_PostProcess,GTK_SHADOW_ETCHED_OUT,vbox601,0 ),1 ),0 ); | |
1232 | |
1233 CBPostprocess=AddCheckButton( MSGTR_PREFERENCES_PostProcess,vbox602 ); | |
1234 | |
1235 hbox5=AddHBox( vbox602,1 ); | |
1236 | |
1237 AddLabel( MSGTR_PREFERENCES_AutoQuality,hbox5 ); | |
1238 | |
1239 if ( guiInfo.sh_video && guiInfo.Playing ) HSPPQualityadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,get_video_quality_max( guiInfo.sh_video ),0,0,0 ) ); | |
1240 else HSPPQualityadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,100,0,0,0 ) ); | |
1241 HSPPQuality=AddHScaler( HSPPQualityadj,hbox5,0 ); | |
1242 | |
1243 vbox602=AddVBox( | |
1244 AddFrame( NULL,GTK_SHADOW_NONE, | |
1245 AddFrame( MSGTR_PREFERENCES_FRAME_Cache,GTK_SHADOW_ETCHED_OUT,vbox601,0 ),1 ),0 ); | |
1246 | |
1247 CBCache=AddCheckButton( MSGTR_PREFERENCES_Cache,vbox602 ); | |
1248 | |
1249 hbox5=AddHBox( vbox602,1 ); | |
1250 | |
1251 AddLabel( MSGTR_PREFERENCES_CacheSize,hbox5 ); | |
1252 | |
1253 SBCacheadj=GTK_ADJUSTMENT( gtk_adjustment_new( gtkCacheSize,32,1048576,1,32,0 ) ); | |
1254 SBCache=gtk_spin_button_new( GTK_ADJUSTMENT( SBCacheadj ),1,0 ); | |
1255 gtk_widget_show( SBCache ); | |
1256 gtk_box_pack_start( GTK_BOX( hbox5 ),SBCache,TRUE,TRUE,0 ); | |
1257 | |
1258 vbox602=AddVBox( | |
1259 AddFrame( NULL,GTK_SHADOW_NONE, | |
1260 AddFrame( MSGTR_PREFERENCES_FRAME_Misc,GTK_SHADOW_ETCHED_OUT,vbox601,1 ),1 ),0 ); | |
1261 | |
1262 CBShowVideoWindow=AddCheckButton( MSGTR_PREFERENCES_ShowVideoWindow,vbox602 ); | |
1263 CBLoadFullscreen=AddCheckButton( MSGTR_PREFERENCES_LoadFullscreen,vbox602 ); | |
1264 CBSaveWinPos=AddCheckButton( MSGTR_PREFERENCES_SaveWinPos,vbox602 ); | |
1265 CBStopXScreenSaver=AddCheckButton( MSGTR_PREFERENCES_XSCREENSAVER,vbox602 ); | |
1266 CBPlayBar=AddCheckButton( MSGTR_PREFERENCES_PlayBar,vbox602 ); | |
1267 CBNoIdle=AddCheckButton( MSGTR_PREFERENCES_NoIdle,vbox602 ); | |
1268 | |
1269 AddHSeparator( vbox602 ); | |
1270 | |
1271 CBAutoSync=AddCheckButton( MSGTR_PREFERENCES_AutoSync,vbox602 ); | |
1272 hbox5=AddHBox( vbox602,1 ); | |
1273 AddLabel( MSGTR_PREFERENCES_AutoSyncValue,hbox5 ); | |
1274 SBAutoSyncadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,10000,1,10,10 ) ); | |
1275 SBAutoSync=gtk_spin_button_new( GTK_ADJUSTMENT( SBAutoSyncadj ),1,0 ); | |
1276 gtk_widget_show( SBAutoSync ); | |
1277 gtk_box_pack_start( GTK_BOX( hbox5 ),SBAutoSync,TRUE,TRUE,0 ); | |
1278 | |
1279 AddHSeparator( vbox602 ); | |
1280 | |
1281 table1=gtk_table_new( 2,2,FALSE ); | |
1282 gtk_widget_set_name( table1,"table1" ); | |
1283 gtk_widget_show( table1 ); | |
1284 gtk_box_pack_start( GTK_BOX( vbox602 ),table1,FALSE,FALSE,0 ); | |
1285 | |
1286 label=AddLabel( MSGTR_PREFERENCES_DVDDevice,NULL ); | |
1287 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1288 prEDVDDevice=gtk_entry_new(); | |
1289 gtk_widget_set_name( prEDVDDevice,"prEDVDDevice" ); | |
1290 gtk_widget_show( prEDVDDevice ); | |
1291 gtk_table_attach( GTK_TABLE( table1 ),prEDVDDevice,1,2,0,1,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1292 | |
1293 label=AddLabel( MSGTR_PREFERENCES_CDROMDevice,NULL ); | |
1294 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1295 prECDRomDevice=gtk_entry_new(); | |
1296 gtk_widget_set_name( prECDRomDevice,"prECDRomDevice" ); | |
1297 gtk_widget_show( prECDRomDevice ); | |
1298 gtk_table_attach( GTK_TABLE( table1 ),prECDRomDevice,1,2,1,2,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1299 | |
1300 // AddHSeparator( vbox602 ); | |
1301 | |
1302 label=AddLabel( MSGTR_PREFERENCES_Misc,NULL ); | |
1303 gtk_notebook_set_tab_label( GTK_NOTEBOOK( notebook1 ),gtk_notebook_get_nth_page( GTK_NOTEBOOK( notebook1 ),5 ),label ); | |
1304 | |
1305 // --- | |
1306 | |
1307 AddHSeparator( vbox1 ); | |
1308 | |
1309 hbuttonbox1=AddHButtonBox( vbox1 ); | |
1310 gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox1 ),GTK_BUTTONBOX_END ); | |
1311 gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox1 ),10 ); | |
1312 BOk=AddButton( MSGTR_Ok,hbuttonbox1 ); | |
1313 BCancel=AddButton( MSGTR_Cancel,hbuttonbox1 ); | |
1314 | |
1315 gtk_widget_add_accelerator( BOk,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE ); | |
1316 gtk_widget_add_accelerator( BCancel,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE ); | |
1317 | |
1318 gtk_signal_connect( GTK_OBJECT( Preferences ),"destroy",GTK_SIGNAL_FUNC( WidgetDestroy ),&Preferences ); | |
1319 | |
1320 gtk_signal_connect( GTK_OBJECT( AConfig ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void*)bAConfig ); | |
1321 gtk_signal_connect( GTK_OBJECT( BOk ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void*)bOk ); | |
1322 gtk_signal_connect( GTK_OBJECT( BCancel ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void*)bCancel ); | |
1323 gtk_signal_connect( GTK_OBJECT( VConfig ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void*)bVconfig ); | |
1324 #if 0 | |
1325 gtk_signal_connect( GTK_OBJECT( BLoadSubtitle ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void*)bLSubtitle ); | |
1326 #endif | |
1327 gtk_signal_connect( GTK_OBJECT( BLoadFont ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void*)bLFont ); | |
1328 | |
1329 #if 0 | |
1330 gtk_signal_connect( GTK_OBJECT( CBNormalize ),"toggled",GTK_SIGNAL_FUNC( on_CBNormalize_toggled ),NULL ); | |
1331 gtk_signal_connect( GTK_OBJECT( CBSoftwareMixer ),"toggled",GTK_SIGNAL_FUNC( on_CBSoftwareMixer_toggled ),NULL ); | |
1332 gtk_signal_connect( GTK_OBJECT( CBSurround ),"toggled",GTK_SIGNAL_FUNC( on_CBSurround_toggled ),NULL ); | |
1333 gtk_signal_connect( GTK_OBJECT( CBExtraStereo ),"toggled",GTK_SIGNAL_FUNC( on_CBExtraStereo_toggled ),NULL ); | |
1334 gtk_signal_connect( GTK_OBJECT( CBDoubleBuffer ),"toggled",GTK_SIGNAL_FUNC( on_CBDoubleBuffer_toggled ),NULL ); | |
1335 gtk_signal_connect( GTK_OBJECT( CBDR ),"toggled",GTK_SIGNAL_FUNC( on_CBDR_toggled ),NULL ); | |
1336 gtk_signal_connect( GTK_OBJECT( CBFramedrop ),"toggled",GTK_SIGNAL_FUNC( on_CBFramedrop_toggled ),NULL ); | |
1337 gtk_signal_connect( GTK_OBJECT( CBHFramedrop ),"toggled",GTK_SIGNAL_FUNC( on_CBHFramedrop_toggled ),NULL ); | |
1338 gtk_signal_connect( GTK_OBJECT( CBFullScreen ),"toggled",GTK_SIGNAL_FUNC( on_CBFullScreen_toggled ),NULL ); | |
1339 gtk_signal_connect( GTK_OBJECT( CBNonInterlaved ),"toggled",GTK_SIGNAL_FUNC( on_CBNonInterlaved_toggled ),NULL ); | |
1340 gtk_signal_connect( GTK_OBJECT( CBFlip ),"toggled",GTK_SIGNAL_FUNC( on_CBFlip_toggled ),NULL ); | |
1341 gtk_signal_connect( GTK_OBJECT( CBPostprocess ),"toggled",GTK_SIGNAL_FUNC( on_CBPostprocess_toggled ),NULL ); | |
1342 gtk_signal_connect( GTK_OBJECT( CBNoAutoSub ),"toggled",GTK_SIGNAL_FUNC( on_CBNoAutoSub_toggled ),NULL ); | |
1343 gtk_signal_connect( GTK_OBJECT( CBSubUnicode ),"toggled",GTK_SIGNAL_FUNC( on_CNSubUnicode_toggled ),NULL ); | |
1344 gtk_signal_connect( GTK_OBJECT( CBDumpMPSub ),"toggled",GTK_SIGNAL_FUNC( on_CBDumpMPSub_toggled ),NULL ); | |
1345 gtk_signal_connect( GTK_OBJECT( CBDumpSrt ),"toggled",GTK_SIGNAL_FUNC( on_CBDumpSrt_toggled ),NULL ); | |
1346 #endif | |
1347 #if 0 | |
1348 gtk_signal_connect( GTK_OBJECT( RBOSDNone ),"toggled",GTK_SIGNAL_FUNC( on_RBOSDNone_toggled ),NULL ); | |
33777
235c6f2514be
Arrange OSD preferences according to option 'osdlevel'.
ib
parents:
33769
diff
changeset
|
1349 gtk_signal_connect( GTK_OBJECT( RBOSDIndicator ),"toggled",GTK_SIGNAL_FUNC( on_RBOSDIndicator_toggled ),NULL ); |
33572 | 1350 gtk_signal_connect( GTK_OBJECT( RBOSDTandP ),"toggled",GTK_SIGNAL_FUNC( on_RBOSDTandP_toggled ),NULL ); |
1351 gtk_signal_connect( GTK_OBJECT( RBOSDTPTT ),"toggled",GTK_SIGNAL_FUNC( on_RBOSDIndicator_toggled ),NULL ); | |
1352 gtk_signal_connect( GTK_OBJECT( CBAudioEqualizer ),"toggled",GTK_SIGNAL_FUNC( on_CBAudioEqualizer_toggled ),NULL ); | |
1353 #endif | |
1354 #if 0 | |
1355 gtk_signal_connect( GTK_OBJECT( HSAudioDelay ),"motion_notify_event",GTK_SIGNAL_FUNC( on_HSAudioDelay_motion_notify_event ),NULL ); | |
1356 gtk_signal_connect( GTK_OBJECT( HSPanscan ),"motion_notify_event",GTK_SIGNAL_FUNC( on_HSPanscan_motion_notify_event ),NULL ); | |
1357 gtk_signal_connect( GTK_OBJECT( label2 ),"motion_notify_event",GTK_SIGNAL_FUNC( on_label2_motion_notify_event ),NULL ); | |
1358 gtk_signal_connect( GTK_OBJECT( HSSubDelay ),"motion_notify_event",GTK_SIGNAL_FUNC( on_HSSubDelay_motion_notify_event ),NULL ); | |
1359 gtk_signal_connect( GTK_OBJECT( HSSubPosition ),"motion_notify_event",GTK_SIGNAL_FUNC( on_HSSubPosition_motion_notify_event ),NULL ); | |
1360 gtk_signal_connect( GTK_OBJECT( HSSubFPS ),"motion_notify_event",GTK_SIGNAL_FUNC( on_HSSubFPS_motion_notify_event ),NULL ); | |
1361 gtk_signal_connect( GTK_OBJECT( HSFontFactor ),"motion_notify_event",GTK_SIGNAL_FUNC( on_HSFontFactor_motion_notify_event ),NULL ); | |
1362 gtk_signal_connect( GTK_OBJECT( HSPPQuality ),"motion_notify_event",GTK_SIGNAL_FUNC( on_HSPPQuality_motion_notify_event ),NULL ); | |
1363 #endif | |
1364 | |
1365 gtk_notebook_set_page( GTK_NOTEBOOK( notebook1 ),2 ); | |
1366 | |
1367 gtk_window_add_accel_group( GTK_WINDOW( Preferences ),accel_group ); | |
1368 | |
1369 return Preferences; | |
1370 } | |
1371 | |
1372 #ifdef CONFIG_OSS_AUDIO | |
1373 static GList *appendOSSDevices(GList *l) | |
1374 { | |
1375 // careful! the current implementation allows only string constants! | |
1376 l = g_list_append(l, (gpointer)"/dev/dsp"); | |
1377 if (gtkAOOSSDevice && strncmp(gtkAOOSSDevice, "/dev/sound", 10) == 0) { | |
1378 l = g_list_append(l, (gpointer)"/dev/sound/dsp0"); | |
1379 l = g_list_append(l, (gpointer)"/dev/sound/dsp1"); | |
1380 l = g_list_append(l, (gpointer)"/dev/sound/dsp2"); | |
1381 l = g_list_append(l, (gpointer)"/dev/sound/dsp3"); | |
1382 } else { | |
1383 l = g_list_append(l, (gpointer)"/dev/dsp0"); | |
1384 l = g_list_append(l, (gpointer)"/dev/dsp1"); | |
1385 l = g_list_append(l, (gpointer)"/dev/dsp2"); | |
1386 l = g_list_append(l, (gpointer)"/dev/dsp3"); | |
1387 } | |
1388 #ifdef CONFIG_DXR3 | |
1389 l = g_list_append(l, (gpointer)"/dev/em8300_ma"); | |
1390 l = g_list_append(l, (gpointer)"/dev/em8300_ma-0"); | |
1391 l = g_list_append(l, (gpointer)"/dev/em8300_ma-1"); | |
1392 l = g_list_append(l, (gpointer)"/dev/em8300_ma-2"); | |
1393 l = g_list_append(l, (gpointer)"/dev/em8300_ma-3"); | |
1394 #endif | |
1395 return l; | |
1396 } | |
1397 | |
1398 static GList *appendOSSMixers(GList *l) | |
1399 { | |
1400 // careful! the current implementation allows only string constants! | |
1401 l = g_list_append(l, (gpointer)"/dev/mixer"); | |
1402 if (gtkAOOSSMixer && strncmp(gtkAOOSSMixer, "/dev/sound", 10) == 0) { | |
1403 l = g_list_append(l, (gpointer)"/dev/sound/mixer0"); | |
1404 l = g_list_append(l, (gpointer)"/dev/sound/mixer1"); | |
1405 l = g_list_append(l, (gpointer)"/dev/sound/mixer2"); | |
1406 l = g_list_append(l, (gpointer)"/dev/sound/mixer3"); | |
1407 } else { | |
1408 l = g_list_append(l, (gpointer)"/dev/mixer0"); | |
1409 l = g_list_append(l, (gpointer)"/dev/mixer1"); | |
1410 l = g_list_append(l, (gpointer)"/dev/mixer2"); | |
1411 l = g_list_append(l, (gpointer)"/dev/mixer3"); | |
1412 } | |
1413 return l; | |
1414 } | |
1415 | |
1416 static GList *appendOSSMixerChannels(GList *l) | |
1417 { | |
1418 l = g_list_append(l, (gpointer)"vol"); | |
1419 l = g_list_append(l, (gpointer)"pcm"); | |
1420 l = g_list_append(l, (gpointer)"line"); | |
1421 return l; | |
1422 } | |
1423 #endif | |
1424 | |
1425 #ifdef CONFIG_ALSA | |
1426 static GList *appendALSADevices(GList *l) | |
1427 { | |
1428 l = g_list_append(l, (gpointer)"default"); | |
1429 l = g_list_append(l, (gpointer)"hw=0.0"); | |
1430 l = g_list_append(l, (gpointer)"hw=0.1"); | |
1431 l = g_list_append(l, (gpointer)"hw=0.2"); | |
1432 l = g_list_append(l, (gpointer)"surround40"); | |
1433 l = g_list_append(l, (gpointer)"surround51"); | |
1434 l = g_list_append(l, (gpointer)"plug=surround40"); | |
1435 l = g_list_append(l, (gpointer)"plug=surround51"); | |
1436 return l; | |
1437 } | |
1438 | |
1439 static GList *appendALSAMixers(GList *l) | |
1440 { | |
1441 l = g_list_append(l, (gpointer)"default"); | |
1442 return l; | |
1443 } | |
1444 | |
1445 static GList *appendALSAMixerChannels(GList *l) | |
1446 { | |
1447 l = g_list_append(l, (gpointer)"Master"); | |
1448 l = g_list_append(l, (gpointer)"Line"); | |
1449 l = g_list_append(l, (gpointer)"PCM"); | |
1450 l = g_list_append(l, (gpointer)"PCM,1"); | |
1451 return l; | |
1452 } | |
1453 #endif | |
1454 | |
1455 #ifdef CONFIG_SDL | |
1456 static GList *appendSDLDevices(GList *l) | |
1457 { | |
1458 l = g_list_append(l, (gpointer)"alsa"); | |
1459 l = g_list_append(l, (gpointer)"arts"); | |
1460 l = g_list_append(l, (gpointer)"esd"); | |
1461 l = g_list_append(l, (gpointer)"jack"); | |
1462 l = g_list_append(l, (gpointer)"oss"); | |
1463 l = g_list_append(l, (gpointer)"nas"); | |
1464 return l; | |
1465 } | |
1466 #endif | |
1467 | |
1468 #ifdef CONFIG_ESD | |
1469 static GList *appendESDDevices(GList *l) | |
1470 { | |
1471 l = g_list_append(l, (gpointer)"Enter Remote IP"); | |
1472 l = g_list_append(l, (gpointer)"Use Software Mixer"); | |
1473 return l; | |
1474 } | |
1475 #endif | |
1476 | |
1477 // Gets text string from a gtk entry, interpreting | |
1478 // MSGTR_PREFERENCES_DriverDefault as null string. | |
1479 static const char *getGtkEntryText(GtkWidget *from) | |
1480 { | |
1481 const char *tmp = gtk_entry_get_text(GTK_ENTRY(from)); | |
1482 if (strcmp(tmp, MSGTR_PREFERENCES_DriverDefault) == 0) { | |
1483 tmp = NULL; | |
1484 } | |
1485 return tmp; | |
1486 } | |
1487 | |
1488 // Sets text string of a gtk entry, interpreting | |
1489 // null string as MSGTR_PREFERENCES_DriverDefault. | |
1490 static void setGtkEntryText(GtkWidget *dest, char *to) | |
1491 { | |
1492 if (!to) { | |
1493 to = MSGTR_PREFERENCES_DriverDefault; | |
1494 } | |
1495 gtk_entry_set_text(GTK_ENTRY(dest),to); | |
1496 } | |
1497 | |
1498 GtkWidget *AudioConfig; | |
1499 static GtkWidget *CEAudioDevice; | |
1500 static GtkWidget *CBAudioDevice; | |
1501 static GtkWidget *CEAudioMixer; | |
1502 static GtkWidget *CBAudioMixer; | |
1503 static GtkWidget *CEAudioMixerChannel; | |
1504 static GtkWidget *CBAudioMixerChannel; | |
1505 static GtkWidget *BAudioOk; | |
1506 static GtkWidget *BAudioCancel; | |
1507 | |
1508 void ShowAudioConfig( void ) { | |
1509 if (AudioConfig) gtkActive(AudioConfig); | |
1510 else AudioConfig = create_AudioConfig(); | |
1511 | |
1512 #ifdef CONFIG_OSS_AUDIO | |
1513 if (strncmp(ao_driver[0], "oss", 3) == 0) { | |
1514 setGtkEntryText(CEAudioDevice, gtkAOOSSDevice); | |
1515 setGtkEntryText(CEAudioMixer, gtkAOOSSMixer); | |
1516 setGtkEntryText(CEAudioMixerChannel, gtkAOOSSMixerChannel); | |
1517 } | |
1518 #endif | |
1519 #ifdef CONFIG_ALSA | |
1520 if (strncmp(ao_driver[0], "alsa", 4) == 0) { | |
1521 setGtkEntryText(CEAudioDevice, gtkAOALSADevice); | |
1522 setGtkEntryText(CEAudioMixer, gtkAOALSAMixer); | |
1523 setGtkEntryText(CEAudioMixerChannel, gtkAOALSAMixerChannel); | |
1524 } | |
1525 #endif | |
1526 #ifdef CONFIG_SDL | |
1527 if (strncmp(ao_driver[0], "sdl", 3) == 0) { | |
1528 setGtkEntryText(CEAudioDevice, gtkAOSDLDriver); | |
1529 } | |
1530 #endif | |
1531 #ifdef CONFIG_ESD | |
1532 if (strncmp(ao_driver[0], "esd", 3) == 0) { | |
1533 setGtkEntryText(CEAudioDevice, gtkAOESDDevice); | |
1534 } | |
1535 #endif | |
1536 | |
1537 gtk_widget_show(AudioConfig); | |
1538 gtkSetLayer(AudioConfig); | |
1539 } | |
1540 | |
1541 void HideAudioConfig( void ) { | |
1542 if (!AudioConfig) return; | |
1543 gtk_widget_hide(AudioConfig); | |
1544 gtk_widget_destroy(AudioConfig); | |
1545 AudioConfig=NULL; | |
1546 } | |
1547 | |
1548 static void audioButton(GtkButton *button, gpointer user_data) { | |
1549 switch( (int)user_data ) { | |
1550 case 1: | |
1551 #ifdef CONFIG_OSS_AUDIO | |
1552 if (strncmp(ao_driver[0], "oss", 3) == 0) { | |
33739 | 1553 nfree(gtkAOOSSDevice); |
33572 | 1554 gtkAOOSSDevice = gstrdup(getGtkEntryText(CEAudioDevice)); |
33739 | 1555 nfree(gtkAOOSSMixer); |
33572 | 1556 gtkAOOSSMixer = gstrdup(getGtkEntryText(CEAudioMixer)); |
33739 | 1557 nfree(gtkAOOSSMixerChannel); |
33572 | 1558 gtkAOOSSMixerChannel = gstrdup(getGtkEntryText(CEAudioMixerChannel)); |
1559 } | |
1560 #endif | |
1561 #ifdef CONFIG_ALSA | |
1562 if (strncmp(ao_driver[0], "alsa", 4) == 0) { | |
33739 | 1563 nfree(gtkAOALSADevice); |
33572 | 1564 gtkAOALSADevice = gstrdup(getGtkEntryText(CEAudioDevice)); |
33739 | 1565 nfree(gtkAOALSAMixer); |
33572 | 1566 gtkAOALSAMixer = gstrdup(getGtkEntryText(CEAudioMixer)); |
33739 | 1567 nfree(gtkAOALSAMixerChannel); |
33572 | 1568 gtkAOALSAMixerChannel = gstrdup(getGtkEntryText(CEAudioMixerChannel)); |
1569 } | |
1570 #endif | |
1571 #ifdef CONFIG_SDL | |
1572 if (strncmp(ao_driver[0], "sdl", 3) == 0) { | |
33739 | 1573 nfree(gtkAOSDLDriver); |
33572 | 1574 gtkAOSDLDriver = gstrdup(getGtkEntryText(CEAudioDevice)); |
1575 } | |
1576 #endif | |
1577 #ifdef CONFIG_ESD | |
1578 if (strncmp(ao_driver[0], "esd", 3) == 0) { | |
33739 | 1579 nfree(gtkAOESDDevice); |
33572 | 1580 gtkAOESDDevice = gstrdup(getGtkEntryText(CEAudioDevice)); |
1581 } | |
1582 #endif | |
1583 case 0: | |
1584 HideAudioConfig(); | |
1585 break; | |
1586 } | |
1587 } | |
1588 | |
1589 GtkWidget *create_AudioConfig( void ) { | |
1590 GList *items = NULL; | |
1591 GtkWidget *vbox; | |
1592 GtkWidget *table; | |
1593 GtkWidget *label; | |
1594 GtkWidget *hbuttonbox; | |
1595 GtkAccelGroup *accel_group; | |
1596 | |
1597 AudioConfig = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
1598 gtk_widget_set_name(AudioConfig, "AudioConfig"); | |
1599 gtk_object_set_data(GTK_OBJECT(AudioConfig), "AudioConfig", AudioConfig); | |
1600 gtk_window_set_title(GTK_WINDOW(AudioConfig), MSGTR_AudioPreferences); | |
1601 gtk_window_set_position(GTK_WINDOW(AudioConfig), GTK_WIN_POS_CENTER); | |
1602 gtk_window_set_policy(GTK_WINDOW(AudioConfig), FALSE, FALSE, FALSE); | |
1603 gtk_window_set_wmclass(GTK_WINDOW(AudioConfig), "Audio Config", "MPlayer"); | |
1604 | |
1605 gtk_widget_realize(AudioConfig); | |
1606 gtkAddIcon(AudioConfig); | |
1607 | |
1608 vbox = AddVBox(AddDialogFrame(AudioConfig), 0); | |
1609 | |
1610 table = gtk_table_new(2, 3, FALSE); | |
1611 gtk_widget_set_name(table, "table"); | |
1612 gtk_widget_show(table); | |
1613 gtk_box_pack_start(GTK_BOX(vbox), table, TRUE, TRUE, 0); | |
1614 | |
1615 label = AddLabel(MSGTR_PREFERENCES_Audio_Device, NULL); | |
1616 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(0), 0, 0); | |
1617 | |
1618 CBAudioDevice = AddComboBox(NULL); | |
1619 gtk_table_attach(GTK_TABLE(table), CBAudioDevice, 1, 2, 0, 1, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)(0), 0, 0); | |
1620 items = g_list_append(items,(gpointer)MSGTR_PREFERENCES_DriverDefault); | |
1621 #ifdef CONFIG_OSS_AUDIO | |
1622 if (strncmp(ao_driver[0], "oss", 3) == 0) | |
1623 items = appendOSSDevices(items); | |
1624 #endif | |
1625 #ifdef CONFIG_ALSA | |
1626 if (strncmp(ao_driver[0], "alsa", 4) == 0) | |
1627 items = appendALSADevices(items); | |
1628 #endif | |
1629 #ifdef CONFIG_SDL | |
1630 if (strncmp(ao_driver[0], "sdl", 3) == 0) | |
1631 items = appendSDLDevices(items); | |
1632 #endif | |
1633 #ifdef CONFIG_ESD | |
1634 if (strncmp(ao_driver[0], "esd", 3) == 0) | |
1635 items = appendESDDevices(items); | |
1636 #endif | |
1637 gtk_combo_set_popdown_strings(GTK_COMBO(CBAudioDevice), items); | |
1638 g_list_free(items); | |
1639 items = NULL; | |
1640 | |
1641 CEAudioDevice = GTK_COMBO(CBAudioDevice)->entry; | |
1642 gtk_widget_set_name(CEAudioDevice, "CEAudioDevice"); | |
1643 gtk_widget_show(CEAudioDevice); | |
1644 | |
1645 label = AddLabel(MSGTR_PREFERENCES_Audio_Mixer, NULL); | |
1646 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(0), 0, 0); | |
1647 | |
1648 CBAudioMixer = AddComboBox(NULL); | |
1649 gtk_table_attach(GTK_TABLE(table), CBAudioMixer, 1, 2, 1, 2, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)(0), 0, 0); | |
1650 items = g_list_append(items, (gpointer)MSGTR_PREFERENCES_DriverDefault); | |
1651 #ifdef CONFIG_OSS_AUDIO | |
1652 if (strncmp(ao_driver[0], "oss", 3) == 0) | |
1653 items = appendOSSMixers(items); | |
1654 #endif | |
1655 #ifdef CONFIG_ALSA | |
1656 if (strncmp(ao_driver[0], "alsa", 4) == 0) | |
1657 items = appendALSAMixers(items); | |
1658 #endif | |
1659 gtk_combo_set_popdown_strings(GTK_COMBO(CBAudioMixer), items); | |
1660 g_list_free(items); | |
1661 items = NULL; | |
1662 | |
1663 CEAudioMixer = GTK_COMBO(CBAudioMixer)->entry; | |
1664 gtk_widget_set_name(CEAudioMixer, "CEAudioMixer"); | |
1665 gtk_widget_show(CEAudioMixer); | |
1666 | |
1667 label = AddLabel(MSGTR_PREFERENCES_Audio_MixerChannel, NULL); | |
1668 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3, (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(0), 0, 0); | |
1669 | |
1670 CBAudioMixerChannel = AddComboBox(NULL); | |
1671 gtk_table_attach(GTK_TABLE(table), CBAudioMixerChannel, 1, 2, 2, 3, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)(0), 0, 0); | |
1672 items = g_list_append(items, (gpointer)MSGTR_PREFERENCES_DriverDefault); | |
1673 #ifdef CONFIG_OSS_AUDIO | |
1674 if (strncmp(ao_driver[0], "oss", 3) == 0) | |
1675 items = appendOSSMixerChannels(items); | |
1676 #endif | |
1677 #ifdef CONFIG_ALSA | |
1678 if (strncmp(ao_driver[0], "alsa", 4) == 0) | |
1679 items = appendALSAMixerChannels(items); | |
1680 #endif | |
1681 gtk_combo_set_popdown_strings(GTK_COMBO(CBAudioMixerChannel), items); | |
1682 g_list_free(items); | |
1683 items = NULL; | |
1684 | |
1685 CEAudioMixerChannel = GTK_COMBO(CBAudioMixerChannel)->entry; | |
1686 gtk_widget_set_name(CEAudioMixerChannel, "CEAudioMixerChannel"); | |
1687 gtk_widget_show(CEAudioMixerChannel); | |
1688 | |
1689 AddHSeparator(vbox); | |
1690 | |
1691 hbuttonbox = AddHButtonBox(vbox); | |
1692 gtk_button_box_set_layout(GTK_BUTTON_BOX(hbuttonbox), GTK_BUTTONBOX_END); | |
1693 gtk_button_box_set_spacing(GTK_BUTTON_BOX(hbuttonbox), 10); | |
1694 BAudioOk = AddButton(MSGTR_Ok, hbuttonbox); | |
1695 BAudioCancel = AddButton(MSGTR_Cancel, hbuttonbox); | |
1696 | |
1697 gtk_signal_connect(GTK_OBJECT(AudioConfig), "destroy", GTK_SIGNAL_FUNC(WidgetDestroy), &AudioConfig); | |
1698 gtk_signal_connect(GTK_OBJECT(BAudioOk), "clicked", GTK_SIGNAL_FUNC(audioButton), (void*)1); | |
1699 gtk_signal_connect(GTK_OBJECT(BAudioCancel), "clicked", GTK_SIGNAL_FUNC(audioButton), (void*)0); | |
1700 | |
1701 accel_group = gtk_accel_group_new(); | |
1702 gtk_widget_add_accelerator(BAudioOk, "clicked", accel_group, GDK_Return, 0, GTK_ACCEL_VISIBLE); | |
1703 gtk_widget_add_accelerator(BAudioCancel, "clicked", accel_group, GDK_Escape, 0, GTK_ACCEL_VISIBLE); | |
1704 gtk_window_add_accel_group(GTK_WINDOW(AudioConfig), accel_group); | |
1705 | |
1706 return AudioConfig; | |
1707 } | |
1708 | |
1709 #ifdef CONFIG_DXR3 | |
1710 // --- dxr3 config box | |
1711 | |
1712 static GtkWidget * DXR3Config; | |
1713 static GtkWidget * CBDevice; | |
1714 static GtkWidget * CEDXR3Device; | |
1715 static GtkWidget * RBVNone; | |
1716 static GtkWidget * RBVLavc; | |
1717 static GtkWidget * dxr3BOk; | |
1718 static GtkWidget * dxr3BCancel; | |
1719 | |
1720 GtkWidget * create_DXR3Config( void ); | |
1721 | |
1722 void ShowDXR3Config( void ) | |
1723 { | |
1724 if ( DXR3Config ) gtkActive( DXR3Config ); | |
1725 else DXR3Config=create_DXR3Config(); | |
1726 | |
1727 gtk_entry_set_text( GTK_ENTRY( CEDXR3Device ),gtkDXR3Device ); | |
1728 | |
1729 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( RBVNone ),TRUE ); | |
1730 if ( gtkVfLAVC ) gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( RBVLavc ),TRUE ); | |
1731 | |
1732 gtk_widget_show( DXR3Config ); | |
1733 gtkSetLayer( DXR3Config ); | |
1734 } | |
1735 | |
1736 void HideDXR3Config( void ) | |
1737 { | |
1738 if ( !DXR3Config ) return; | |
1739 gtk_widget_hide( DXR3Config ); | |
1740 gtk_widget_destroy( DXR3Config ); | |
1741 DXR3Config=NULL; | |
1742 } | |
1743 | |
1744 static void dxr3Button( GtkButton * button,gpointer user_data ) | |
1745 { | |
1746 switch ( (int)user_data ) | |
1747 { | |
1748 case 0: // Ok | |
33739 | 1749 nfree( gtkDXR3Device ); gtkDXR3Device=strdup( gtk_entry_get_text( GTK_ENTRY( CEDXR3Device ) ) ); |
33572 | 1750 gtkVfLAVC=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBVLavc ) ); |
1751 case 1: // Cancel | |
1752 HideDXR3Config(); | |
1753 break; | |
1754 } | |
1755 } | |
1756 | |
1757 GtkWidget * create_DXR3Config( void ) | |
1758 { | |
1759 GtkWidget * vbox1; | |
1760 GtkWidget * vbox2; | |
1761 GtkWidget * hbox1; | |
1762 GList * CBDevice_items = NULL; | |
1763 GtkWidget * vbox3; | |
1764 GSList * VEncoder_group = NULL; | |
1765 GtkWidget * hbuttonbox1; | |
1766 GtkAccelGroup * accel_group; | |
1767 | |
1768 accel_group=gtk_accel_group_new(); | |
1769 | |
1770 DXR3Config=gtk_window_new( GTK_WINDOW_TOPLEVEL ); | |
1771 gtk_widget_set_name( DXR3Config,"DXR3Config" ); | |
1772 gtk_object_set_data( GTK_OBJECT( DXR3Config ),"DXR3Config",DXR3Config ); | |
1773 // gtk_widget_set_usize( DXR3Config,300,156 ); | |
1774 GTK_WIDGET_SET_FLAGS( DXR3Config,GTK_CAN_DEFAULT ); | |
1775 gtk_window_set_title( GTK_WINDOW( DXR3Config ),"DXR3/H+" ); | |
1776 gtk_window_set_position( GTK_WINDOW( DXR3Config ),GTK_WIN_POS_CENTER ); | |
1777 gtk_window_set_policy( GTK_WINDOW( DXR3Config ),FALSE,FALSE,FALSE ); | |
1778 gtk_window_set_wmclass( GTK_WINDOW( DXR3Config ),"DXR3","MPlayer" ); | |
1779 | |
1780 gtk_widget_realize( DXR3Config ); | |
1781 gtkAddIcon( DXR3Config ); | |
1782 | |
1783 vbox1=AddVBox( AddDialogFrame( DXR3Config ),0 ); | |
1784 vbox2=AddVBox( vbox1,0 ); | |
1785 hbox1=AddHBox( vbox2,1 ); | |
1786 AddLabel( MSGTR_PREFERENCES_Audio_Device,hbox1 ); | |
1787 | |
1788 CBDevice=AddComboBox( hbox1 ); | |
1789 | |
1790 CBDevice_items=g_list_append( CBDevice_items,( gpointer ) "/dev/em8300" ); | |
1791 CBDevice_items=g_list_append( CBDevice_items,( gpointer ) "/dev/em8300-0" ); | |
1792 CBDevice_items=g_list_append( CBDevice_items,( gpointer ) "/dev/em8300-1" ); | |
1793 CBDevice_items=g_list_append( CBDevice_items,( gpointer ) "/dev/em8300-2" ); | |
1794 CBDevice_items=g_list_append( CBDevice_items,( gpointer ) "/dev/em8300-3" ); | |
1795 gtk_combo_set_popdown_strings( GTK_COMBO( CBDevice ),CBDevice_items ); | |
1796 g_list_free( CBDevice_items ); | |
1797 | |
1798 CEDXR3Device=GTK_COMBO( CBDevice )->entry; | |
1799 gtk_widget_set_name( CEDXR3Device,"CEDXR3Device" ); | |
1800 gtk_widget_show( CEDXR3Device ); | |
1801 gtk_entry_set_text( GTK_ENTRY( CEDXR3Device ),"/dev/em8300" ); | |
1802 | |
1803 AddHSeparator( vbox2 ); | |
1804 vbox3=AddVBox( vbox2,0 ); | |
1805 AddLabel( MSGTR_PREFERENCES_DXR3_VENC,vbox3 ); | |
1806 RBVNone=AddRadioButton( MSGTR_PREFERENCES_None,&VEncoder_group,vbox3 ); | |
1807 RBVLavc=AddRadioButton( MSGTR_PREFERENCES_DXR3_LAVC,&VEncoder_group,vbox3 ); | |
1808 | |
1809 AddHSeparator( vbox1 ); | |
1810 | |
1811 hbuttonbox1=AddHButtonBox( vbox1 ); | |
1812 gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox1 ),GTK_BUTTONBOX_END ); | |
1813 gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox1 ),10 ); | |
1814 dxr3BOk=AddButton( MSGTR_Ok,hbuttonbox1 ); | |
1815 dxr3BCancel=AddButton( MSGTR_Cancel,hbuttonbox1 ); | |
1816 | |
1817 gtk_widget_add_accelerator( dxr3BOk,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE ); | |
1818 gtk_widget_add_accelerator( dxr3BCancel,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE ); | |
1819 | |
1820 gtk_signal_connect( GTK_OBJECT( DXR3Config ),"destroy",GTK_SIGNAL_FUNC( WidgetDestroy ),&DXR3Config ); | |
1821 | |
1822 gtk_signal_connect( GTK_OBJECT( dxr3BOk ),"clicked",GTK_SIGNAL_FUNC( dxr3Button ),(void *)0 ); | |
1823 gtk_signal_connect( GTK_OBJECT( dxr3BCancel ),"clicked",GTK_SIGNAL_FUNC( dxr3Button ),(void *)1 ); | |
1824 | |
1825 gtk_window_add_accel_group( GTK_WINDOW( DXR3Config ),accel_group ); | |
1826 | |
1827 return DXR3Config; | |
1828 } | |
1829 | |
1830 #endif |