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