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