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