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