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