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