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