Mercurial > mplayer.hg
annotate gui/mplayer/gtk/opts.c @ 32741:872b714d47bd
Cast properly (to avoid compiler warnings).
author | ib |
---|---|
date | Sat, 29 Jan 2011 16:39:52 +0000 |
parents | fbe5c829c69b |
children | 6e22bcc85ac5 |
rev | line source |
---|---|
26458 | 1 /* |
2 * This file is part of MPlayer. | |
3 * | |
4 * MPlayer is free software; you can redistribute it and/or modify | |
5 * it under the terms of the GNU General Public License as published by | |
6 * the Free Software Foundation; either version 2 of the License, or | |
7 * (at your option) any later version. | |
8 * | |
9 * MPlayer is distributed in the hope that it will be useful, | |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 * GNU General Public License for more details. | |
13 * | |
14 * You should have received a copy of the GNU General Public License along | |
15 * with MPlayer; if not, write to the Free Software Foundation, Inc., | |
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
17 */ | |
23077 | 18 |
23154
e564b9cd7290
Fix several implicit declarations of functions warnings.
diego
parents:
23077
diff
changeset
|
19 #include <stdlib.h> |
23077 | 20 #include <sys/types.h> |
21 #include <sys/stat.h> | |
22 #include <unistd.h> | |
23 #include <string.h> | |
24 | |
25 #include <gdk/gdkkeysyms.h> | |
26 #include <gtk/gtk.h> | |
27 | |
28 #include "config.h" | |
29 #include "help_mp.h" | |
30 #include "mixer.h" | |
31489 | 31 #include "mpcommon.h" |
23077 | 32 #include "libao2/audio_out.h" |
32467 | 33 #include "sub/sub.h" |
23077 | 34 #include "libvo/video_out.h" |
31385
f2aebe1309b2
Declare stop_xscreensaver extern in x11_common.h instead of all over the code.
diego
parents:
30536
diff
changeset
|
35 #include "libvo/x11_common.h" |
23154
e564b9cd7290
Fix several implicit declarations of functions warnings.
diego
parents:
23077
diff
changeset
|
36 #include "stream/stream.h" |
e564b9cd7290
Fix several implicit declarations of functions warnings.
diego
parents:
23077
diff
changeset
|
37 #include "libmpdemux/demuxer.h" |
e564b9cd7290
Fix several implicit declarations of functions warnings.
diego
parents:
23077
diff
changeset
|
38 #include "libmpdemux/stheader.h" |
e564b9cd7290
Fix several implicit declarations of functions warnings.
diego
parents:
23077
diff
changeset
|
39 #include "libmpcodecs/dec_video.h" |
23077 | 40 |
26365
10dfbc523184
Add gui/ prefix to some #include paths so that compilation from the
diego
parents:
26135
diff
changeset
|
41 #include "gui/app.h" |
10dfbc523184
Add gui/ prefix to some #include paths so that compilation from the
diego
parents:
26135
diff
changeset
|
42 #include "gui/cfg.h" |
10dfbc523184
Add gui/ prefix to some #include paths so that compilation from the
diego
parents:
26135
diff
changeset
|
43 #include "gui/interface.h" |
30536
39a4dd7ec420
Move GUI-related extern declarations to a GUI header file.
diego
parents:
30535
diff
changeset
|
44 #include "gui/mplayer/gmplayer.h" |
26382
b2f4abcf20ed
Make include paths consistent; do not use ../ in them.
diego
parents:
26365
diff
changeset
|
45 #include "gui/mplayer/widgets.h" |
23077 | 46 #include "opts.h" |
47 #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
|
48 #include "gtk_common.h" |
23077 | 49 |
50 // for mpcodecs_[av]d_drivers: | |
51 #include "libmpcodecs/vd.h" | |
52 #include "libmpcodecs/ad.h" | |
53 | |
54 GtkWidget * Preferences = NULL; | |
55 static GtkWidget * AConfig; | |
56 static GtkWidget * VConfig; | |
57 //static GtkWidget * BLoadSubtitle; | |
58 static GtkWidget * BLoadFont; | |
59 static GtkWidget * BOk; | |
60 static GtkWidget * BCancel; | |
61 | |
62 static GtkWidget * CLADrivers; | |
63 static GtkWidget * CLVDrivers; | |
64 | |
65 //static GtkWidget * ESubtitleName; | |
66 GtkWidget * prEFontName; | |
67 GtkWidget * prEDVDDevice; | |
68 GtkWidget * prECDRomDevice; | |
69 static GtkWidget * EVFM; | |
70 static GtkWidget * EAFM; | |
71 | |
72 static GtkWidget * CBVFM; | |
73 static GtkWidget * CBAFM; | |
74 static GtkWidget * CBAudioEqualizer; | |
75 //static GtkWidget * CBSurround; | |
76 static GtkWidget * CBExtraStereo; | |
77 static GtkWidget * CBNormalize; | |
78 static GtkWidget * CBSoftwareMixer; | |
79 static GtkWidget * CBDoubleBuffer; | |
80 static GtkWidget * CBDR; | |
81 static GtkWidget * CBFramedrop; | |
82 static GtkWidget * CBHFramedrop; | |
83 //static GtkWidget * CBFullScreen; | |
84 static GtkWidget * CBShowVideoWindow; | |
85 static GtkWidget * CBNonInterlaved; | |
86 static GtkWidget * CBIndex; | |
87 static GtkWidget * CBFlip; | |
88 static GtkWidget * CBNoAutoSub; | |
89 static GtkWidget * CBSubUnicode; | |
90 static GtkWidget * CBSubOverlap; | |
91 static GtkWidget * CBDumpMPSub; | |
92 static GtkWidget * CBDumpSrt; | |
93 static GtkWidget * CBUseASS; | |
94 static GtkWidget * CBASSUseMargins; | |
95 static GtkWidget * SBASSTopMargin; | |
96 static GtkWidget * SBASSBottomMargin; | |
97 static GtkWidget * CBPostprocess; | |
98 static GtkWidget * CBCache; | |
99 static GtkWidget * CBLoadFullscreen; | |
100 static GtkWidget * CBSaveWinPos; | |
101 static GtkWidget * CBStopXScreenSaver; | |
102 static GtkWidget * CBPlayBar; | |
103 | |
104 static GtkWidget * SBCache; | |
105 static GtkAdjustment * SBCacheadj; | |
106 | |
107 static GtkWidget * CBAutoSync; | |
108 static GtkWidget * SBAutoSync; | |
109 static GtkAdjustment * SBAutoSyncadj; | |
110 | |
111 static GtkWidget * RBOSDNone; | |
112 static GtkWidget * RBOSDTandP; | |
113 static GtkWidget * RBOSDIndicator; | |
114 static GtkWidget * RBOSDTPTT; | |
115 | |
116 static GtkWidget * HSAudioDelay; | |
117 static GtkWidget * HSExtraStereoMul; | |
118 static GtkWidget * HSPanscan; | |
119 static GtkWidget * HSSubDelay; | |
120 static GtkWidget * HSSubPosition; | |
121 static GtkWidget * HSSubFPS; | |
122 static GtkWidget * HSPPQuality; | |
123 static GtkWidget * HSFPS; | |
124 | |
125 static GtkAdjustment * HSExtraStereoMuladj, * HSAudioDelayadj, * HSPanscanadj, * HSSubDelayadj; | |
126 static GtkAdjustment * HSSubPositionadj, * HSSubFPSadj, * HSPPQualityadj, * HSFPSadj; | |
127 | |
27393 | 128 #ifndef CONFIG_FREETYPE |
23077 | 129 static GtkWidget * HSFontFactor; |
130 static GtkAdjustment * HSFontFactoradj; | |
131 #else | |
132 static GtkWidget * HSFontBlur, * HSFontOutLine, * HSFontTextScale, * HSFontOSDScale; | |
133 static GtkAdjustment * HSFontBluradj, * HSFontOutLineadj, * HSFontTextScaleadj, * HSFontOSDScaleadj; | |
134 static GtkWidget * CBFontEncoding, * EFontEncoding; | |
135 static GtkWidget * RBFontNoAutoScale, * RBFontAutoScaleWidth, * RBFontAutoScaleHeight, * RBFontAutoScaleDiagonal; | |
136 //static GtkWidget * AutoScale; | |
137 #endif | |
138 | |
27393 | 139 #ifdef CONFIG_ICONV |
23077 | 140 static GtkWidget * CBSubEncoding, * ESubEncoding; |
141 #endif | |
142 | |
27393 | 143 #if defined(CONFIG_FREETYPE) || defined(CONFIG_ICONV) |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28232
diff
changeset
|
144 static struct |
23077 | 145 { |
146 char * name; | |
147 char * comment; | |
148 } lEncoding[] = | |
149 { | |
150 { "unicode", MSGTR_PREFERENCES_FontEncoding1 }, | |
151 { "iso-8859-1", MSGTR_PREFERENCES_FontEncoding2 }, | |
152 { "iso-8859-15", MSGTR_PREFERENCES_FontEncoding3 }, | |
153 { "iso-8859-2", MSGTR_PREFERENCES_FontEncoding4 }, | |
154 { "cp1250", MSGTR_PREFERENCES_FontEncoding22}, | |
155 { "iso-8859-3", MSGTR_PREFERENCES_FontEncoding5 }, | |
156 { "iso-8859-4", MSGTR_PREFERENCES_FontEncoding6 }, | |
157 { "iso-8859-5", MSGTR_PREFERENCES_FontEncoding7 }, | |
158 { "cp1251", MSGTR_PREFERENCES_FontEncoding21}, | |
159 { "iso-8859-6", MSGTR_PREFERENCES_FontEncoding8 }, | |
25915
aed6a04d98dc
Add windows cp1256 encoding for arabic, fixes bug #1007
reimar
parents:
25601
diff
changeset
|
160 { "cp1256", MSGTR_PREFERENCES_FontEncoding23 }, |
23077 | 161 { "iso-8859-7", MSGTR_PREFERENCES_FontEncoding9 }, |
162 { "iso-8859-9", MSGTR_PREFERENCES_FontEncoding10 }, | |
163 { "iso-8859-13", MSGTR_PREFERENCES_FontEncoding11 }, | |
164 { "iso-8859-14", MSGTR_PREFERENCES_FontEncoding12 }, | |
165 { "iso-8859-8", MSGTR_PREFERENCES_FontEncoding13 }, | |
166 { "koi8-r", MSGTR_PREFERENCES_FontEncoding14 }, | |
167 { "koi8-u/ru", MSGTR_PREFERENCES_FontEncoding15 }, | |
168 { "cp936", MSGTR_PREFERENCES_FontEncoding16 }, | |
169 { "big5", MSGTR_PREFERENCES_FontEncoding17 }, | |
170 { "shift-jis", MSGTR_PREFERENCES_FontEncoding18 }, | |
171 { "cp949", MSGTR_PREFERENCES_FontEncoding19 }, | |
172 { "cp874", MSGTR_PREFERENCES_FontEncoding20 }, | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28232
diff
changeset
|
173 { NULL,NULL } |
23077 | 174 }; |
175 char * lCEncoding = NULL; | |
176 char * lSEncoding = NULL; | |
177 #endif | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28232
diff
changeset
|
178 |
23077 | 179 static int old_audio_driver = 0; |
180 static char * ao_driver[3]; | |
181 static char * vo_driver[3]; | |
182 static int old_video_driver = 0; | |
183 | |
27370
14c5017f40d2
Change a bunch of video/audio-output-specific preprocessor directives from
diego
parents:
27359
diff
changeset
|
184 #ifdef CONFIG_DXR3 |
23077 | 185 void ShowDXR3Config( void ); |
186 void HideDXR3Config( void ); | |
187 #endif | |
28232
8df85ad26746
Add missing 'void' keyword to parameterless function declarations.
diego
parents:
27393
diff
changeset
|
188 void ShowAudioConfig( void ); |
8df85ad26746
Add missing 'void' keyword to parameterless function declarations.
diego
parents:
27393
diff
changeset
|
189 void HideAudioConfig( void ); |
23077 | 190 |
191 static gboolean prHScaler( GtkWidget * widget,GdkEventMotion * event,gpointer user_data ); | |
192 static void prToggled( GtkToggleButton * togglebutton,gpointer user_data ); | |
193 static void prCListRow( GtkCList * clist,gint row,gint column,GdkEvent * event,gpointer user_data ); | |
27393 | 194 #if defined(CONFIG_FREETYPE) || defined(CONFIG_ICONV) |
23077 | 195 static void prEntry( GtkContainer * container,gpointer user_data ); |
196 #endif | |
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; | |
32207
e40d435554b6
Add an #ifdef to avoid unused variable warnings when iconv is disabled.
diego
parents:
32117
diff
changeset
|
821 #ifdef CONFIG_ICONV |
23077 | 822 GSList * Font_group = NULL; |
823 GList * CBFontEncoding_items = NULL; | |
824 GList * CBSubEncoding_items = NULL; | |
32207
e40d435554b6
Add an #ifdef to avoid unused variable warnings when iconv is disabled.
diego
parents:
32117
diff
changeset
|
825 #endif |
23077 | 826 GtkWidget * vbox7; |
827 GtkWidget * vbox8; | |
828 GtkWidget * table1; | |
829 GtkWidget * vbox9; | |
830 GtkWidget * vbox603; | |
831 GtkWidget * hbox6; | |
832 GtkWidget * hbuttonbox5; | |
27393 | 833 #ifndef CONFIG_FREETYPE |
23077 | 834 GtkWidget * hbox7; |
835 #endif | |
836 GtkWidget * vbox601; | |
837 GtkWidget * vbox602; | |
838 GtkWidget * hbox5; | |
839 GtkWidget * hbuttonbox1; | |
840 GtkAccelGroup * accel_group; | |
841 | |
842 GtkWidget * hbox9; | |
843 GtkWidget * hbox91; | |
844 GtkWidget * hbox92; | |
845 | |
846 accel_group=gtk_accel_group_new(); | |
847 | |
848 Preferences=gtk_window_new( GTK_WINDOW_TOPLEVEL ); | |
849 gtk_widget_set_name( Preferences,"Preferences" ); | |
850 gtk_object_set_data( GTK_OBJECT( Preferences ),"Preferences",Preferences ); | |
851 gtk_window_set_title( GTK_WINDOW( Preferences ),MSGTR_Preferences ); | |
852 gtk_window_set_position( GTK_WINDOW( Preferences ),GTK_WIN_POS_CENTER ); | |
853 // gtk_window_set_policy( GTK_WINDOW( Preferences ),FALSE,FALSE,FALSE ); | |
854 gtk_window_set_wmclass( GTK_WINDOW( Preferences ),"Preferences","MPlayer" ); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28232
diff
changeset
|
855 |
23077 | 856 gtk_widget_realize( Preferences ); |
857 gtkAddIcon( Preferences ); | |
858 | |
859 vbox1=AddVBox( AddDialogFrame( Preferences ),0 ); | |
860 notebook1=gtk_notebook_new(); | |
861 gtk_widget_set_name( notebook1,"notebook1" ); | |
862 gtk_widget_show( notebook1 ); | |
863 gtk_box_pack_start( GTK_BOX( vbox1 ),notebook1,TRUE,TRUE,0 ); | |
864 | |
865 hbox1=AddVBox( notebook1,0 ); | |
866 | |
867 frame=AddFrame( NULL,GTK_SHADOW_ETCHED_OUT,hbox1,1 ); | |
868 frame=AddFrame( NULL,GTK_SHADOW_NONE,frame,1 ); | |
869 | |
870 // --- 1. page | |
871 | |
872 vbox2=AddVBox( frame,0 ); | |
873 | |
874 scrolledwindow3=gtk_scrolled_window_new( NULL,NULL ); | |
875 gtk_widget_set_name( scrolledwindow3,"scrolledwindow3" ); | |
876 gtk_widget_show( scrolledwindow3 ); | |
877 gtk_box_pack_start( GTK_BOX( vbox2 ),scrolledwindow3,TRUE,TRUE,0 ); | |
878 gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scrolledwindow3 ),GTK_POLICY_NEVER,GTK_POLICY_AUTOMATIC ); | |
879 | |
880 CLADrivers=gtk_clist_new( 2 ); | |
881 gtk_widget_set_name( CLADrivers,"CLADrivers" ); | |
882 gtk_widget_show( CLADrivers ); | |
883 gtk_container_add( GTK_CONTAINER( scrolledwindow3 ),CLADrivers ); | |
884 gtk_clist_set_column_width( GTK_CLIST( CLADrivers ),0,50 ); | |
885 gtk_clist_column_titles_show( GTK_CLIST( CLADrivers ) ); | |
886 gtk_clist_set_shadow_type( GTK_CLIST( CLADrivers ),GTK_SHADOW_NONE ); | |
887 gtk_widget_set_usize( CLADrivers,250,-2 ); | |
888 gtk_clist_set_column_widget( GTK_CLIST( CLADrivers ),0, | |
889 AddLabel( MSGTR_PREFERENCES_AvailableDrivers,NULL ) ); | |
890 | |
891 AConfig=AddButton( MSGTR_ConfigDriver, | |
892 AddHButtonBox( vbox2 ) ); | |
893 | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28232
diff
changeset
|
894 vbox3=AddVBox( |
23077 | 895 AddFrame( NULL,GTK_SHADOW_NONE, |
896 AddFrame( NULL,GTK_SHADOW_ETCHED_OUT,hbox1,0 ),1 ),0 ); | |
897 gtk_widget_set_usize( vbox3,250,-2 ); | |
898 | |
899 CBNormalize=AddCheckButton( MSGTR_PREFERENCES_NormalizeSound,vbox3 ); | |
900 CBAudioEqualizer=AddCheckButton( MSGTR_PREFERENCES_EnableEqualizer,vbox3 ); | |
901 CBSoftwareMixer=AddCheckButton( MSGTR_PREFERENCES_SoftwareMixer,vbox3 ); | |
902 #if 0 | |
903 CBSurround=AddCheckButton( "Enable surround",vbox3 ); | |
904 #endif | |
905 | |
906 AddHSeparator( vbox3 ); | |
907 CBExtraStereo=AddCheckButton( MSGTR_PREFERENCES_ExtraStereo,vbox3 ); | |
908 hbox8=AddHBox( vbox3,1 ); | |
909 label=AddLabel( MSGTR_PREFERENCES_Coefficient,hbox8 ); | |
910 // gtk_misc_set_padding( GTK_MISC( label ),20,0 ); | |
911 HSExtraStereoMuladj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-10,10,0.1,0,0 ) ); | |
912 HSExtraStereoMul=AddHScaler( HSExtraStereoMuladj,hbox8,1 ); | |
913 AddHSeparator( vbox3 ); | |
914 | |
915 hbox8=AddHBox( vbox3,1 ); | |
916 AddLabel( MSGTR_PREFERENCES_AudioDelay,hbox8 ); | |
917 | |
918 HSAudioDelayadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-10,10,0.01,0,0 ) ); | |
919 HSAudioDelay=AddHScaler( HSAudioDelayadj,hbox8,2 ); | |
920 label=AddLabel( MSGTR_PREFERENCES_Audio,NULL ); | |
921 gtk_notebook_set_tab_label( GTK_NOTEBOOK( notebook1 ),gtk_notebook_get_nth_page( GTK_NOTEBOOK( notebook1 ),0 ),label ); | |
922 | |
923 // --- 2. page | |
924 | |
925 hbox2=AddVBox( notebook1,0 ); | |
926 | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28232
diff
changeset
|
927 vbox4=AddVBox( |
23077 | 928 AddFrame( NULL,GTK_SHADOW_NONE, |
929 AddFrame( NULL,GTK_SHADOW_ETCHED_OUT,hbox2,1 ),1 ),0 ); | |
930 | |
931 scrolledwindow2=gtk_scrolled_window_new( NULL,NULL ); | |
932 gtk_widget_set_name( scrolledwindow2,"scrolledwindow2" ); | |
933 gtk_widget_show( scrolledwindow2 ); | |
934 gtk_box_pack_start( GTK_BOX( vbox4 ),scrolledwindow2,TRUE,TRUE,0 ); | |
935 gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scrolledwindow2 ),GTK_POLICY_NEVER,GTK_POLICY_AUTOMATIC ); | |
936 | |
937 CLVDrivers=gtk_clist_new( 2 ); | |
938 gtk_widget_set_name( CLVDrivers,"CLVDrivers" ); | |
939 gtk_widget_show( CLVDrivers ); | |
940 gtk_container_add( GTK_CONTAINER( scrolledwindow2 ),CLVDrivers ); | |
941 gtk_clist_set_column_width( GTK_CLIST( CLVDrivers ),0,50 ); | |
942 gtk_clist_column_titles_show( GTK_CLIST( CLVDrivers ) ); | |
943 gtk_clist_set_shadow_type( GTK_CLIST( CLVDrivers ),GTK_SHADOW_NONE ); | |
944 gtk_widget_set_usize( CLVDrivers,250,-2 ); | |
945 | |
946 label=AddLabel( MSGTR_PREFERENCES_AvailableDrivers,NULL ); | |
947 gtk_clist_set_column_widget( GTK_CLIST( CLVDrivers ),0,label ); | |
948 | |
949 hbuttonbox3=AddHButtonBox( vbox4 ); | |
950 VConfig=AddButton( MSGTR_ConfigDriver,hbuttonbox3 ); | |
951 | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28232
diff
changeset
|
952 vbox5=AddVBox( |
23077 | 953 AddFrame( NULL,GTK_SHADOW_NONE, |
954 AddFrame( NULL,GTK_SHADOW_ETCHED_OUT,hbox2,0 ),1 ),0 ); | |
955 gtk_widget_set_usize( vbox5,250,-2 ); | |
956 | |
957 CBDoubleBuffer=AddCheckButton( MSGTR_PREFERENCES_DoubleBuffer,vbox5 ); | |
958 CBDR=AddCheckButton( MSGTR_PREFERENCES_DirectRender,vbox5 ); | |
959 CBFramedrop=AddCheckButton( MSGTR_PREFERENCES_FrameDrop,vbox5 ); | |
960 CBHFramedrop=AddCheckButton( MSGTR_PREFERENCES_HFrameDrop,vbox5 ); | |
961 CBFlip=AddCheckButton( MSGTR_PREFERENCES_Flip,vbox5 ); | |
962 | |
963 table1=gtk_table_new( 3,2,FALSE ); | |
964 gtk_widget_set_name( table1,"table1" ); | |
965 gtk_widget_show( table1 ); | |
966 gtk_box_pack_start( GTK_BOX( vbox5 ),table1,FALSE,FALSE,0 ); | |
967 | |
968 label=AddLabel( MSGTR_PREFERENCES_Panscan,NULL ); | |
969 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
970 | |
971 label=AddLabel( MSGTR_PREFERENCES_FPS,NULL ); | |
972 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
973 | |
974 HSPanscanadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,1,0.001,0,0 ) ); | |
975 HSPanscan=AddHScaler( HSPanscanadj,NULL,1 ); | |
976 gtk_table_attach( GTK_TABLE( table1 ),HSPanscan,1,2,0,1,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
977 | |
978 HSFPSadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,1000,0.001,0,0 ) ); | |
979 HSFPS=gtk_spin_button_new( GTK_ADJUSTMENT( HSFPSadj ),1,3 ); | |
980 gtk_widget_set_name( HSFPS,"HSFPS" ); | |
981 gtk_widget_show( HSFPS ); | |
982 gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( HSFPS ),TRUE ); | |
983 gtk_table_attach( GTK_TABLE( table1 ),HSFPS,1,2,1,2,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
984 | |
985 label=AddLabel( MSGTR_PREFERENCES_Video,NULL ); | |
986 gtk_notebook_set_tab_label( GTK_NOTEBOOK( notebook1 ),gtk_notebook_get_nth_page( GTK_NOTEBOOK( notebook1 ),1 ),label ); | |
987 | |
988 // --- 3. page | |
989 | |
990 vbox6=AddVBox( notebook1,0 ); | |
991 | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28232
diff
changeset
|
992 vbox600=AddVBox( |
23077 | 993 AddFrame( NULL,GTK_SHADOW_NONE, |
994 AddFrame( MSGTR_PREFERENCES_FRAME_OSD_Level,GTK_SHADOW_ETCHED_OUT,vbox6,0 ),1 ),0 ); | |
995 | |
996 RBOSDNone=AddRadioButton( MSGTR_PREFERENCES_None,&OSD_group,vbox600 ); | |
997 RBOSDTandP=AddRadioButton( MSGTR_PREFERENCES_OSDTimer,&OSD_group,vbox600 ); | |
998 RBOSDIndicator=AddRadioButton( MSGTR_PREFERENCES_OSDProgress,&OSD_group,vbox600 ); | |
999 RBOSDTPTT=AddRadioButton( MSGTR_PREFERENCES_OSDTimerPercentageTotalTime,&OSD_group,vbox600 ); | |
1000 | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28232
diff
changeset
|
1001 vbox7=AddVBox( |
23077 | 1002 AddFrame( NULL,GTK_SHADOW_NONE, |
1003 AddFrame( MSGTR_PREFERENCES_FRAME_Subtitle,GTK_SHADOW_ETCHED_OUT,vbox6,0 ),1 ),0 ); | |
1004 | |
1005 #if 0 | |
1006 hbox4=AddHBox( vbox7,1 ); | |
1007 | |
1008 AddLabel( MSGTR_PREFERENCES_Subtitle,hbox4 ); | |
1009 | |
1010 ESubtitleName=gtk_entry_new(); | |
1011 gtk_widget_set_name( ESubtitleName,"ESubtitleName" ); | |
1012 gtk_widget_show( ESubtitleName ); | |
1013 gtk_box_pack_start( GTK_BOX( hbox4 ),ESubtitleName,TRUE,TRUE,0 ); | |
1014 | |
1015 hbuttonbox4=AddHButtonBox( hbuttonbox4 ); | |
1016 gtk_container_set_border_width( GTK_CONTAINER( hbuttonbox4 ),3 ); | |
1017 BLoadSubtitle=AddButton( MSGTR_Browse,hbuttonbox4 ); | |
1018 #endif | |
1019 | |
1020 vbox8=AddVBox( vbox7,0 ); | |
1021 | |
1022 table1=gtk_table_new( 3,2,FALSE ); | |
1023 gtk_widget_set_name( table1,"table1" ); | |
1024 gtk_widget_show( table1 ); | |
1025 gtk_box_pack_start( GTK_BOX( vbox8 ),table1,FALSE,FALSE,0 ); | |
1026 | |
1027 label=AddLabel( MSGTR_PREFERENCES_SUB_Delay,NULL ); | |
1028 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1029 | |
1030 label=AddLabel( MSGTR_PREFERENCES_SUB_POS,NULL ); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28232
diff
changeset
|
1031 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); |
23077 | 1032 |
1033 label=AddLabel( MSGTR_PREFERENCES_SUB_FPS,NULL ); | |
1034 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,2,3,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1035 | |
27393 | 1036 #ifdef CONFIG_ICONV |
23077 | 1037 label=AddLabel( MSGTR_PREFERENCES_FontEncoding,NULL ); |
1038 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,3,4,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1039 #endif | |
1040 | |
1041 HSSubDelayadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-10.0,10,0.01,0,0 ) ); | |
1042 HSSubDelay=AddHScaler( HSSubDelayadj,NULL,1 ); | |
1043 gtk_table_attach( GTK_TABLE( table1 ),HSSubDelay,1,2,0,1,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1044 | |
1045 HSSubPositionadj=GTK_ADJUSTMENT( gtk_adjustment_new( 100,0,100,1,0,0 ) ); | |
1046 HSSubPosition=AddHScaler( HSSubPositionadj,NULL,0 ); | |
1047 gtk_table_attach( GTK_TABLE( table1 ),HSSubPosition,1,2,1,2,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1048 | |
1049 HSSubFPSadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,100,0.01,0,0 ) ); | |
1050 HSSubFPS=gtk_spin_button_new( GTK_ADJUSTMENT( HSSubFPSadj ),1,3 ); | |
1051 gtk_widget_set_name( HSSubFPS,"HSSubFPS" ); | |
1052 gtk_widget_show( HSSubFPS ); | |
1053 gtk_widget_set_usize( HSSubFPS,60,-1 ); | |
1054 gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( HSSubFPS ),TRUE ); | |
1055 gtk_table_attach( GTK_TABLE( table1 ),HSSubFPS,1,2,2,3,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1056 | |
27393 | 1057 #ifdef CONFIG_ICONV |
23077 | 1058 CBSubEncoding=gtk_combo_new(); |
1059 gtk_widget_set_name( CBSubEncoding,"CBSubEncoding" ); | |
1060 gtk_widget_show( CBSubEncoding ); | |
1061 gtk_table_attach( GTK_TABLE( table1 ),CBSubEncoding,1,2,3,4,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1062 CBSubEncoding_items=g_list_append( CBSubEncoding_items,MSGTR_PREFERENCES_None ); | |
1063 { | |
1064 int i; | |
1065 for ( i=0;lEncoding[i].name;i++ ) CBSubEncoding_items=g_list_append( CBSubEncoding_items,lEncoding[i].comment ); | |
1066 } | |
1067 gtk_combo_set_popdown_strings( GTK_COMBO( CBSubEncoding ),CBSubEncoding_items ); | |
1068 g_list_free( CBSubEncoding_items ); | |
1069 | |
1070 ESubEncoding=GTK_COMBO( CBSubEncoding )->entry; | |
1071 gtk_widget_set_name( ESubEncoding,"ESubEncoding" ); | |
1072 gtk_entry_set_editable( GTK_ENTRY( ESubEncoding ),FALSE ); | |
1073 gtk_widget_show( ESubEncoding ); | |
1074 #endif | |
1075 | |
1076 vbox9=AddVBox( vbox8,0 ); | |
1077 | |
1078 CBSubOverlap=AddCheckButton( MSGTR_PREFERENCES_SUB_Overlap,vbox9 ); | |
1079 CBNoAutoSub=AddCheckButton( MSGTR_PREFERENCES_SUB_AutoLoad,vbox9 ); | |
1080 CBSubUnicode=AddCheckButton( MSGTR_PREFERENCES_SUB_Unicode,vbox9 ); | |
1081 CBDumpMPSub=AddCheckButton( MSGTR_PREFERENCES_SUB_MPSUB,vbox9 ); | |
1082 CBDumpSrt=AddCheckButton( MSGTR_PREFERENCES_SUB_SRT,vbox9 ); | |
1083 | |
1084 AddHSeparator( vbox9 ); | |
1085 CBUseASS=AddCheckButton( MSGTR_PREFERENCES_SUB_USE_ASS,vbox9 ); | |
1086 hbox9=AddHBox( vbox9,0 ); | |
1087 CBASSUseMargins=AddCheckButton( MSGTR_PREFERENCES_SUB_ASS_USE_MARGINS,hbox9 ); | |
1088 | |
1089 hbox91=gtk_hbox_new( FALSE,0 ); | |
1090 gtk_widget_set_name( hbox91,"hbox91" ); | |
1091 gtk_box_pack_start( GTK_BOX( hbox9 ),hbox91,TRUE,FALSE,0 ); | |
1092 gtk_widget_show( hbox91 ); | |
1093 SBASSTopMargin=AddSpinButton( MSGTR_PREFERENCES_SUB_ASS_TOP_MARGIN, | |
1094 (GtkAdjustment *)gtk_adjustment_new(0,0,512,1,8,0),hbox91 ); | |
1095 | |
1096 hbox92=gtk_hbox_new( FALSE,0 ); | |
1097 gtk_widget_set_name( hbox92,"hbox92" ); | |
1098 gtk_box_pack_start( GTK_BOX( hbox9 ),hbox92,TRUE,FALSE,0 ); | |
1099 gtk_widget_show( hbox92 ); | |
1100 SBASSBottomMargin=AddSpinButton( MSGTR_PREFERENCES_SUB_ASS_BOTTOM_MARGIN, | |
1101 (GtkAdjustment *)gtk_adjustment_new(0,0,512,1,8,0),hbox92 ); | |
1102 | |
1103 label=AddLabel( MSGTR_PREFERENCES_SubtitleOSD,NULL ); | |
1104 gtk_notebook_set_tab_label( GTK_NOTEBOOK( notebook1 ),gtk_notebook_get_nth_page( GTK_NOTEBOOK( notebook1 ),2 ),label ); | |
1105 vbox601=AddVBox( notebook1,0 ); | |
1106 | |
1107 // --- 4. page | |
1108 | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28232
diff
changeset
|
1109 vbox603=AddVBox( |
23077 | 1110 AddFrame( NULL,GTK_SHADOW_NONE, |
1111 AddFrame( MSGTR_PREFERENCES_FRAME_Font,GTK_SHADOW_ETCHED_OUT,vbox601,0 ),1 ),0 ); | |
1112 | |
1113 hbox6=AddHBox( vbox603,1 ); | |
1114 AddLabel( MSGTR_PREFERENCES_Font,hbox6 ); | |
1115 prEFontName=gtk_entry_new(); | |
1116 gtk_widget_set_name( prEFontName,"prEFontName" ); | |
1117 gtk_widget_show( prEFontName ); | |
1118 gtk_box_pack_start( GTK_BOX( hbox6 ),prEFontName,TRUE,TRUE,0 ); | |
1119 hbuttonbox5=AddHButtonBox( hbox6 ); | |
1120 gtk_container_set_border_width( GTK_CONTAINER( hbuttonbox5 ),3 ); | |
1121 BLoadFont=AddButton( MSGTR_Browse,hbuttonbox5 ); | |
1122 | |
27393 | 1123 #ifndef CONFIG_FREETYPE |
23077 | 1124 hbox7=AddHBox( vbox603,1 ); |
1125 AddLabel( MSGTR_PREFERENCES_FontFactor,hbox7 ); | |
1126 HSFontFactoradj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,10,0.05,0,0 ) ); | |
1127 HSFontFactor=AddHScaler( HSFontFactoradj,hbox7,2 ); | |
1128 #else | |
1129 | |
1130 RBFontNoAutoScale=AddRadioButton( MSGTR_PREFERENCES_FontNoAutoScale,&Font_group,vbox603 ); | |
1131 RBFontAutoScaleHeight=AddRadioButton( MSGTR_PREFERENCES_FontPropHeight,&Font_group,vbox603 ); | |
1132 RBFontAutoScaleWidth=AddRadioButton( MSGTR_PREFERENCES_FontPropWidth,&Font_group,vbox603 ); | |
1133 RBFontAutoScaleDiagonal=AddRadioButton( MSGTR_PREFERENCES_FontPropDiagonal,&Font_group,vbox603 ); | |
1134 | |
1135 table1=gtk_table_new( 3,2,FALSE ); | |
1136 gtk_widget_set_name( table1,"table1" ); | |
1137 gtk_widget_show( table1 ); | |
1138 gtk_box_pack_start( GTK_BOX( vbox603 ),table1,FALSE,FALSE,0 ); | |
1139 | |
1140 label=AddLabel( MSGTR_PREFERENCES_FontEncoding,NULL ); | |
1141 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
|
1142 |
23077 | 1143 CBFontEncoding=gtk_combo_new(); |
1144 gtk_widget_set_name( CBFontEncoding,"CBFontEncoding" ); | |
1145 gtk_widget_show( CBFontEncoding ); | |
1146 gtk_table_attach( GTK_TABLE( table1 ),CBFontEncoding,1,2,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1147 { | |
1148 int i; | |
1149 for ( i=0;lEncoding[i].name;i++ ) CBFontEncoding_items=g_list_append( CBFontEncoding_items,lEncoding[i].comment ); | |
1150 } | |
1151 gtk_combo_set_popdown_strings( GTK_COMBO( CBFontEncoding ),CBFontEncoding_items ); | |
1152 g_list_free( CBFontEncoding_items ); | |
1153 | |
1154 EFontEncoding=GTK_COMBO( CBFontEncoding )->entry; | |
1155 gtk_widget_set_name( EFontEncoding,"EFontEncoding" ); | |
1156 gtk_entry_set_editable( GTK_ENTRY( EFontEncoding ),FALSE ); | |
1157 gtk_widget_show( EFontEncoding ); | |
1158 | |
1159 label=AddLabel( MSGTR_PREFERENCES_FontBlur,NULL ); | |
1160 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1161 | |
1162 HSFontBluradj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,100,0.1,0,0 ) ); | |
1163 HSFontBlur=AddHScaler( HSFontBluradj,NULL,2 ); | |
1164 gtk_table_attach( GTK_TABLE( table1 ),HSFontBlur,1,2,1,2,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1165 | |
1166 label=AddLabel( MSGTR_PREFERENCES_FontOutLine,NULL ); | |
1167 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,2,3,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1168 | |
1169 HSFontOutLineadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,100,0.1,0,0 ) ); | |
1170 HSFontOutLine=AddHScaler( HSFontOutLineadj,NULL,2 ); | |
1171 gtk_table_attach( GTK_TABLE( table1 ),HSFontOutLine,1,2,2,3,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1172 | |
1173 label=AddLabel( MSGTR_PREFERENCES_FontTextScale,NULL ); | |
1174 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,3,4,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1175 | |
1176 HSFontTextScaleadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,100,0.1,0,0 ) ); | |
1177 HSFontTextScale=AddHScaler( HSFontTextScaleadj,NULL,2 ); | |
1178 gtk_table_attach( GTK_TABLE( table1 ),HSFontTextScale,1,2,3,4,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1179 | |
1180 label=AddLabel( MSGTR_PREFERENCES_FontOSDScale,NULL ); | |
1181 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,4,5,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1182 | |
1183 HSFontOSDScaleadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,100,0.1,0,0 ) ); | |
1184 HSFontOSDScale=AddHScaler( HSFontOSDScaleadj,NULL,2 ); | |
1185 gtk_table_attach( GTK_TABLE( table1 ),HSFontOSDScale,1,2,4,5,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1186 #endif | |
1187 | |
1188 label=AddLabel( MSGTR_PREFERENCES_FRAME_Font,NULL ); | |
1189 gtk_notebook_set_tab_label( GTK_NOTEBOOK( notebook1 ),gtk_notebook_get_nth_page( GTK_NOTEBOOK( notebook1 ),3 ),label ); | |
1190 | |
1191 // --- 5. page | |
1192 | |
1193 vbox601=AddVBox( notebook1,0 ); | |
1194 | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28232
diff
changeset
|
1195 vbox602=AddVBox( |
23077 | 1196 AddFrame( NULL,GTK_SHADOW_NONE, |
1197 AddFrame( MSGTR_PREFERENCES_FRAME_CodecDemuxer,GTK_SHADOW_ETCHED_OUT,vbox601,0 ),1 ),0 ); | |
1198 | |
1199 CBNonInterlaved=AddCheckButton( MSGTR_PREFERENCES_NI,vbox602 ); | |
1200 CBIndex=AddCheckButton( MSGTR_PREFERENCES_IDX,vbox602 ); | |
1201 | |
1202 hbox5=AddHBox( vbox602,1 ); | |
1203 | |
1204 AddLabel( MSGTR_PREFERENCES_VideoCodecFamily,hbox5 ); | |
1205 | |
1206 CBVFM=gtk_combo_new(); | |
1207 gtk_widget_set_name( CBVFM,"CBVFM" ); | |
1208 gtk_widget_show( CBVFM ); | |
1209 gtk_box_pack_start( GTK_BOX( hbox5 ),CBVFM,TRUE,TRUE,0 ); | |
1210 | |
1211 EVFM=GTK_COMBO( CBVFM )->entry; | |
1212 gtk_widget_set_name( EVFM,"CEVFM" ); | |
1213 gtk_entry_set_editable( GTK_ENTRY( EVFM ),FALSE ); | |
1214 gtk_widget_show( EVFM ); | |
1215 | |
1216 hbox5=AddHBox( vbox602,1 ); | |
1217 | |
1218 AddLabel( MSGTR_PREFERENCES_AudioCodecFamily,hbox5 ); | |
1219 | |
1220 CBAFM=gtk_combo_new(); | |
1221 gtk_widget_set_name( CBAFM,"CBAFM" ); | |
1222 gtk_widget_show( CBAFM ); | |
1223 gtk_box_pack_start( GTK_BOX( hbox5 ),CBAFM,TRUE,TRUE,0 ); | |
1224 | |
1225 EAFM=GTK_COMBO( CBAFM )->entry; | |
1226 gtk_widget_set_name( EAFM,"EAFM" ); | |
1227 gtk_entry_set_editable( GTK_ENTRY( EAFM ),FALSE ); | |
1228 gtk_widget_show( EAFM ); | |
1229 | |
1230 label=AddLabel( MSGTR_PREFERENCES_Codecs,NULL ); | |
1231 gtk_notebook_set_tab_label( GTK_NOTEBOOK( notebook1 ),gtk_notebook_get_nth_page( GTK_NOTEBOOK( notebook1 ),4 ),label ); | |
1232 | |
1233 vbox601=AddVBox( notebook1,0 ); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28232
diff
changeset
|
1234 |
23077 | 1235 // --- 6. page |
1236 | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28232
diff
changeset
|
1237 vbox602=AddVBox( |
23077 | 1238 AddFrame( NULL,GTK_SHADOW_NONE, |
1239 AddFrame( MSGTR_PREFERENCES_FRAME_PostProcess,GTK_SHADOW_ETCHED_OUT,vbox601,0 ),1 ),0 ); | |
1240 | |
1241 CBPostprocess=AddCheckButton( MSGTR_PREFERENCES_PostProcess,vbox602 ); | |
1242 | |
1243 hbox5=AddHBox( vbox602,1 ); | |
1244 | |
1245 AddLabel( MSGTR_PREFERENCES_AutoQuality,hbox5 ); | |
1246 | |
1247 if ( guiIntfStruct.sh_video && guiIntfStruct.Playing ) HSPPQualityadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,get_video_quality_max( guiIntfStruct.sh_video ),0,0,0 ) ); | |
1248 else HSPPQualityadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,100,0,0,0 ) ); | |
1249 HSPPQuality=AddHScaler( HSPPQualityadj,hbox5,0 ); | |
1250 | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28232
diff
changeset
|
1251 vbox602=AddVBox( |
23077 | 1252 AddFrame( NULL,GTK_SHADOW_NONE, |
1253 AddFrame( MSGTR_PREFERENCES_FRAME_Cache,GTK_SHADOW_ETCHED_OUT,vbox601,0 ),1 ),0 ); | |
1254 | |
1255 CBCache=AddCheckButton( MSGTR_PREFERENCES_Cache,vbox602 ); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28232
diff
changeset
|
1256 |
23077 | 1257 hbox5=AddHBox( vbox602,1 ); |
1258 | |
1259 AddLabel( MSGTR_PREFERENCES_CacheSize,hbox5 ); | |
1260 | |
1261 SBCacheadj=GTK_ADJUSTMENT( gtk_adjustment_new( 2048,4,65535,1,10,10 ) ); | |
1262 SBCache=gtk_spin_button_new( GTK_ADJUSTMENT( SBCacheadj ),1,0 ); | |
1263 gtk_widget_show( SBCache ); | |
1264 gtk_box_pack_start( GTK_BOX( hbox5 ),SBCache,TRUE,TRUE,0 ); | |
1265 | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28232
diff
changeset
|
1266 vbox602=AddVBox( |
23077 | 1267 AddFrame( NULL,GTK_SHADOW_NONE, |
1268 AddFrame( MSGTR_PREFERENCES_FRAME_Misc,GTK_SHADOW_ETCHED_OUT,vbox601,1 ),1 ),0 ); | |
1269 | |
1270 CBShowVideoWindow=AddCheckButton( MSGTR_PREFERENCES_ShowVideoWindow,vbox602 ); | |
1271 CBLoadFullscreen=AddCheckButton( MSGTR_PREFERENCES_LoadFullscreen,vbox602 ); | |
1272 CBSaveWinPos=AddCheckButton( MSGTR_PREFERENCES_SaveWinPos,vbox602 ); | |
1273 CBStopXScreenSaver=AddCheckButton( MSGTR_PREFERENCES_XSCREENSAVER,vbox602 ); | |
1274 CBPlayBar=AddCheckButton( MSGTR_PREFERENCES_PlayBar,vbox602 ); | |
1275 | |
1276 AddHSeparator( vbox602 ); | |
1277 | |
1278 CBAutoSync=AddCheckButton( MSGTR_PREFERENCES_AutoSync,vbox602 ); | |
1279 hbox5=AddHBox( vbox602,1 ); | |
1280 AddLabel( MSGTR_PREFERENCES_AutoSyncValue,hbox5 ); | |
1281 SBAutoSyncadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,10000,1,10,10 ) ); | |
1282 SBAutoSync=gtk_spin_button_new( GTK_ADJUSTMENT( SBAutoSyncadj ),1,0 ); | |
1283 gtk_widget_show( SBAutoSync ); | |
1284 gtk_box_pack_start( GTK_BOX( hbox5 ),SBAutoSync,TRUE,TRUE,0 ); | |
1285 | |
1286 AddHSeparator( vbox602 ); | |
1287 | |
1288 table1=gtk_table_new( 2,2,FALSE ); | |
1289 gtk_widget_set_name( table1,"table1" ); | |
1290 gtk_widget_show( table1 ); | |
1291 gtk_box_pack_start( GTK_BOX( vbox602 ),table1,FALSE,FALSE,0 ); | |
1292 | |
1293 label=AddLabel( MSGTR_PREFERENCES_DVDDevice,NULL ); | |
1294 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1295 prEDVDDevice=gtk_entry_new(); | |
1296 gtk_widget_set_name( prEDVDDevice,"prEDVDDevice" ); | |
1297 gtk_widget_show( prEDVDDevice ); | |
1298 gtk_table_attach( GTK_TABLE( table1 ),prEDVDDevice,1,2,0,1,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1299 | |
1300 label=AddLabel( MSGTR_PREFERENCES_CDROMDevice,NULL ); | |
1301 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1302 prECDRomDevice=gtk_entry_new(); | |
1303 gtk_widget_set_name( prECDRomDevice,"prECDRomDevice" ); | |
1304 gtk_widget_show( prECDRomDevice ); | |
1305 gtk_table_attach( GTK_TABLE( table1 ),prECDRomDevice,1,2,1,2,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1306 | |
1307 // AddHSeparator( vbox602 ); | |
1308 | |
1309 label=AddLabel( MSGTR_PREFERENCES_Misc,NULL ); | |
1310 gtk_notebook_set_tab_label( GTK_NOTEBOOK( notebook1 ),gtk_notebook_get_nth_page( GTK_NOTEBOOK( notebook1 ),5 ),label ); | |
1311 | |
1312 // --- | |
1313 | |
1314 AddHSeparator( vbox1 ); | |
1315 | |
1316 hbuttonbox1=AddHButtonBox( vbox1 ); | |
1317 gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox1 ),GTK_BUTTONBOX_END ); | |
1318 gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox1 ),10 ); | |
1319 BOk=AddButton( MSGTR_Ok,hbuttonbox1 ); | |
1320 BCancel=AddButton( MSGTR_Cancel,hbuttonbox1 ); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28232
diff
changeset
|
1321 |
23077 | 1322 gtk_widget_add_accelerator( BOk,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE ); |
1323 gtk_widget_add_accelerator( BCancel,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE ); | |
1324 | |
1325 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
|
1326 |
23077 | 1327 gtk_signal_connect( GTK_OBJECT( AConfig ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void*)bAConfig ); |
1328 gtk_signal_connect( GTK_OBJECT( BOk ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void*)bOk ); | |
1329 gtk_signal_connect( GTK_OBJECT( BCancel ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void*)bCancel ); | |
1330 gtk_signal_connect( GTK_OBJECT( VConfig ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void*)bVconfig ); | |
1331 #if 0 | |
1332 gtk_signal_connect( GTK_OBJECT( BLoadSubtitle ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void*)bLSubtitle ); | |
1333 #endif | |
1334 gtk_signal_connect( GTK_OBJECT( BLoadFont ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void*)bLFont ); | |
1335 | |
1336 #if 0 | |
1337 gtk_signal_connect( GTK_OBJECT( CBNormalize ),"toggled",GTK_SIGNAL_FUNC( on_CBNormalize_toggled ),NULL ); | |
1338 gtk_signal_connect( GTK_OBJECT( CBSoftwareMixer ),"toggled",GTK_SIGNAL_FUNC( on_CBSoftwareMixer_toggled ),NULL ); | |
1339 gtk_signal_connect( GTK_OBJECT( CBSurround ),"toggled",GTK_SIGNAL_FUNC( on_CBSurround_toggled ),NULL ); | |
1340 gtk_signal_connect( GTK_OBJECT( CBExtraStereo ),"toggled",GTK_SIGNAL_FUNC( on_CBExtraStereo_toggled ),NULL ); | |
1341 gtk_signal_connect( GTK_OBJECT( CBDoubleBuffer ),"toggled",GTK_SIGNAL_FUNC( on_CBDoubleBuffer_toggled ),NULL ); | |
1342 gtk_signal_connect( GTK_OBJECT( CBDR ),"toggled",GTK_SIGNAL_FUNC( on_CBDR_toggled ),NULL ); | |
1343 gtk_signal_connect( GTK_OBJECT( CBFramedrop ),"toggled",GTK_SIGNAL_FUNC( on_CBFramedrop_toggled ),NULL ); | |
1344 gtk_signal_connect( GTK_OBJECT( CBHFramedrop ),"toggled",GTK_SIGNAL_FUNC( on_CBHFramedrop_toggled ),NULL ); | |
1345 gtk_signal_connect( GTK_OBJECT( CBFullScreen ),"toggled",GTK_SIGNAL_FUNC( on_CBFullScreen_toggled ),NULL ); | |
1346 gtk_signal_connect( GTK_OBJECT( CBNonInterlaved ),"toggled",GTK_SIGNAL_FUNC( on_CBNonInterlaved_toggled ),NULL ); | |
1347 gtk_signal_connect( GTK_OBJECT( CBFlip ),"toggled",GTK_SIGNAL_FUNC( on_CBFlip_toggled ),NULL ); | |
1348 gtk_signal_connect( GTK_OBJECT( CBPostprocess ),"toggled",GTK_SIGNAL_FUNC( on_CBPostprocess_toggled ),NULL ); | |
1349 gtk_signal_connect( GTK_OBJECT( CBNoAutoSub ),"toggled",GTK_SIGNAL_FUNC( on_CBNoAutoSub_toggled ),NULL ); | |
1350 gtk_signal_connect( GTK_OBJECT( CBSubUnicode ),"toggled",GTK_SIGNAL_FUNC( on_CNSubUnicode_toggled ),NULL ); | |
1351 gtk_signal_connect( GTK_OBJECT( CBDumpMPSub ),"toggled",GTK_SIGNAL_FUNC( on_CBDumpMPSub_toggled ),NULL ); | |
1352 gtk_signal_connect( GTK_OBJECT( CBDumpSrt ),"toggled",GTK_SIGNAL_FUNC( on_CBDumpSrt_toggled ),NULL ); | |
1353 #endif | |
1354 #if 0 | |
1355 gtk_signal_connect( GTK_OBJECT( RBOSDNone ),"toggled",GTK_SIGNAL_FUNC( on_RBOSDNone_toggled ),NULL ); | |
1356 gtk_signal_connect( GTK_OBJECT( RBOSDTandP ),"toggled",GTK_SIGNAL_FUNC( on_RBOSDTandP_toggled ),NULL ); | |
1357 gtk_signal_connect( GTK_OBJECT( RBOSDIndicator ),"toggled",GTK_SIGNAL_FUNC( on_RBOSDIndicator_toggled ),NULL ); | |
1358 gtk_signal_connect( GTK_OBJECT( RBOSDTPTT ),"toggled",GTK_SIGNAL_FUNC( on_RBOSDIndicator_toggled ),NULL ); | |
1359 gtk_signal_connect( GTK_OBJECT( CBAudioEqualizer ),"toggled",GTK_SIGNAL_FUNC( on_CBAudioEqualizer_toggled ),NULL ); | |
1360 #endif | |
1361 #if 0 | |
1362 gtk_signal_connect( GTK_OBJECT( HSAudioDelay ),"motion_notify_event",GTK_SIGNAL_FUNC( on_HSAudioDelay_motion_notify_event ),NULL ); | |
1363 gtk_signal_connect( GTK_OBJECT( HSPanscan ),"motion_notify_event",GTK_SIGNAL_FUNC( on_HSPanscan_motion_notify_event ),NULL ); | |
1364 gtk_signal_connect( GTK_OBJECT( label2 ),"motion_notify_event",GTK_SIGNAL_FUNC( on_label2_motion_notify_event ),NULL ); | |
1365 gtk_signal_connect( GTK_OBJECT( HSSubDelay ),"motion_notify_event",GTK_SIGNAL_FUNC( on_HSSubDelay_motion_notify_event ),NULL ); | |
1366 gtk_signal_connect( GTK_OBJECT( HSSubPosition ),"motion_notify_event",GTK_SIGNAL_FUNC( on_HSSubPosition_motion_notify_event ),NULL ); | |
1367 gtk_signal_connect( GTK_OBJECT( HSSubFPS ),"motion_notify_event",GTK_SIGNAL_FUNC( on_HSSubFPS_motion_notify_event ),NULL ); | |
1368 gtk_signal_connect( GTK_OBJECT( HSFontFactor ),"motion_notify_event",GTK_SIGNAL_FUNC( on_HSFontFactor_motion_notify_event ),NULL ); | |
1369 gtk_signal_connect( GTK_OBJECT( HSPPQuality ),"motion_notify_event",GTK_SIGNAL_FUNC( on_HSPPQuality_motion_notify_event ),NULL ); | |
1370 #endif | |
1371 | |
1372 gtk_notebook_set_page( GTK_NOTEBOOK( notebook1 ),2 ); | |
1373 | |
1374 gtk_window_add_accel_group( GTK_WINDOW( Preferences ),accel_group ); | |
1375 | |
1376 return Preferences; | |
1377 } | |
1378 | |
27341
e7c989f7a7c9
Start unifying names of internal preprocessor directives.
diego
parents:
26458
diff
changeset
|
1379 #ifdef CONFIG_OSS_AUDIO |
30535
016e5fc1dead
GUI: Mark functions that are not used outside their files as static.
diego
parents:
29263
diff
changeset
|
1380 static GList *appendOSSDevices(GList *l) |
016e5fc1dead
GUI: Mark functions that are not used outside their files as static.
diego
parents:
29263
diff
changeset
|
1381 { |
23077 | 1382 // careful! the current implementation allows only string constants! |
1383 l = g_list_append(l, (gpointer)"/dev/dsp"); | |
1384 if (gtkAOOSSDevice && strncmp(gtkAOOSSDevice, "/dev/sound", 10) == 0) { | |
1385 l = g_list_append(l, (gpointer)"/dev/sound/dsp0"); | |
1386 l = g_list_append(l, (gpointer)"/dev/sound/dsp1"); | |
1387 l = g_list_append(l, (gpointer)"/dev/sound/dsp2"); | |
1388 l = g_list_append(l, (gpointer)"/dev/sound/dsp3"); | |
1389 } else { | |
1390 l = g_list_append(l, (gpointer)"/dev/dsp0"); | |
1391 l = g_list_append(l, (gpointer)"/dev/dsp1"); | |
1392 l = g_list_append(l, (gpointer)"/dev/dsp2"); | |
1393 l = g_list_append(l, (gpointer)"/dev/dsp3"); | |
1394 } | |
27370
14c5017f40d2
Change a bunch of video/audio-output-specific preprocessor directives from
diego
parents:
27359
diff
changeset
|
1395 #ifdef CONFIG_DXR3 |
23077 | 1396 l = g_list_append(l, (gpointer)"/dev/em8300_ma"); |
1397 l = g_list_append(l, (gpointer)"/dev/em8300_ma-0"); | |
1398 l = g_list_append(l, (gpointer)"/dev/em8300_ma-1"); | |
1399 l = g_list_append(l, (gpointer)"/dev/em8300_ma-2"); | |
1400 l = g_list_append(l, (gpointer)"/dev/em8300_ma-3"); | |
1401 #endif | |
1402 return l; | |
1403 } | |
1404 | |
30535
016e5fc1dead
GUI: Mark functions that are not used outside their files as static.
diego
parents:
29263
diff
changeset
|
1405 static GList *appendOSSMixers(GList *l) |
016e5fc1dead
GUI: Mark functions that are not used outside their files as static.
diego
parents:
29263
diff
changeset
|
1406 { |
23077 | 1407 // careful! the current implementation allows only string constants! |
1408 l = g_list_append(l, (gpointer)"/dev/mixer"); | |
1409 if (gtkAOOSSMixer && strncmp(gtkAOOSSMixer, "/dev/sound", 10) == 0) { | |
1410 l = g_list_append(l, (gpointer)"/dev/sound/mixer0"); | |
1411 l = g_list_append(l, (gpointer)"/dev/sound/mixer1"); | |
1412 l = g_list_append(l, (gpointer)"/dev/sound/mixer2"); | |
1413 l = g_list_append(l, (gpointer)"/dev/sound/mixer3"); | |
1414 } else { | |
1415 l = g_list_append(l, (gpointer)"/dev/mixer0"); | |
1416 l = g_list_append(l, (gpointer)"/dev/mixer1"); | |
1417 l = g_list_append(l, (gpointer)"/dev/mixer2"); | |
1418 l = g_list_append(l, (gpointer)"/dev/mixer3"); | |
1419 } | |
1420 return l; | |
1421 } | |
1422 | |
30535
016e5fc1dead
GUI: Mark functions that are not used outside their files as static.
diego
parents:
29263
diff
changeset
|
1423 static GList *appendOSSMixerChannels(GList *l) |
016e5fc1dead
GUI: Mark functions that are not used outside their files as static.
diego
parents:
29263
diff
changeset
|
1424 { |
23077 | 1425 l = g_list_append(l, (gpointer)"vol"); |
1426 l = g_list_append(l, (gpointer)"pcm"); | |
1427 l = g_list_append(l, (gpointer)"line"); | |
1428 return l; | |
1429 } | |
1430 #endif | |
1431 | |
27390
9d95dc936e66
Introduce CONFIG_ALSA preprocessor directive for ALSA 0.9 and 1.x.
diego
parents:
27387
diff
changeset
|
1432 #ifdef CONFIG_ALSA |
30535
016e5fc1dead
GUI: Mark functions that are not used outside their files as static.
diego
parents:
29263
diff
changeset
|
1433 static GList *appendALSADevices(GList *l) |
016e5fc1dead
GUI: Mark functions that are not used outside their files as static.
diego
parents:
29263
diff
changeset
|
1434 { |
23077 | 1435 l = g_list_append(l, (gpointer)"default"); |
1436 l = g_list_append(l, (gpointer)"hw=0.0"); | |
1437 l = g_list_append(l, (gpointer)"hw=0.1"); | |
1438 l = g_list_append(l, (gpointer)"hw=0.2"); | |
1439 l = g_list_append(l, (gpointer)"surround40"); | |
1440 l = g_list_append(l, (gpointer)"surround51"); | |
1441 l = g_list_append(l, (gpointer)"plug=surround40"); | |
1442 l = g_list_append(l, (gpointer)"plug=surround51"); | |
1443 return l; | |
1444 } | |
1445 | |
30535
016e5fc1dead
GUI: Mark functions that are not used outside their files as static.
diego
parents:
29263
diff
changeset
|
1446 static GList *appendALSAMixers(GList *l) |
016e5fc1dead
GUI: Mark functions that are not used outside their files as static.
diego
parents:
29263
diff
changeset
|
1447 { |
23077 | 1448 l = g_list_append(l, (gpointer)"default"); |
1449 return l; | |
1450 } | |
1451 | |
30535
016e5fc1dead
GUI: Mark functions that are not used outside their files as static.
diego
parents:
29263
diff
changeset
|
1452 static GList *appendALSAMixerChannels(GList *l) |
016e5fc1dead
GUI: Mark functions that are not used outside their files as static.
diego
parents:
29263
diff
changeset
|
1453 { |
23077 | 1454 l = g_list_append(l, (gpointer)"Master"); |
1455 l = g_list_append(l, (gpointer)"Line"); | |
1456 l = g_list_append(l, (gpointer)"PCM"); | |
1457 l = g_list_append(l, (gpointer)"PCM,1"); | |
1458 return l; | |
1459 } | |
1460 #endif | |
1461 | |
27370
14c5017f40d2
Change a bunch of video/audio-output-specific preprocessor directives from
diego
parents:
27359
diff
changeset
|
1462 #ifdef CONFIG_SDL |
30535
016e5fc1dead
GUI: Mark functions that are not used outside their files as static.
diego
parents:
29263
diff
changeset
|
1463 static GList *appendSDLDevices(GList *l) |
016e5fc1dead
GUI: Mark functions that are not used outside their files as static.
diego
parents:
29263
diff
changeset
|
1464 { |
23077 | 1465 l = g_list_append(l, (gpointer)"alsa"); |
1466 l = g_list_append(l, (gpointer)"arts"); | |
1467 l = g_list_append(l, (gpointer)"esd"); | |
1468 l = g_list_append(l, (gpointer)"jack"); | |
1469 l = g_list_append(l, (gpointer)"oss"); | |
1470 l = g_list_append(l, (gpointer)"nas"); | |
1471 return l; | |
1472 } | |
1473 #endif | |
1474 | |
27341
e7c989f7a7c9
Start unifying names of internal preprocessor directives.
diego
parents:
26458
diff
changeset
|
1475 #ifdef CONFIG_ESD |
30535
016e5fc1dead
GUI: Mark functions that are not used outside their files as static.
diego
parents:
29263
diff
changeset
|
1476 static GList *appendESDDevices(GList *l) |
016e5fc1dead
GUI: Mark functions that are not used outside their files as static.
diego
parents:
29263
diff
changeset
|
1477 { |
23077 | 1478 l = g_list_append(l, (gpointer)"Enter Remote IP"); |
1479 l = g_list_append(l, (gpointer)"Use Software Mixer"); | |
1480 return l; | |
1481 } | |
1482 #endif | |
1483 | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28232
diff
changeset
|
1484 // Gets text string from a gtk entry, interpreting |
23077 | 1485 // 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
|
1486 static const char *getGtkEntryText(GtkWidget *from) |
016e5fc1dead
GUI: Mark functions that are not used outside their files as static.
diego
parents:
29263
diff
changeset
|
1487 { |
23624
f86b9bcf2d03
Return value of gtk_entry_get_text is const, so declare variables as const as well.
reimar
parents:
23154
diff
changeset
|
1488 const char *tmp = gtk_entry_get_text(GTK_ENTRY(from)); |
23077 | 1489 if (strcmp(tmp, MSGTR_PREFERENCES_DriverDefault) == 0) { |
1490 tmp = NULL; | |
1491 } | |
1492 return tmp; | |
1493 } | |
1494 | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28232
diff
changeset
|
1495 // Sets text string of a gtk entry, interpreting |
23077 | 1496 // 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
|
1497 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
|
1498 { |
23077 | 1499 if (!to) { |
1500 to = MSGTR_PREFERENCES_DriverDefault; | |
1501 } | |
1502 gtk_entry_set_text(GTK_ENTRY(dest),to); | |
1503 } | |
1504 | |
1505 GtkWidget *AudioConfig; | |
1506 static GtkWidget *CEAudioDevice; | |
1507 static GtkWidget *CBAudioDevice; | |
1508 static GtkWidget *CEAudioMixer; | |
1509 static GtkWidget *CBAudioMixer; | |
1510 static GtkWidget *CEAudioMixerChannel; | |
1511 static GtkWidget *CBAudioMixerChannel; | |
1512 static GtkWidget *BAudioOk; | |
1513 static GtkWidget *BAudioCancel; | |
1514 | |
28232
8df85ad26746
Add missing 'void' keyword to parameterless function declarations.
diego
parents:
27393
diff
changeset
|
1515 void ShowAudioConfig( void ) { |
23077 | 1516 if (AudioConfig) gtkActive(AudioConfig); |
1517 else AudioConfig = create_AudioConfig(); | |
1518 | |
27341
e7c989f7a7c9
Start unifying names of internal preprocessor directives.
diego
parents:
26458
diff
changeset
|
1519 #ifdef CONFIG_OSS_AUDIO |
23077 | 1520 if (strncmp(ao_driver[0], "oss", 3) == 0) { |
1521 setGtkEntryText(CEAudioDevice, gtkAOOSSDevice); | |
1522 setGtkEntryText(CEAudioMixer, gtkAOOSSMixer); | |
1523 setGtkEntryText(CEAudioMixerChannel, gtkAOOSSMixerChannel); | |
1524 } | |
1525 #endif | |
27390
9d95dc936e66
Introduce CONFIG_ALSA preprocessor directive for ALSA 0.9 and 1.x.
diego
parents:
27387
diff
changeset
|
1526 #ifdef CONFIG_ALSA |
23077 | 1527 if (strncmp(ao_driver[0], "alsa", 4) == 0) { |
1528 setGtkEntryText(CEAudioDevice, gtkAOALSADevice); | |
1529 setGtkEntryText(CEAudioMixer, gtkAOALSAMixer); | |
1530 setGtkEntryText(CEAudioMixerChannel, gtkAOALSAMixerChannel); | |
1531 } | |
1532 #endif | |
27370
14c5017f40d2
Change a bunch of video/audio-output-specific preprocessor directives from
diego
parents:
27359
diff
changeset
|
1533 #ifdef CONFIG_SDL |
23077 | 1534 if (strncmp(ao_driver[0], "sdl", 3) == 0) { |
1535 setGtkEntryText(CEAudioDevice, gtkAOSDLDriver); | |
1536 } | |
1537 #endif | |
27341
e7c989f7a7c9
Start unifying names of internal preprocessor directives.
diego
parents:
26458
diff
changeset
|
1538 #ifdef CONFIG_ESD |
23077 | 1539 if (strncmp(ao_driver[0], "esd", 3) == 0) { |
1540 setGtkEntryText(CEAudioDevice, gtkAOESDDevice); | |
1541 } | |
1542 #endif | |
1543 | |
1544 gtk_widget_show(AudioConfig); | |
1545 gtkSetLayer(AudioConfig); | |
1546 } | |
1547 | |
28232
8df85ad26746
Add missing 'void' keyword to parameterless function declarations.
diego
parents:
27393
diff
changeset
|
1548 void HideAudioConfig( void ) { |
23077 | 1549 if (!AudioConfig) return; |
1550 gtk_widget_hide(AudioConfig); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28232
diff
changeset
|
1551 gtk_widget_destroy(AudioConfig); |
23077 | 1552 AudioConfig=NULL; |
1553 } | |
1554 | |
1555 static void audioButton(GtkButton *button, gpointer user_data) { | |
1556 switch( (int)user_data ) { | |
1557 case 1: | |
27341
e7c989f7a7c9
Start unifying names of internal preprocessor directives.
diego
parents:
26458
diff
changeset
|
1558 #ifdef CONFIG_OSS_AUDIO |
23077 | 1559 if (strncmp(ao_driver[0], "oss", 3) == 0) { |
32741 | 1560 gfree((void **) >kAOOSSDevice); |
23077 | 1561 gtkAOOSSDevice = gstrdup(getGtkEntryText(CEAudioDevice)); |
32741 | 1562 gfree((void **) >kAOOSSMixer); |
23077 | 1563 gtkAOOSSMixer = gstrdup(getGtkEntryText(CEAudioMixer)); |
32741 | 1564 gfree((void **) >kAOOSSMixerChannel); |
23077 | 1565 gtkAOOSSMixerChannel = gstrdup(getGtkEntryText(CEAudioMixerChannel)); |
1566 } | |
1567 #endif | |
27390
9d95dc936e66
Introduce CONFIG_ALSA preprocessor directive for ALSA 0.9 and 1.x.
diego
parents:
27387
diff
changeset
|
1568 #ifdef CONFIG_ALSA |
23077 | 1569 if (strncmp(ao_driver[0], "alsa", 4) == 0) { |
32741 | 1570 gfree((void **) >kAOALSADevice); |
23077 | 1571 gtkAOALSADevice = gstrdup(getGtkEntryText(CEAudioDevice)); |
32741 | 1572 gfree((void **) >kAOALSAMixer); |
23077 | 1573 gtkAOALSAMixer = gstrdup(getGtkEntryText(CEAudioMixer)); |
32741 | 1574 gfree((void **) >kAOALSAMixerChannel); |
23077 | 1575 gtkAOALSAMixerChannel = gstrdup(getGtkEntryText(CEAudioMixerChannel)); |
1576 } | |
1577 #endif | |
27370
14c5017f40d2
Change a bunch of video/audio-output-specific preprocessor directives from
diego
parents:
27359
diff
changeset
|
1578 #ifdef CONFIG_SDL |
23077 | 1579 if (strncmp(ao_driver[0], "sdl", 3) == 0) { |
32741 | 1580 gfree((void **) >kAOSDLDriver); |
23077 | 1581 gtkAOSDLDriver = gstrdup(getGtkEntryText(CEAudioDevice)); |
1582 } | |
1583 #endif | |
27341
e7c989f7a7c9
Start unifying names of internal preprocessor directives.
diego
parents:
26458
diff
changeset
|
1584 #ifdef CONFIG_ESD |
23077 | 1585 if (strncmp(ao_driver[0], "esd", 3) == 0) { |
32741 | 1586 gfree((void **) >kAOESDDevice); |
23077 | 1587 gtkAOESDDevice = gstrdup(getGtkEntryText(CEAudioDevice)); |
1588 } | |
1589 #endif | |
1590 case 0: | |
1591 HideAudioConfig(); | |
1592 break; | |
1593 } | |
1594 } | |
1595 | |
28232
8df85ad26746
Add missing 'void' keyword to parameterless function declarations.
diego
parents:
27393
diff
changeset
|
1596 GtkWidget *create_AudioConfig( void ) { |
23077 | 1597 GList *items = NULL; |
1598 GtkWidget *vbox; | |
1599 GtkWidget *table; | |
1600 GtkWidget *label; | |
1601 GtkWidget *hbuttonbox; | |
1602 GtkAccelGroup *accel_group; | |
1603 | |
1604 AudioConfig = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
1605 gtk_widget_set_name(AudioConfig, "AudioConfig"); | |
1606 gtk_object_set_data(GTK_OBJECT(AudioConfig), "AudioConfig", AudioConfig); | |
1607 gtk_window_set_title(GTK_WINDOW(AudioConfig), MSGTR_AudioPreferences); | |
1608 gtk_window_set_position(GTK_WINDOW(AudioConfig), GTK_WIN_POS_CENTER); | |
1609 gtk_window_set_policy(GTK_WINDOW(AudioConfig), FALSE, FALSE, FALSE); | |
1610 gtk_window_set_wmclass(GTK_WINDOW(AudioConfig), "Audio Config", "MPlayer"); | |
1611 | |
1612 gtk_widget_realize(AudioConfig); | |
1613 gtkAddIcon(AudioConfig); | |
1614 | |
1615 vbox = AddVBox(AddDialogFrame(AudioConfig), 0); | |
1616 | |
1617 table = gtk_table_new(2, 3, FALSE); | |
1618 gtk_widget_set_name(table, "table"); | |
1619 gtk_widget_show(table); | |
1620 gtk_box_pack_start(GTK_BOX(vbox), table, TRUE, TRUE, 0); | |
1621 | |
1622 label = AddLabel(MSGTR_PREFERENCES_Audio_Device, NULL); | |
1623 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(0), 0, 0); | |
1624 | |
1625 CBAudioDevice = AddComboBox(NULL); | |
1626 gtk_table_attach(GTK_TABLE(table), CBAudioDevice, 1, 2, 0, 1, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)(0), 0, 0); | |
1627 items = g_list_append(items,(gpointer)MSGTR_PREFERENCES_DriverDefault); | |
27341
e7c989f7a7c9
Start unifying names of internal preprocessor directives.
diego
parents:
26458
diff
changeset
|
1628 #ifdef CONFIG_OSS_AUDIO |
23077 | 1629 if (strncmp(ao_driver[0], "oss", 3) == 0) |
1630 items = appendOSSDevices(items); | |
1631 #endif | |
27390
9d95dc936e66
Introduce CONFIG_ALSA preprocessor directive for ALSA 0.9 and 1.x.
diego
parents:
27387
diff
changeset
|
1632 #ifdef CONFIG_ALSA |
23077 | 1633 if (strncmp(ao_driver[0], "alsa", 4) == 0) |
1634 items = appendALSADevices(items); | |
1635 #endif | |
27370
14c5017f40d2
Change a bunch of video/audio-output-specific preprocessor directives from
diego
parents:
27359
diff
changeset
|
1636 #ifdef CONFIG_SDL |
23077 | 1637 if (strncmp(ao_driver[0], "sdl", 3) == 0) |
1638 items = appendSDLDevices(items); | |
1639 #endif | |
27341
e7c989f7a7c9
Start unifying names of internal preprocessor directives.
diego
parents:
26458
diff
changeset
|
1640 #ifdef CONFIG_ESD |
23077 | 1641 if (strncmp(ao_driver[0], "esd", 3) == 0) |
1642 items = appendESDDevices(items); | |
1643 #endif | |
1644 gtk_combo_set_popdown_strings(GTK_COMBO(CBAudioDevice), items); | |
1645 g_list_free(items); | |
1646 items = NULL; | |
1647 | |
1648 CEAudioDevice = GTK_COMBO(CBAudioDevice)->entry; | |
1649 gtk_widget_set_name(CEAudioDevice, "CEAudioDevice"); | |
1650 gtk_widget_show(CEAudioDevice); | |
1651 | |
1652 label = AddLabel(MSGTR_PREFERENCES_Audio_Mixer, NULL); | |
1653 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(0), 0, 0); | |
1654 | |
1655 CBAudioMixer = AddComboBox(NULL); | |
1656 gtk_table_attach(GTK_TABLE(table), CBAudioMixer, 1, 2, 1, 2, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)(0), 0, 0); | |
1657 items = g_list_append(items, (gpointer)MSGTR_PREFERENCES_DriverDefault); | |
27341
e7c989f7a7c9
Start unifying names of internal preprocessor directives.
diego
parents:
26458
diff
changeset
|
1658 #ifdef CONFIG_OSS_AUDIO |
23077 | 1659 if (strncmp(ao_driver[0], "oss", 3) == 0) |
1660 items = appendOSSMixers(items); | |
1661 #endif | |
27390
9d95dc936e66
Introduce CONFIG_ALSA preprocessor directive for ALSA 0.9 and 1.x.
diego
parents:
27387
diff
changeset
|
1662 #ifdef CONFIG_ALSA |
23077 | 1663 if (strncmp(ao_driver[0], "alsa", 4) == 0) |
1664 items = appendALSAMixers(items); | |
1665 #endif | |
1666 gtk_combo_set_popdown_strings(GTK_COMBO(CBAudioMixer), items); | |
1667 g_list_free(items); | |
1668 items = NULL; | |
1669 | |
1670 CEAudioMixer = GTK_COMBO(CBAudioMixer)->entry; | |
1671 gtk_widget_set_name(CEAudioMixer, "CEAudioMixer"); | |
1672 gtk_widget_show(CEAudioMixer); | |
1673 | |
1674 label = AddLabel(MSGTR_PREFERENCES_Audio_MixerChannel, NULL); | |
1675 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3, (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(0), 0, 0); | |
1676 | |
1677 CBAudioMixerChannel = AddComboBox(NULL); | |
1678 gtk_table_attach(GTK_TABLE(table), CBAudioMixerChannel, 1, 2, 2, 3, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)(0), 0, 0); | |
1679 items = g_list_append(items, (gpointer)MSGTR_PREFERENCES_DriverDefault); | |
27341
e7c989f7a7c9
Start unifying names of internal preprocessor directives.
diego
parents:
26458
diff
changeset
|
1680 #ifdef CONFIG_OSS_AUDIO |
23077 | 1681 if (strncmp(ao_driver[0], "oss", 3) == 0) |
1682 items = appendOSSMixerChannels(items); | |
1683 #endif | |
27390
9d95dc936e66
Introduce CONFIG_ALSA preprocessor directive for ALSA 0.9 and 1.x.
diego
parents:
27387
diff
changeset
|
1684 #ifdef CONFIG_ALSA |
23077 | 1685 if (strncmp(ao_driver[0], "alsa", 4) == 0) |
1686 items = appendALSAMixerChannels(items); | |
1687 #endif | |
1688 gtk_combo_set_popdown_strings(GTK_COMBO(CBAudioMixerChannel), items); | |
1689 g_list_free(items); | |
1690 items = NULL; | |
1691 | |
1692 CEAudioMixerChannel = GTK_COMBO(CBAudioMixerChannel)->entry; | |
1693 gtk_widget_set_name(CEAudioMixerChannel, "CEAudioMixerChannel"); | |
1694 gtk_widget_show(CEAudioMixerChannel); | |
1695 | |
1696 AddHSeparator(vbox); | |
1697 | |
1698 hbuttonbox = AddHButtonBox(vbox); | |
1699 gtk_button_box_set_layout(GTK_BUTTON_BOX(hbuttonbox), GTK_BUTTONBOX_END); | |
1700 gtk_button_box_set_spacing(GTK_BUTTON_BOX(hbuttonbox), 10); | |
1701 BAudioOk = AddButton(MSGTR_Ok, hbuttonbox); | |
1702 BAudioCancel = AddButton(MSGTR_Cancel, hbuttonbox); | |
1703 | |
1704 gtk_signal_connect(GTK_OBJECT(AudioConfig), "destroy", GTK_SIGNAL_FUNC(WidgetDestroy), &AudioConfig); | |
1705 gtk_signal_connect(GTK_OBJECT(BAudioOk), "clicked", GTK_SIGNAL_FUNC(audioButton), (void*)1); | |
1706 gtk_signal_connect(GTK_OBJECT(BAudioCancel), "clicked", GTK_SIGNAL_FUNC(audioButton), (void*)0); | |
1707 | |
1708 accel_group = gtk_accel_group_new(); | |
1709 gtk_widget_add_accelerator(BAudioOk, "clicked", accel_group, GDK_Return, 0, GTK_ACCEL_VISIBLE); | |
1710 gtk_widget_add_accelerator(BAudioCancel, "clicked", accel_group, GDK_Escape, 0, GTK_ACCEL_VISIBLE); | |
1711 gtk_window_add_accel_group(GTK_WINDOW(AudioConfig), accel_group); | |
1712 | |
1713 return AudioConfig; | |
1714 } | |
1715 | |
27370
14c5017f40d2
Change a bunch of video/audio-output-specific preprocessor directives from
diego
parents:
27359
diff
changeset
|
1716 #ifdef CONFIG_DXR3 |
23077 | 1717 // --- dxr3 config box |
1718 | |
1719 static GtkWidget * DXR3Config; | |
1720 static GtkWidget * CBDevice; | |
1721 static GtkWidget * CEDXR3Device; | |
1722 static GtkWidget * RBVNone; | |
32117 | 1723 static GtkWidget * RBVLavc; |
23077 | 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 ); | |
1737 if ( gtkVfLAVC ) gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( RBVLavc ),TRUE ); | |
1738 | |
1739 gtk_widget_show( DXR3Config ); | |
1740 gtkSetLayer( DXR3Config ); | |
1741 } | |
1742 | |
1743 void HideDXR3Config( void ) | |
1744 { | |
1745 if ( !DXR3Config ) return; | |
1746 gtk_widget_hide( DXR3Config ); | |
1747 gtk_widget_destroy( DXR3Config ); | |
1748 DXR3Config=NULL; | |
1749 } | |
1750 | |
1751 static void dxr3Button( GtkButton * button,gpointer user_data ) | |
1752 { | |
1753 switch ( (int)user_data ) | |
1754 { | |
1755 case 0: // Ok | |
1756 gfree( (void **)>kDXR3Device ); gtkDXR3Device=strdup( gtk_entry_get_text( GTK_ENTRY( CEDXR3Device ) ) ); | |
1757 gtkVfLAVC=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBVLavc ) ); | |
1758 case 1: // Cancel | |
1759 HideDXR3Config(); | |
1760 break; | |
1761 } | |
1762 } | |
1763 | |
1764 GtkWidget * create_DXR3Config( void ) | |
1765 { | |
1766 GtkWidget * vbox1; | |
1767 GtkWidget * vbox2; | |
1768 GtkWidget * hbox1; | |
1769 GList * CBDevice_items = NULL; | |
1770 GtkWidget * vbox3; | |
1771 GSList * VEncoder_group = NULL; | |
1772 GtkWidget * hbuttonbox1; | |
1773 GtkAccelGroup * accel_group; | |
1774 | |
1775 accel_group=gtk_accel_group_new(); | |
1776 | |
1777 DXR3Config=gtk_window_new( GTK_WINDOW_TOPLEVEL ); | |
1778 gtk_widget_set_name( DXR3Config,"DXR3Config" ); | |
1779 gtk_object_set_data( GTK_OBJECT( DXR3Config ),"DXR3Config",DXR3Config ); | |
1780 // gtk_widget_set_usize( DXR3Config,300,156 ); | |
1781 GTK_WIDGET_SET_FLAGS( DXR3Config,GTK_CAN_DEFAULT ); | |
1782 gtk_window_set_title( GTK_WINDOW( DXR3Config ),"DXR3/H+" ); | |
1783 gtk_window_set_position( GTK_WINDOW( DXR3Config ),GTK_WIN_POS_CENTER ); | |
1784 gtk_window_set_policy( GTK_WINDOW( DXR3Config ),FALSE,FALSE,FALSE ); | |
1785 gtk_window_set_wmclass( GTK_WINDOW( DXR3Config ),"DXR3","MPlayer" ); | |
1786 | |
1787 gtk_widget_realize( DXR3Config ); | |
1788 gtkAddIcon( DXR3Config ); | |
1789 | |
1790 vbox1=AddVBox( AddDialogFrame( DXR3Config ),0 ); | |
1791 vbox2=AddVBox( vbox1,0 ); | |
1792 hbox1=AddHBox( vbox2,1 ); | |
1793 AddLabel( MSGTR_PREFERENCES_Audio_Device,hbox1 ); | |
1794 | |
1795 CBDevice=AddComboBox( hbox1 ); | |
1796 | |
1797 CBDevice_items=g_list_append( CBDevice_items,( gpointer ) "/dev/em8300" ); | |
1798 CBDevice_items=g_list_append( CBDevice_items,( gpointer ) "/dev/em8300-0" ); | |
1799 CBDevice_items=g_list_append( CBDevice_items,( gpointer ) "/dev/em8300-1" ); | |
1800 CBDevice_items=g_list_append( CBDevice_items,( gpointer ) "/dev/em8300-2" ); | |
1801 CBDevice_items=g_list_append( CBDevice_items,( gpointer ) "/dev/em8300-3" ); | |
1802 gtk_combo_set_popdown_strings( GTK_COMBO( CBDevice ),CBDevice_items ); | |
1803 g_list_free( CBDevice_items ); | |
1804 | |
1805 CEDXR3Device=GTK_COMBO( CBDevice )->entry; | |
1806 gtk_widget_set_name( CEDXR3Device,"CEDXR3Device" ); | |
1807 gtk_widget_show( CEDXR3Device ); | |
1808 gtk_entry_set_text( GTK_ENTRY( CEDXR3Device ),"/dev/em8300" ); | |
1809 | |
1810 AddHSeparator( vbox2 ); | |
1811 vbox3=AddVBox( vbox2,0 ); | |
1812 AddLabel( MSGTR_PREFERENCES_DXR3_VENC,vbox3 ); | |
1813 RBVNone=AddRadioButton( MSGTR_PREFERENCES_None,&VEncoder_group,vbox3 ); | |
1814 RBVLavc=AddRadioButton( MSGTR_PREFERENCES_DXR3_LAVC,&VEncoder_group,vbox3 ); | |
1815 | |
1816 AddHSeparator( vbox1 ); | |
1817 | |
1818 hbuttonbox1=AddHButtonBox( vbox1 ); | |
1819 gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox1 ),GTK_BUTTONBOX_END ); | |
1820 gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox1 ),10 ); | |
1821 dxr3BOk=AddButton( MSGTR_Ok,hbuttonbox1 ); | |
1822 dxr3BCancel=AddButton( MSGTR_Cancel,hbuttonbox1 ); | |
1823 | |
1824 gtk_widget_add_accelerator( dxr3BOk,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE ); | |
1825 gtk_widget_add_accelerator( dxr3BCancel,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE ); | |
1826 | |
1827 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
|
1828 |
23077 | 1829 gtk_signal_connect( GTK_OBJECT( dxr3BOk ),"clicked",GTK_SIGNAL_FUNC( dxr3Button ),(void *)0 ); |
1830 gtk_signal_connect( GTK_OBJECT( dxr3BCancel ),"clicked",GTK_SIGNAL_FUNC( dxr3Button ),(void *)1 ); | |
1831 | |
1832 gtk_window_add_accel_group( GTK_WINDOW( DXR3Config ),accel_group ); | |
1833 | |
1834 return DXR3Config; | |
1835 } | |
1836 | |
1837 #endif |