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