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