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