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