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