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