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