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