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