Mercurial > mplayer.hg
annotate gui/dialog/preferences.c @ 37016:45663ee3a990
Change comment into doxygen comment.
author | ib |
---|---|
date | Sat, 29 Mar 2014 14:27:19 +0000 |
parents | 6bb8d4f4a7b0 |
children | 1236a692d0c6 |
rev | line source |
---|---|
33572 | 1 /* |
2 * This file is part of MPlayer. | |
3 * | |
4 * MPlayer is free software; you can redistribute it and/or modify | |
5 * it under the terms of the GNU General Public License as published by | |
6 * the Free Software Foundation; either version 2 of the License, or | |
7 * (at your option) any later version. | |
8 * | |
9 * MPlayer is distributed in the hope that it will be useful, | |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 * GNU General Public License for more details. | |
13 * | |
14 * You should have received a copy of the GNU General Public License along | |
15 * with MPlayer; if not, write to the Free Software Foundation, Inc., | |
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
17 */ | |
18 | |
19 #include <stdlib.h> | |
20 #include <sys/types.h> | |
21 #include <sys/stat.h> | |
22 #include <unistd.h> | |
23 #include <string.h> | |
35903 | 24 #include <strings.h> |
33572 | 25 |
26 #include <gdk/gdkkeysyms.h> | |
27 #include <gtk/gtk.h> | |
28 | |
29 #include "config.h" | |
30 #include "help_mp.h" | |
31 #include "mixer.h" | |
32 #include "mpcommon.h" | |
36026 | 33 #include "mplayer.h" |
33572 | 34 #include "libao2/audio_out.h" |
35 #include "sub/sub.h" | |
36 #include "libvo/video_out.h" | |
37 #include "libvo/x11_common.h" | |
38 #include "stream/stream.h" | |
39 #include "libmpdemux/demuxer.h" | |
40 #include "libmpdemux/stheader.h" | |
41 #include "libmpcodecs/dec_video.h" | |
42 #include "sub/font_load.h" | |
43 | |
35525 | 44 #include "gui/app/app.h" |
45 #include "gui/app/cfg.h" | |
46 #include "gui/app/gui.h" | |
33572 | 47 #include "gui/interface.h" |
35528 | 48 #include "gui/ui/ui.h" |
35529 | 49 #include "dialog.h" |
33741 | 50 #include "gui/util/list.h" |
33739 | 51 #include "gui/util/mem.h" |
33737 | 52 #include "gui/util/string.h" |
36962 | 53 #include "gui/wm/ws.h" |
33572 | 54 #include "preferences.h" |
55 #include "fileselect.h" | |
56 #include "tools.h" | |
57 | |
34684 | 58 /* for mpcodecs_[av]d_drivers: */ |
33572 | 59 #include "libmpcodecs/vd.h" |
60 #include "libmpcodecs/ad.h" | |
61 | |
36561 | 62 #ifdef CONFIG_ICONV |
63 #include <iconv.h> | |
64 #endif | |
65 | |
33572 | 66 GtkWidget * Preferences = NULL; |
67 static GtkWidget * AConfig; | |
68 static GtkWidget * VConfig; | |
69 //static GtkWidget * BLoadSubtitle; | |
70 static GtkWidget * BLoadFont; | |
71 static GtkWidget * BOk; | |
72 static GtkWidget * BCancel; | |
73 | |
74 static GtkWidget * CLADrivers; | |
75 static GtkWidget * CLVDrivers; | |
76 | |
77 //static GtkWidget * ESubtitleName; | |
78 GtkWidget * prEFontName; | |
79 GtkWidget * prEDVDDevice; | |
80 GtkWidget * prECDRomDevice; | |
81 static GtkWidget * EVFM; | |
82 static GtkWidget * EAFM; | |
83 | |
84 static GtkWidget * CBVFM; | |
85 static GtkWidget * CBAFM; | |
86 static GtkWidget * CBAudioEqualizer; | |
87 //static GtkWidget * CBSurround; | |
88 static GtkWidget * CBExtraStereo; | |
89 static GtkWidget * CBNormalize; | |
90 static GtkWidget * CBSoftwareMixer; | |
91 static GtkWidget * CBDoubleBuffer; | |
92 static GtkWidget * CBDR; | |
93 static GtkWidget * CBFramedrop; | |
94 static GtkWidget * CBHFramedrop; | |
95 //static GtkWidget * CBFullScreen; | |
96 static GtkWidget * CBShowVideoWindow; | |
97 static GtkWidget * CBNonInterlaved; | |
98 static GtkWidget * CBIndex; | |
99 static GtkWidget * CBFlip; | |
100 static GtkWidget * CBNoAutoSub; | |
36547 | 101 static GtkWidget * CBSubUtf8; |
33572 | 102 static GtkWidget * CBSubUnicode; |
103 static GtkWidget * CBSubOverlap; | |
104 static GtkWidget * CBDumpMPSub; | |
105 static GtkWidget * CBDumpSrt; | |
106 static GtkWidget * CBUseASS; | |
107 static GtkWidget * CBASSUseMargins; | |
108 static GtkWidget * SBASSTopMargin; | |
109 static GtkWidget * SBASSBottomMargin; | |
110 static GtkWidget * CBPostprocess; | |
111 static GtkWidget * CBCache; | |
112 static GtkWidget * CBLoadFullscreen; | |
113 static GtkWidget * CBSaveWinPos; | |
114 static GtkWidget * CBStopXScreenSaver; | |
115 static GtkWidget * CBPlayBar; | |
116 static GtkWidget * CBNoIdle; | |
36429 | 117 static GtkWidget * CBTVDigital; |
33572 | 118 |
119 static GtkWidget * SBCache; | |
120 static GtkAdjustment * SBCacheadj; | |
121 | |
122 static GtkWidget * CBAutoSync; | |
123 static GtkWidget * SBAutoSync; | |
124 static GtkAdjustment * SBAutoSyncadj; | |
125 | |
126 static GtkWidget * RBOSDNone; | |
33777
235c6f2514be
Arrange OSD preferences according to option 'osdlevel'.
ib
parents:
33769
diff
changeset
|
127 static GtkWidget * RBOSDIndicator; |
33572 | 128 static GtkWidget * RBOSDTandP; |
129 static GtkWidget * RBOSDTPTT; | |
130 | |
131 static GtkWidget * HSAudioDelay; | |
132 static GtkWidget * HSExtraStereoMul; | |
133 static GtkWidget * HSPanscan; | |
134 static GtkWidget * HSSubDelay; | |
135 static GtkWidget * HSSubPosition; | |
136 static GtkWidget * HSSubFPS; | |
137 static GtkWidget * HSPPQuality; | |
138 static GtkWidget * HSFPS; | |
139 | |
140 static GtkAdjustment * HSExtraStereoMuladj, * HSAudioDelayadj, * HSPanscanadj, * HSSubDelayadj; | |
141 static GtkAdjustment * HSSubPositionadj, * HSSubFPSadj, * HSPPQualityadj, * HSFPSadj; | |
142 | |
36584 | 143 #ifdef CONFIG_FREETYPE |
33572 | 144 static GtkWidget * HSFontBlur, * HSFontOutLine, * HSFontTextScale, * HSFontOSDScale; |
145 static GtkAdjustment * HSFontBluradj, * HSFontOutLineadj, * HSFontTextScaleadj, * HSFontOSDScaleadj; | |
146 static GtkWidget * CBFontEncoding, * EFontEncoding; | |
147 static GtkWidget * RBFontNoAutoScale, * RBFontAutoScaleWidth, * RBFontAutoScaleHeight, * RBFontAutoScaleDiagonal; | |
148 //static GtkWidget * AutoScale; | |
36584 | 149 #else |
150 static GtkWidget * HSFontFactor; | |
151 static GtkAdjustment * HSFontFactoradj; | |
33572 | 152 #endif |
153 | |
154 #ifdef CONFIG_ICONV | |
155 static GtkWidget * CBSubEncoding, * ESubEncoding; | |
156 #endif | |
157 | |
158 #if defined(CONFIG_FREETYPE) || defined(CONFIG_ICONV) | |
36624 | 159 #define ENC_UTF8 "UTF-8" |
160 #define ENC_UNICODE "UNICODE" | |
33572 | 161 static struct |
162 { | |
163 char * name; | |
164 char * comment; | |
165 } lEncoding[] = | |
166 { | |
36694 | 167 { ENC_UTF8, MSGTR_GUI_CpUTF8 }, |
168 { "ISO-8859-1", MSGTR_GUI_CpISO8859_1 }, | |
169 { "ISO-8859-2", MSGTR_GUI_CpISO8859_2 }, | |
170 { "ISO-8859-3", MSGTR_GUI_CpISO8859_3 }, | |
171 { "ISO-8859-4", MSGTR_GUI_CpISO8859_4 }, | |
172 { "ISO-8859-5", MSGTR_GUI_CpISO8859_5 }, | |
173 { "ISO-8859-6", MSGTR_GUI_CpISO8859_6 }, | |
174 { "ISO-8859-7", MSGTR_GUI_CpISO8859_7 }, | |
175 { "ISO-8859-8", MSGTR_GUI_CpISO8859_8 }, | |
176 { "ISO-8859-9", MSGTR_GUI_CpISO8859_9 }, | |
177 { "ISO-8859-10", MSGTR_GUI_CpISO8859_10 }, | |
178 { "ISO-8859-11", MSGTR_GUI_CpISO8859_11 }, | |
179 { "ISO-8859-13", MSGTR_GUI_CpISO8859_13 }, | |
180 { "ISO-8859-14", MSGTR_GUI_CpISO8859_14 }, | |
181 { "ISO-8859-15", MSGTR_GUI_CpISO8859_15 }, | |
182 { "ISO-8859-16", MSGTR_GUI_CpISO8859_16 }, | |
183 { "KOI8-R", MSGTR_GUI_CpKOI8_R }, | |
184 { "KOI8-U", MSGTR_GUI_CpKOI8_U }, | |
185 { "KOI8-RU", MSGTR_GUI_CpKOI8_RU }, | |
186 { "BIG5", MSGTR_GUI_CpBIG5 }, | |
187 { "SHIFT-JIS", MSGTR_GUI_CpShiftJis }, | |
188 { "CP1250", MSGTR_GUI_Cp1250}, | |
189 { "CP1251", MSGTR_GUI_Cp1251}, | |
190 { "CP1252", MSGTR_GUI_Cp1252 }, | |
191 { "CP1253", MSGTR_GUI_Cp1253 }, | |
192 { "CP1254", MSGTR_GUI_Cp1254 }, | |
193 { "CP1255", MSGTR_GUI_Cp1255 }, | |
194 { "CP1256", MSGTR_GUI_Cp1256 }, | |
195 { "CP1257", MSGTR_GUI_Cp1257 }, | |
196 { "CP1258", MSGTR_GUI_Cp1258 }, | |
197 { "CP874", MSGTR_GUI_Cp874 }, | |
198 { "CP932", MSGTR_GUI_Cp932 }, | |
199 { "CP936", MSGTR_GUI_Cp936 }, | |
200 { "CP949", MSGTR_GUI_Cp949 }, | |
201 { "CP950", MSGTR_GUI_Cp950 }, | |
202 { ENC_UNICODE, MSGTR_GUI_CpUnicode }, | |
33572 | 203 { NULL,NULL } |
204 }; | |
205 #endif | |
206 | |
207 static int old_audio_driver = 0; | |
208 static char * ao_driver[3]; | |
209 static char * vo_driver[3]; | |
210 static int old_video_driver = 0; | |
211 | |
36003
8fea01665c83
Remove HidePreferences(), HideAudioConfig() and HideDXR3Config().
ib
parents:
35996
diff
changeset
|
212 static GtkWidget *AudioConfig; |
36117 | 213 static GtkWidget *DXR3Config; |
36003
8fea01665c83
Remove HidePreferences(), HideAudioConfig() and HideDXR3Config().
ib
parents:
35996
diff
changeset
|
214 |
33572 | 215 void ShowDXR3Config( void ); |
216 void ShowAudioConfig( void ); | |
217 | |
34466
a650895d50a5
Use correct data types and common variable names in GTK callback functions.
ib
parents:
34454
diff
changeset
|
218 static gboolean prHScaler( GtkWidget * widget,GdkEvent * event,gpointer user_data ); |
33572 | 219 static void prToggled( GtkToggleButton * togglebutton,gpointer user_data ); |
220 static void prCListRow( GtkCList * clist,gint row,gint column,GdkEvent * event,gpointer user_data ); | |
221 | |
222 #if defined(CONFIG_FREETYPE) || defined(CONFIG_ICONV) | |
34466
a650895d50a5
Use correct data types and common variable names in GTK callback functions.
ib
parents:
34454
diff
changeset
|
223 static void prEntry( GtkEditable * editable,gpointer user_data ) |
33572 | 224 { |
225 const char * comment; | |
226 int i; | |
227 | |
36010 | 228 (void) editable; |
229 | |
36776 | 230 switch( GPOINTER_TO_INT(user_data) ) |
33572 | 231 { |
232 #ifdef CONFIG_FREETYPE | |
233 case 0: // font encoding | |
234 comment=gtk_entry_get_text( GTK_ENTRY( EFontEncoding ) ); | |
235 for ( i=0;lEncoding[i].name;i++ ) | |
236 if ( !gstrcmp( lEncoding[i].comment,comment ) ) break; | |
33766 | 237 if ( lEncoding[i].comment ) mplayer( MPLAYER_SET_FONT_ENCODING,0,lEncoding[i].name ); |
36608 | 238 else mplayer( MPLAYER_SET_FONT_ENCODING,0,(char *)comment ); |
33572 | 239 break; |
240 #endif | |
241 #ifdef CONFIG_ICONV | |
242 case 1: // sub encoding | |
243 comment=gtk_entry_get_text( GTK_ENTRY( ESubEncoding ) ); | |
244 for ( i=0;lEncoding[i].name;i++ ) | |
245 if ( !gstrcmp( lEncoding[i].comment,comment ) ) break; | |
33766 | 246 if ( lEncoding[i].comment ) mplayer( MPLAYER_SET_SUB_ENCODING,0,lEncoding[i].name ); |
36563 | 247 else |
248 { | |
36694 | 249 if ( strcmp( comment,MSGTR_GUI__Default_ ) == 0 ) comment=NULL; |
36563 | 250 mplayer( MPLAYER_SET_SUB_ENCODING,0,(char *)comment ); |
251 } | |
36566 | 252 if ( !comment) gtk_widget_set_sensitive( CBSubEncoding,(!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(CBSubUtf8)) && !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(CBSubUnicode))) ); |
36564 | 253 gtk_widget_set_sensitive( CBSubUtf8,(comment == NULL) ); |
36565 | 254 gtk_widget_set_sensitive( CBSubUnicode,((comment == NULL) && !gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(CBSubUtf8) )) ); |
33572 | 255 break; |
256 #endif | |
257 } | |
258 } | |
259 #endif | |
260 | |
261 #define bAConfig 0 | |
262 #define bVconfig 1 | |
263 #define bOk 2 | |
264 #define bCancel 3 | |
265 #define bLSubtitle 4 | |
266 #define bLFont 5 | |
267 | |
36565 | 268 static void button_toggled( GtkToggleButton *button, gpointer user_data ) |
269 { | |
36566 | 270 (void) button; |
36565 | 271 (void) user_data; |
272 | |
36566 | 273 #ifdef CONFIG_ICONV |
274 if ( !sub_cp ) gtk_widget_set_sensitive( CBSubEncoding,(!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(CBSubUtf8)) && !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(CBSubUnicode))) ); | |
275 #endif | |
276 gtk_widget_set_sensitive( CBSubUnicode,!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(CBSubUtf8)) ); | |
36565 | 277 } |
278 | |
33572 | 279 static void prButton( GtkButton * button, gpointer user_data ) |
280 { | |
36723 | 281 static int inform = True; |
282 | |
36010 | 283 (void) button; |
284 | |
36776 | 285 switch ( GPOINTER_TO_INT(user_data) ) |
33572 | 286 { |
287 case bOk: | |
34684 | 288 /* 1st page */ |
33572 | 289 gtkEnableAudioEqualizer=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBAudioEqualizer ) ); |
290 gtkAOExtraStereo=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBExtraStereo ) ); | |
291 gtkAONorm=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBNormalize ) ); | |
292 soft_vol=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBSoftwareMixer ) ); | |
33769 | 293 mplayer( MPLAYER_SET_EXTRA_STEREO,HSExtraStereoMuladj->value,0 ); |
33572 | 294 audio_delay=HSAudioDelayadj->value; |
295 | |
34610 | 296 listSet( &audio_driver_list,ao_driver[0] ); |
297 listSet( &video_driver_list,vo_driver[0] ); | |
33572 | 298 |
34684 | 299 /* 2nd page */ |
33572 | 300 vo_doublebuffering=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBDoubleBuffer ) ); |
301 vo_directrendering=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBDR ) ); | |
302 | |
303 frame_dropping=0; | |
304 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBFramedrop ) ) == TRUE ) frame_dropping=1; | |
305 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBHFramedrop ) ) == TRUE ) frame_dropping=2; | |
306 | |
307 flip=-1; | |
308 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBFlip ) ) ) flip=1; | |
309 | |
310 force_fps=HSFPSadj->value; | |
311 | |
34684 | 312 /* 3rd page */ |
33572 | 313 suboverlap_enabled=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBSubOverlap ) ); |
36670 | 314 sub_auto=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBNoAutoSub ) ); |
33572 | 315 gtkSubDumpMPSub=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBDumpMPSub ) ); |
316 gtkSubDumpSrt=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBDumpSrt ) ); | |
36547 | 317 sub_utf8=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBSubUtf8 ) ); |
33572 | 318 sub_unicode=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBSubUnicode ) ); |
319 #ifdef CONFIG_ASS | |
320 gtkASS.enabled=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBUseASS ) ); | |
321 gtkASS.use_margins=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBASSUseMargins ) ); | |
322 gtkASS.top_margin=gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( SBASSTopMargin ) ); | |
323 gtkASS.bottom_margin=gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( SBASSBottomMargin ) ); | |
324 #endif | |
325 sub_delay=HSSubDelayadj->value; | |
326 sub_fps=HSSubFPSadj->value; | |
327 sub_pos=(int)HSSubPositionadj->value; | |
328 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBOSDNone ) ) ) osd_level=0; | |
329 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBOSDIndicator ) ) ) osd_level=1; | |
330 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBOSDTandP ) ) ) osd_level=2; | |
331 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBOSDTPTT ) ) ) osd_level=3; | |
332 | |
333 | |
34684 | 334 /* 4th page */ |
33740
2c02269701bd
Remove macros guiSetFilename() and guiSetDF() from interface.h.
ib
parents:
33739
diff
changeset
|
335 setdup( &font_name,gtk_entry_get_text( GTK_ENTRY( prEFontName ) ) ); |
36584 | 336 #ifdef CONFIG_FREETYPE |
33769 | 337 mplayer( MPLAYER_SET_FONT_BLUR,HSFontBluradj->value,0 ); |
338 mplayer( MPLAYER_SET_FONT_OUTLINE,HSFontOutLineadj->value,0 ); | |
339 mplayer( MPLAYER_SET_FONT_TEXTSCALE,HSFontTextScaleadj->value,0 ); | |
340 mplayer( MPLAYER_SET_FONT_OSDSCALE,HSFontOSDScaleadj->value,0 ); | |
341 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBFontNoAutoScale ) ) ) mplayer( MPLAYER_SET_FONT_AUTOSCALE,0,0 ); | |
342 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBFontAutoScaleHeight ) ) ) mplayer( MPLAYER_SET_FONT_AUTOSCALE,1,0 ); | |
343 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBFontAutoScaleWidth ) ) ) mplayer( MPLAYER_SET_FONT_AUTOSCALE,2,0 ); | |
344 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBFontAutoScaleDiagonal ) ) ) mplayer( MPLAYER_SET_FONT_AUTOSCALE,3,0 ); | |
36584 | 345 #else |
346 mplayer( MPLAYER_SET_FONT_FACTOR,HSFontFactoradj->value,0 ); | |
33572 | 347 #endif |
348 | |
34684 | 349 /* -- 5th page */ |
33572 | 350 force_ni=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBNonInterlaved ) ); |
351 index_mode=-1; | |
352 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBIndex ) ) ) index_mode=1; | |
353 | |
354 { | |
355 int i; | |
356 const char * tmp = gtk_entry_get_text( GTK_ENTRY( EVFM ) ); | |
357 for( i=0;mpcodecs_vd_drivers[i];i++ ) | |
36840 | 358 if ( !gstrcmp( tmp,mpcodecs_vd_drivers[i]->info->name ) ) |
359 { listSet( &video_fm_list,mpcodecs_vd_drivers[i]->info->short_name ); break; } | |
33572 | 360 } |
361 | |
362 { | |
363 int i; | |
364 const char * tmp = gtk_entry_get_text( GTK_ENTRY( EAFM ) ); | |
365 for( i=0;mpcodecs_ad_drivers[i];i++ ) | |
36840 | 366 if ( !gstrcmp( tmp,mpcodecs_ad_drivers[i]->info->name ) ) |
367 { listSet( &audio_fm_list,mpcodecs_ad_drivers[i]->info->short_name ); break; } | |
33572 | 368 } |
369 | |
34684 | 370 /* 6th page */ |
33572 | 371 gtkVfPP=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBPostprocess ) ); |
372 gtkLoadFullscreen=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBLoadFullscreen ) ); | |
373 gui_save_pos=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBSaveWinPos ) ); | |
36670 | 374 gtkShowVideoWindow=!gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBShowVideoWindow ) ); |
33572 | 375 stop_xscreensaver=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBStopXScreenSaver ) ); |
376 gtkEnablePlayBar=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBPlayBar ) ); | |
36429 | 377 gui_tv_digital=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBTVDigital ) ); |
33572 | 378 player_idle_mode=!gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBNoIdle ) ); |
33769 | 379 mplayer( MPLAYER_SET_AUTO_QUALITY,HSPPQualityadj->value,0 ); |
33572 | 380 |
35493 | 381 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBCache ) ) ) { gtkCacheSize=(int)SBCacheadj->value; gtkCacheOn=True; } |
382 else gtkCacheOn=False; | |
33572 | 383 |
35493 | 384 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBAutoSync ) ) ) { gtkAutoSync=(int)SBAutoSyncadj->value; gtkAutoSyncOn=True; } |
385 else gtkAutoSyncOn=False; | |
33572 | 386 |
33740
2c02269701bd
Remove macros guiSetFilename() and guiSetDF() from interface.h.
ib
parents:
33739
diff
changeset
|
387 setdup( &dvd_device,gtk_entry_get_text( GTK_ENTRY( prEDVDDevice ) ) ); |
2c02269701bd
Remove macros guiSetFilename() and guiSetDF() from interface.h.
ib
parents:
33739
diff
changeset
|
388 setdup( &cdrom_device,gtk_entry_get_text( GTK_ENTRY( prECDRomDevice ) ) ); |
33572 | 389 |
36724 | 390 if ( guiInfo.Playing && inform ) |
36723 | 391 { |
392 gtkMessageBox( MSGBOX_INFORMATION,MSGTR_GUI_MSG_PlaybackNeedsRestart ); | |
393 inform = False; | |
394 } | |
395 | |
33572 | 396 case bCancel: |
36003
8fea01665c83
Remove HidePreferences(), HideAudioConfig() and HideDXR3Config().
ib
parents:
35996
diff
changeset
|
397 gtk_widget_destroy( Preferences ); |
36008 | 398 if ( AudioConfig ) gtk_widget_destroy( AudioConfig ); |
36003
8fea01665c83
Remove HidePreferences(), HideAudioConfig() and HideDXR3Config().
ib
parents:
35996
diff
changeset
|
399 #ifdef CONFIG_DXR3 |
36008 | 400 if ( DXR3Config ) gtk_widget_destroy( DXR3Config ); |
36003
8fea01665c83
Remove HidePreferences(), HideAudioConfig() and HideDXR3Config().
ib
parents:
35996
diff
changeset
|
401 #endif |
33572 | 402 break; |
403 case bAConfig: | |
404 if ( !ao_driver[0] ) break; | |
405 gtk_widget_set_sensitive( AConfig,FALSE ); | |
406 if ( !strncmp( ao_driver[0],"oss",3 ) || | |
407 !strncmp( ao_driver[0],"alsa",4 ) || | |
408 !strncmp( ao_driver[0],"esd",3 ) || | |
409 !strncmp( ao_driver[0],"sdl",3 ) ) { | |
410 ShowAudioConfig(); | |
411 gtk_widget_set_sensitive( AConfig,TRUE ); | |
412 } | |
413 break; | |
414 case bVconfig: | |
415 if ( !vo_driver[0] ) break; | |
416 gtk_widget_set_sensitive( VConfig,FALSE ); | |
417 #ifdef CONFIG_DXR3 | |
418 if ( !gstrcmp( vo_driver[0],"dxr3" ) ) { ShowDXR3Config(); gtk_widget_set_sensitive( VConfig,TRUE ); } | |
419 #endif | |
420 break; | |
421 #if 0 | |
422 case bLSubtitle: | |
423 break; | |
424 #endif | |
425 case bLFont: | |
35976 | 426 ShowFileSelector( FILESELECT_FONT ); |
35975 | 427 gtkSetLayer( FileSelector ); |
33572 | 428 break; |
429 } | |
430 } | |
431 | |
34466
a650895d50a5
Use correct data types and common variable names in GTK callback functions.
ib
parents:
34454
diff
changeset
|
432 static gboolean prHScaler( GtkWidget * widget,GdkEvent * event,gpointer user_data ) |
33572 | 433 { |
36010 | 434 (void) widget; |
435 (void) event; | |
436 | |
36776 | 437 switch ( GPOINTER_TO_INT(user_data) ) |
33572 | 438 { |
439 case 0: // extra stereo coefficient | |
440 if ( !guiInfo.Playing ) break; | |
33769 | 441 mplayer( MPLAYER_SET_EXTRA_STEREO,HSExtraStereoMuladj->value,0 ); |
33572 | 442 break; |
443 case 1: // audio delay | |
444 audio_delay=HSAudioDelayadj->value; | |
445 break; | |
446 case 2: // panscan | |
33769 | 447 mplayer( MPLAYER_SET_PANSCAN,HSPanscanadj->value,0 ); |
33572 | 448 break; |
449 case 3: // sub delay | |
450 sub_delay=HSSubDelayadj->value; | |
451 break; | |
452 case 4: // sub position | |
453 sub_pos=(int)HSSubPositionadj->value; | |
454 break; | |
36584 | 455 #ifdef CONFIG_FREETYPE |
33572 | 456 case 6: // font blur |
33769 | 457 mplayer( MPLAYER_SET_FONT_BLUR,HSFontBluradj->value,0 ); |
33572 | 458 break; |
459 case 7: // font outline | |
33769 | 460 mplayer( MPLAYER_SET_FONT_OUTLINE,HSFontOutLineadj->value,0 ); |
33572 | 461 break; |
462 case 8: // text scale | |
33769 | 463 mplayer( MPLAYER_SET_FONT_TEXTSCALE,HSFontTextScaleadj->value,0 ); |
33572 | 464 break; |
465 case 9: // osd scale | |
33769 | 466 mplayer( MPLAYER_SET_FONT_OSDSCALE,HSFontOSDScaleadj->value,0 ); |
33572 | 467 break; |
36584 | 468 #else |
469 case 5: // font factor | |
470 mplayer( MPLAYER_SET_FONT_FACTOR,HSFontFactoradj->value,0 ); | |
471 break; | |
33572 | 472 #endif |
473 case 10: // auto quality | |
33769 | 474 mplayer( MPLAYER_SET_AUTO_QUALITY,HSPPQualityadj->value,0 ); |
33572 | 475 break; |
476 } | |
477 return FALSE; | |
478 } | |
479 | |
480 static void prToggled( GtkToggleButton * togglebutton,gpointer user_data ) | |
481 { | |
482 int window; | |
36010 | 483 |
484 (void) togglebutton; | |
485 | |
36776 | 486 switch ( GPOINTER_TO_INT(user_data) ) |
33572 | 487 { |
488 case 0: // extra stereo coefficient | |
489 if ( guiInfo.Playing ) | |
490 gtk_widget_set_sensitive( HSExtraStereoMul,gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBExtraStereo ) ) ); | |
491 break; | |
492 // case 1: // normalize | |
493 // case 2: // equalizer | |
36036 | 494 // if ( guiInfo.Playing ) gtkMessageBox( MSGBOX_WARNING,"Please remember, this function need restart the playing." ); |
33572 | 495 // break; |
496 case 3: | |
36670 | 497 if ( !gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBShowVideoWindow ) ) ) |
33572 | 498 { |
499 window=wsShowWindow; | |
36019 | 500 gtkRaise( Preferences ); |
33572 | 501 } else window=wsHideWindow; |
33941
8beec562ce0e
Remove dependency between gtkShowVideoWindow and gtkLoadFullscreen
ib
parents:
33938
diff
changeset
|
502 // NOTE TO MYSELF: doesn't work with a fullscreen window |
35681
80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
ib
parents:
35529
diff
changeset
|
503 if ( !guiInfo.Playing ) wsWindowVisibility( &guiApp.videoWindow,window ); |
33572 | 504 break; |
505 case 4: | |
506 case 5: | |
507 case 6: | |
508 case 7: | |
36776 | 509 mplayer( MPLAYER_SET_FONT_AUTOSCALE,GPOINTER_TO_INT(user_data) - 4,0 ); |
33572 | 510 break; |
511 case 8: | |
512 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBCache ) ) ) gtk_widget_set_sensitive( SBCache,TRUE ); | |
513 else gtk_widget_set_sensitive( SBCache,FALSE ); | |
514 break; | |
515 case 9: | |
516 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBAutoSync ) ) ) gtk_widget_set_sensitive( SBAutoSync,TRUE ); | |
517 else gtk_widget_set_sensitive( SBAutoSync,FALSE ); | |
518 break; | |
519 #ifdef CONFIG_ASS | |
520 case 10: | |
521 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBUseASS ) ) ) | |
522 { | |
523 gtk_widget_set_sensitive( CBASSUseMargins,TRUE ); | |
524 gtk_widget_set_sensitive( SBASSTopMargin,TRUE ); | |
525 gtk_widget_set_sensitive( SBASSBottomMargin,TRUE ); | |
526 } | |
527 else | |
528 { | |
529 gtk_widget_set_sensitive( CBASSUseMargins,FALSE ); | |
530 gtk_widget_set_sensitive( SBASSTopMargin,FALSE ); | |
531 gtk_widget_set_sensitive( SBASSBottomMargin,FALSE ); | |
532 } | |
533 break; | |
534 #endif | |
535 } | |
536 } | |
537 | |
538 static void prCListRow( GtkCList * clist,gint row,gint column,GdkEvent * event,gpointer user_data ) | |
539 { | |
36010 | 540 (void) clist; |
541 (void) column; | |
542 (void) event; | |
543 | |
36776 | 544 switch ( GPOINTER_TO_INT(user_data) ) |
33572 | 545 { |
546 case 0: // audio driver | |
547 gtk_clist_get_text( GTK_CLIST( CLADrivers ),row,0,(char **)&ao_driver ); | |
548 gtk_widget_set_sensitive( AConfig,FALSE ); | |
549 if ( !strncmp( ao_driver[0],"oss",3 ) || | |
550 !strncmp( ao_driver[0],"alsa",4 ) || | |
551 !strncmp( ao_driver[0],"esd",3 ) || | |
552 !strncmp( ao_driver[0],"sdl",3 ) ) | |
553 gtk_widget_set_sensitive( AConfig,TRUE ); | |
554 #ifndef CONFIG_GTK2 | |
555 if ( !strncmp( ao_driver[0],"arts",4 ) ) | |
36694 | 556 gtkMessageBox(MSGBOX_WARNING, MSGTR_GUI_MSG_aRtsBroken); |
33572 | 557 #endif |
558 break; | |
559 case 1: // video driver | |
560 gtk_clist_get_text( GTK_CLIST( CLVDrivers ),row,0,(char **)&vo_driver ); | |
561 gtk_widget_set_sensitive( VConfig,FALSE ); | |
562 #ifdef CONFIG_DXR3 | |
563 if ( !gstrcmp( vo_driver[0],"dxr3" ) ) gtk_widget_set_sensitive( VConfig,TRUE ); | |
564 #endif | |
565 break; | |
566 } | |
567 } | |
568 | |
35996 | 569 static GtkWidget * CreatePreferences( void ) |
33572 | 570 { |
571 GtkWidget * label; | |
572 GtkWidget * frame; | |
573 | |
574 GtkWidget * vbox1; | |
575 GtkWidget * notebook1; | |
576 GtkWidget * hbox1; | |
577 GtkWidget * vbox2; | |
578 GtkWidget * scrolledwindow3; | |
579 GtkWidget * vbox3; | |
580 GtkWidget * hbox8; | |
581 GtkWidget * hbox2; | |
36542 | 582 GtkWidget * hbox3; |
33572 | 583 GtkWidget * vbox4; |
584 GtkWidget * scrolledwindow2; | |
585 GtkWidget * hbuttonbox3; | |
586 GtkWidget * vbox5; | |
587 GtkWidget * vbox6; | |
588 GtkWidget * vbox600; | |
589 GSList * OSD_group = NULL; | |
36525 | 590 #ifdef CONFIG_FREETYPE |
36589 | 591 GtkWidget * vbox11; |
33572 | 592 GSList * Font_group = NULL; |
593 GList * CBFontEncoding_items = NULL; | |
36525 | 594 #else |
595 GtkWidget * hbox7; | |
596 #endif | |
36489 | 597 #ifdef CONFIG_ICONV |
36607 | 598 iconv_t cd; |
33572 | 599 GList * CBSubEncoding_items = NULL; |
600 #endif | |
601 GtkWidget * vbox7; | |
602 GtkWidget * vbox8; | |
603 GtkWidget * table1; | |
604 GtkWidget * vbox9; | |
36541 | 605 GtkWidget * vbox10; |
33572 | 606 GtkWidget * vbox603; |
607 GtkWidget * hbox6; | |
608 GtkWidget * hbuttonbox5; | |
609 GtkWidget * vbox601; | |
610 GtkWidget * vbox602; | |
36600 | 611 GtkWidget * vbox604; |
33572 | 612 GtkWidget * hbox5; |
613 GtkWidget * hbuttonbox1; | |
614 GtkAccelGroup * accel_group; | |
615 | |
616 GtkWidget * hbox9; | |
617 GtkWidget * hbox91; | |
618 GtkWidget * hbox92; | |
619 | |
620 accel_group=gtk_accel_group_new(); | |
621 | |
622 Preferences=gtk_window_new( GTK_WINDOW_TOPLEVEL ); | |
36694 | 623 gtk_window_set_title( GTK_WINDOW( Preferences ),MSGTR_GUI_Preferences ); |
33572 | 624 gtk_window_set_position( GTK_WINDOW( Preferences ),GTK_WIN_POS_CENTER ); |
36053 | 625 gtk_window_set_wmclass( GTK_WINDOW( Preferences ),"Preferences",MPlayer ); |
33572 | 626 |
627 gtk_widget_realize( Preferences ); | |
628 gtkAddIcon( Preferences ); | |
629 | |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
630 vbox1=gtkAddVBox( gtkAddDialogFrame( Preferences ),0 ); |
33572 | 631 notebook1=gtk_notebook_new(); |
632 gtk_widget_show( notebook1 ); | |
633 gtk_box_pack_start( GTK_BOX( vbox1 ),notebook1,TRUE,TRUE,0 ); | |
634 | |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
635 hbox1=gtkAddVBox( notebook1,0 ); |
33572 | 636 |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
637 frame=gtkAddFrame( NULL,GTK_SHADOW_ETCHED_OUT,hbox1,1 ); |
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
638 frame=gtkAddFrame( NULL,GTK_SHADOW_NONE,frame,1 ); |
33572 | 639 |
34684 | 640 /* 1st page */ |
33572 | 641 |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
642 vbox2=gtkAddVBox( frame,0 ); |
33572 | 643 |
644 scrolledwindow3=gtk_scrolled_window_new( NULL,NULL ); | |
645 gtk_widget_show( scrolledwindow3 ); | |
646 gtk_box_pack_start( GTK_BOX( vbox2 ),scrolledwindow3,TRUE,TRUE,0 ); | |
647 gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scrolledwindow3 ),GTK_POLICY_NEVER,GTK_POLICY_AUTOMATIC ); | |
648 | |
649 CLADrivers=gtk_clist_new( 2 ); | |
650 gtk_widget_show( CLADrivers ); | |
651 gtk_container_add( GTK_CONTAINER( scrolledwindow3 ),CLADrivers ); | |
652 gtk_clist_set_column_width( GTK_CLIST( CLADrivers ),0,50 ); | |
653 gtk_clist_column_titles_show( GTK_CLIST( CLADrivers ) ); | |
654 gtk_clist_set_shadow_type( GTK_CLIST( CLADrivers ),GTK_SHADOW_NONE ); | |
655 gtk_widget_set_usize( CLADrivers,250,-2 ); | |
656 gtk_clist_set_column_widget( GTK_CLIST( CLADrivers ),0, | |
36694 | 657 gtkAddLabel( MSGTR_GUI_AvailableDrivers,NULL ) ); |
33572 | 658 |
36694 | 659 AConfig=gtkAddButton( MSGTR_GUI_ConfigureDriver, |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
660 gtkAddHButtonBox( vbox2 ) ); |
33572 | 661 |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
662 vbox3=gtkAddVBox( |
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
663 gtkAddFrame( NULL,GTK_SHADOW_NONE, |
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
664 gtkAddFrame( NULL,GTK_SHADOW_ETCHED_OUT,hbox1,0 ),1 ),0 ); |
33572 | 665 gtk_widget_set_usize( vbox3,250,-2 ); |
666 | |
36694 | 667 CBNormalize=gtkAddCheckButton( MSGTR_GUI_NormalizeSound,vbox3 ); |
668 CBAudioEqualizer=gtkAddCheckButton( MSGTR_GUI_EnableEqualizer,vbox3 ); | |
669 CBSoftwareMixer=gtkAddCheckButton( MSGTR_GUI_EnableSoftwareMixer,vbox3 ); | |
33572 | 670 #if 0 |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
671 CBSurround=gtkAddCheckButton( "Enable surround",vbox3 ); |
33572 | 672 #endif |
673 | |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
674 gtkAddHSeparator( vbox3 ); |
36694 | 675 CBExtraStereo=gtkAddCheckButton( MSGTR_GUI_EnableExtraStereo,vbox3 ); |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
676 hbox8=gtkAddHBox( vbox3,1 ); |
36694 | 677 /*label=*/gtkAddLabel( MSGTR_GUI_Coefficient":",hbox8 ); |
33572 | 678 // gtk_misc_set_padding( GTK_MISC( label ),20,0 ); |
679 HSExtraStereoMuladj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-10,10,0.1,0,0 ) ); | |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
680 HSExtraStereoMul=gtkAddHScale( HSExtraStereoMuladj,hbox8,1 ); |
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
681 gtkAddHSeparator( vbox3 ); |
33572 | 682 |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
683 hbox8=gtkAddHBox( vbox3,1 ); |
36694 | 684 gtkAddLabel( MSGTR_GUI_AudioDelay":",hbox8 ); |
33572 | 685 |
36822 | 686 HSAudioDelayadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-100,100,0.1,0,0 ) ); |
687 HSAudioDelay=gtkAddHScale( HSAudioDelayadj,hbox8,1 ); | |
36694 | 688 label=gtkAddLabel( MSGTR_GUI_Audio,NULL ); |
33572 | 689 gtk_notebook_set_tab_label( GTK_NOTEBOOK( notebook1 ),gtk_notebook_get_nth_page( GTK_NOTEBOOK( notebook1 ),0 ),label ); |
690 | |
34684 | 691 /* 2nd page */ |
33572 | 692 |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
693 hbox2=gtkAddVBox( notebook1,0 ); |
33572 | 694 |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
695 vbox4=gtkAddVBox( |
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
696 gtkAddFrame( NULL,GTK_SHADOW_NONE, |
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
697 gtkAddFrame( NULL,GTK_SHADOW_ETCHED_OUT,hbox2,1 ),1 ),0 ); |
33572 | 698 |
699 scrolledwindow2=gtk_scrolled_window_new( NULL,NULL ); | |
700 gtk_widget_show( scrolledwindow2 ); | |
701 gtk_box_pack_start( GTK_BOX( vbox4 ),scrolledwindow2,TRUE,TRUE,0 ); | |
702 gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scrolledwindow2 ),GTK_POLICY_NEVER,GTK_POLICY_AUTOMATIC ); | |
703 | |
704 CLVDrivers=gtk_clist_new( 2 ); | |
705 gtk_widget_show( CLVDrivers ); | |
706 gtk_container_add( GTK_CONTAINER( scrolledwindow2 ),CLVDrivers ); | |
707 gtk_clist_set_column_width( GTK_CLIST( CLVDrivers ),0,50 ); | |
708 gtk_clist_column_titles_show( GTK_CLIST( CLVDrivers ) ); | |
709 gtk_clist_set_shadow_type( GTK_CLIST( CLVDrivers ),GTK_SHADOW_NONE ); | |
710 gtk_widget_set_usize( CLVDrivers,250,-2 ); | |
711 | |
36694 | 712 label=gtkAddLabel( MSGTR_GUI_AvailableDrivers,NULL ); |
33572 | 713 gtk_clist_set_column_widget( GTK_CLIST( CLVDrivers ),0,label ); |
714 | |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
715 hbuttonbox3=gtkAddHButtonBox( vbox4 ); |
36694 | 716 VConfig=gtkAddButton( MSGTR_GUI_ConfigureDriver,hbuttonbox3 ); |
33572 | 717 |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
718 vbox5=gtkAddVBox( |
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
719 gtkAddFrame( NULL,GTK_SHADOW_NONE, |
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
720 gtkAddFrame( NULL,GTK_SHADOW_ETCHED_OUT,hbox2,0 ),1 ),0 ); |
33572 | 721 gtk_widget_set_usize( vbox5,250,-2 ); |
722 | |
36694 | 723 CBDoubleBuffer=gtkAddCheckButton( MSGTR_GUI_EnableDoubleBuffering,vbox5 ); |
724 CBDR=gtkAddCheckButton( MSGTR_GUI_EnableDirectRendering,vbox5 ); | |
725 CBFramedrop=gtkAddCheckButton( MSGTR_GUI_EnableFrameDropping,vbox5 ); | |
726 CBHFramedrop=gtkAddCheckButton( MSGTR_GUI_EnableFrameDroppingIntense,vbox5 ); | |
727 CBFlip=gtkAddCheckButton( MSGTR_GUI_Flip,vbox5 ); | |
33572 | 728 |
36585 | 729 table1=gtk_table_new( 2,2,FALSE ); |
33572 | 730 gtk_widget_show( table1 ); |
731 gtk_box_pack_start( GTK_BOX( vbox5 ),table1,FALSE,FALSE,0 ); | |
732 | |
36694 | 733 label=gtkAddLabel( MSGTR_GUI_PanAndScan":",NULL ); |
33572 | 734 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); |
735 | |
36694 | 736 label=gtkAddLabel( MSGTR_GUI_FrameRate":",NULL ); |
33572 | 737 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); |
738 | |
36824 | 739 HSPanscanadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,1,0.1,0,0 ) ); |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
740 HSPanscan=gtkAddHScale( HSPanscanadj,NULL,1 ); |
33572 | 741 gtk_table_attach( GTK_TABLE( table1 ),HSPanscan,1,2,0,1,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); |
742 | |
36825 | 743 HSFPSadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,120,0.001,0,0 ) ); |
33572 | 744 HSFPS=gtk_spin_button_new( GTK_ADJUSTMENT( HSFPSadj ),1,3 ); |
745 gtk_widget_show( HSFPS ); | |
746 gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( HSFPS ),TRUE ); | |
747 gtk_table_attach( GTK_TABLE( table1 ),HSFPS,1,2,1,2,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
748 | |
36694 | 749 label=gtkAddLabel( MSGTR_GUI_Video,NULL ); |
33572 | 750 gtk_notebook_set_tab_label( GTK_NOTEBOOK( notebook1 ),gtk_notebook_get_nth_page( GTK_NOTEBOOK( notebook1 ),1 ),label ); |
751 | |
34684 | 752 /* 3rd page */ |
33572 | 753 |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
754 vbox6=gtkAddVBox( notebook1,0 ); |
33572 | 755 |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
756 vbox600=gtkAddVBox( |
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
757 gtkAddFrame( NULL,GTK_SHADOW_NONE, |
36694 | 758 gtkAddFrame( MSGTR_GUI_OsdLevel,GTK_SHADOW_ETCHED_OUT,vbox6,0 ),1 ),0 ); |
33572 | 759 |
36694 | 760 RBOSDNone=gtkAddRadioButton( MSGTR_GUI_OsdLevel0,&OSD_group,vbox600 ); |
761 RBOSDIndicator=gtkAddRadioButton( MSGTR_GUI_OsdLevel1,&OSD_group,vbox600 ); | |
762 RBOSDTandP=gtkAddRadioButton( MSGTR_GUI_OsdLevel2,&OSD_group,vbox600 ); | |
763 RBOSDTPTT=gtkAddRadioButton( MSGTR_GUI_OsdLevel3,&OSD_group,vbox600 ); | |
33572 | 764 |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
765 vbox7=gtkAddVBox( |
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
766 gtkAddFrame( NULL,GTK_SHADOW_NONE, |
36694 | 767 gtkAddFrame( MSGTR_GUI_Subtitle,GTK_SHADOW_ETCHED_OUT,vbox6,0 ),1 ),0 ); |
33572 | 768 |
769 #if 0 | |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
770 hbox4=gtkAddHBox( vbox7,1 ); |
33572 | 771 |
36694 | 772 gtkAddLabel( MSGTR_GUI_Subtitle":",hbox4 ); |
33572 | 773 |
774 ESubtitleName=gtk_entry_new(); | |
775 gtk_widget_show( ESubtitleName ); | |
776 gtk_box_pack_start( GTK_BOX( hbox4 ),ESubtitleName,TRUE,TRUE,0 ); | |
777 | |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
778 hbuttonbox4=gtkAddHButtonBox( hbuttonbox4 ); |
33572 | 779 gtk_container_set_border_width( GTK_CONTAINER( hbuttonbox4 ),3 ); |
36694 | 780 BLoadSubtitle=gtkAddButton( MSGTR_GUI_Browse,hbuttonbox4 ); |
33572 | 781 #endif |
782 | |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
783 vbox8=gtkAddVBox( vbox7,0 ); |
33572 | 784 |
36585 | 785 table1=gtk_table_new( 4,2,FALSE ); |
33572 | 786 gtk_widget_show( table1 ); |
787 gtk_box_pack_start( GTK_BOX( vbox8 ),table1,FALSE,FALSE,0 ); | |
788 | |
36694 | 789 label=gtkAddLabel( MSGTR_GUI_Delay":",NULL ); |
33572 | 790 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); |
791 | |
36694 | 792 label=gtkAddLabel( MSGTR_GUI_Position":",NULL ); |
33572 | 793 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); |
794 | |
36694 | 795 label=gtkAddLabel( MSGTR_GUI_FrameRate":",NULL ); |
33572 | 796 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,2,3,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); |
797 | |
36694 | 798 label=gtkAddLabel( MSGTR_GUI_Encoding":",NULL ); |
36542 | 799 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,3,4,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( GTK_FILL ),0,0 ); |
33572 | 800 |
36826 | 801 HSSubDelayadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-10.0,10,0.1,0,0 ) ); |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
802 HSSubDelay=gtkAddHScale( HSSubDelayadj,NULL,1 ); |
33572 | 803 gtk_table_attach( GTK_TABLE( table1 ),HSSubDelay,1,2,0,1,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); |
804 | |
36827 | 805 HSSubPositionadj=GTK_ADJUSTMENT( gtk_adjustment_new( 100,0,150,1,0,0 ) ); |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
806 HSSubPosition=gtkAddHScale( HSSubPositionadj,NULL,0 ); |
33572 | 807 gtk_table_attach( GTK_TABLE( table1 ),HSSubPosition,1,2,1,2,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); |
808 | |
36828 | 809 HSSubFPSadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,120,0.001,0,0 ) ); |
33572 | 810 HSSubFPS=gtk_spin_button_new( GTK_ADJUSTMENT( HSSubFPSadj ),1,3 ); |
811 gtk_widget_show( HSSubFPS ); | |
812 gtk_widget_set_usize( HSSubFPS,60,-1 ); | |
813 gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( HSSubFPS ),TRUE ); | |
814 gtk_table_attach( GTK_TABLE( table1 ),HSSubFPS,1,2,2,3,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
815 | |
36541 | 816 vbox10=gtkAddVBox( NULL,0 ); |
817 gtk_table_attach( GTK_TABLE( table1 ),vbox10,1,2,3,4,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
818 | |
33572 | 819 #ifdef CONFIG_ICONV |
36542 | 820 gtk_misc_set_alignment( GTK_MISC( label ),0,0 ); |
33572 | 821 CBSubEncoding=gtk_combo_new(); |
822 gtk_widget_show( CBSubEncoding ); | |
36541 | 823 gtk_box_pack_start( GTK_BOX( vbox10 ),CBSubEncoding,TRUE,FALSE,0 ); |
36694 | 824 CBSubEncoding_items=g_list_append( CBSubEncoding_items,MSGTR_GUI__Default_ ); |
33572 | 825 { |
36563 | 826 int i, listed=(sub_cp == NULL); |
36607 | 827 |
36561 | 828 for ( i=0;lEncoding[i].name;i++ ) |
829 { | |
36624 | 830 cd=iconv_open( ENC_UTF8,lEncoding[i].name ); |
36561 | 831 |
832 if (cd != (iconv_t) -1) | |
833 { | |
834 iconv_close(cd); | |
835 CBSubEncoding_items=g_list_append( CBSubEncoding_items,lEncoding[i].comment ); | |
36563 | 836 |
837 if ( !listed ) | |
838 if ( strcasecmp ( lEncoding[i].name, sub_cp ) == 0 ) listed=True; | |
36561 | 839 } |
840 } | |
36563 | 841 if ( !listed ) CBSubEncoding_items=g_list_insert( CBSubEncoding_items,sub_cp,1 ); |
33572 | 842 } |
843 gtk_combo_set_popdown_strings( GTK_COMBO( CBSubEncoding ),CBSubEncoding_items ); | |
844 g_list_free( CBSubEncoding_items ); | |
845 | |
846 ESubEncoding=GTK_COMBO( CBSubEncoding )->entry; | |
847 gtk_entry_set_editable( GTK_ENTRY( ESubEncoding ),FALSE ); | |
848 gtk_widget_show( ESubEncoding ); | |
849 #endif | |
850 | |
36542 | 851 hbox3=gtkAddHBox( NULL,0 ); |
36547 | 852 gtk_box_set_spacing( GTK_BOX( hbox3 ), 24 ); |
36542 | 853 gtk_box_pack_start( GTK_BOX( vbox10 ),hbox3,TRUE,FALSE,0 ); |
854 | |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
855 vbox9=gtkAddVBox( vbox8,0 ); |
33572 | 856 |
36694 | 857 CBSubOverlap=gtkAddCheckButton( MSGTR_GUI_SubtitleAllowOverlap,vbox9 ); |
858 CBNoAutoSub=gtkAddCheckButton( MSGTR_GUI_SubtitleAutomaticLoad,vbox9 ); | |
859 CBSubUtf8=gtkAddCheckButton( MSGTR_GUI_CpUTF8,hbox3 ); | |
860 CBSubUnicode=gtkAddCheckButton( MSGTR_GUI_CpUnicode,hbox3 ); | |
861 CBDumpMPSub=gtkAddCheckButton( MSGTR_GUI_SubtitleConvertMpsub,vbox9 ); | |
862 CBDumpSrt=gtkAddCheckButton( MSGTR_GUI_SubtitleConvertSrt,vbox9 ); | |
33572 | 863 |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
864 gtkAddHSeparator( vbox9 ); |
36694 | 865 CBUseASS=gtkAddCheckButton( MSGTR_GUI_EnableAssSubtitle,vbox9 ); |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
866 hbox9=gtkAddHBox( vbox9,0 ); |
36694 | 867 CBASSUseMargins=gtkAddCheckButton( MSGTR_GUI_SubtitleAddMargins,hbox9 ); |
33572 | 868 |
869 hbox91=gtk_hbox_new( FALSE,0 ); | |
870 gtk_box_pack_start( GTK_BOX( hbox9 ),hbox91,TRUE,FALSE,0 ); | |
871 gtk_widget_show( hbox91 ); | |
36694 | 872 SBASSTopMargin=gtkAddSpinButton( MSGTR_GUI_Top":", |
36829 | 873 (GtkAdjustment *)gtk_adjustment_new(0,0,2000,1,8,0),hbox91 ); |
33572 | 874 |
875 hbox92=gtk_hbox_new( FALSE,0 ); | |
876 gtk_box_pack_start( GTK_BOX( hbox9 ),hbox92,TRUE,FALSE,0 ); | |
877 gtk_widget_show( hbox92 ); | |
36694 | 878 SBASSBottomMargin=gtkAddSpinButton( MSGTR_GUI_Bottom":", |
36829 | 879 (GtkAdjustment *)gtk_adjustment_new(0,0,2000,1,8,0),hbox92 ); |
33572 | 880 |
36694 | 881 label=gtkAddLabel( MSGTR_GUI_OSD_Subtitles,NULL ); |
33572 | 882 gtk_notebook_set_tab_label( GTK_NOTEBOOK( notebook1 ),gtk_notebook_get_nth_page( GTK_NOTEBOOK( notebook1 ),2 ),label ); |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
883 vbox601=gtkAddVBox( notebook1,0 ); |
33572 | 884 |
34684 | 885 /* 4th page */ |
33572 | 886 |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
887 vbox603=gtkAddVBox( |
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
888 gtkAddFrame( NULL,GTK_SHADOW_NONE, |
36597 | 889 gtkAddFrame( NULL,GTK_SHADOW_ETCHED_OUT,vbox601,0 ),1 ),0 ); |
33572 | 890 |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
891 hbox6=gtkAddHBox( vbox603,1 ); |
36694 | 892 gtkAddLabel( MSGTR_GUI_Font":",hbox6 ); |
33572 | 893 prEFontName=gtk_entry_new(); |
894 gtk_widget_show( prEFontName ); | |
895 gtk_box_pack_start( GTK_BOX( hbox6 ),prEFontName,TRUE,TRUE,0 ); | |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
896 hbuttonbox5=gtkAddHButtonBox( hbox6 ); |
33572 | 897 gtk_container_set_border_width( GTK_CONTAINER( hbuttonbox5 ),3 ); |
36694 | 898 BLoadFont=gtkAddButton( MSGTR_GUI_Browse,hbuttonbox5 ); |
33572 | 899 |
36584 | 900 #ifdef CONFIG_FREETYPE |
36589 | 901 table1=gtk_table_new( 6,2,FALSE ); |
33572 | 902 gtk_widget_show( table1 ); |
903 gtk_box_pack_start( GTK_BOX( vbox603 ),table1,FALSE,FALSE,0 ); | |
904 | |
36694 | 905 label=gtkAddLabel( MSGTR_GUI_ScaleMode":",NULL ); |
36589 | 906 gtk_misc_set_alignment( GTK_MISC( label ),0,0 ); |
907 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( GTK_FILL ),0,0 ); | |
908 | |
909 vbox11=gtkAddVBox( NULL,0 ); | |
910 gtk_table_attach( GTK_TABLE( table1 ),vbox11,1,2,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
911 | |
36694 | 912 RBFontNoAutoScale=gtkAddRadioButton( MSGTR_GUI_ScaleNo,&Font_group,vbox11 ); |
913 RBFontAutoScaleHeight=gtkAddRadioButton( MSGTR_GUI_ScaleMovieHeight,&Font_group,vbox11 ); | |
914 RBFontAutoScaleWidth=gtkAddRadioButton( MSGTR_GUI_ScaleMovieWidth,&Font_group,vbox11 ); | |
915 RBFontAutoScaleDiagonal=gtkAddRadioButton( MSGTR_GUI_ScaleMovieDiagonal,&Font_group,vbox11 ); | |
36589 | 916 |
36694 | 917 label=gtkAddLabel( MSGTR_GUI_Encoding":",NULL ); |
33572 | 918 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); |
919 | |
920 CBFontEncoding=gtk_combo_new(); | |
921 gtk_widget_show( CBFontEncoding ); | |
922 gtk_table_attach( GTK_TABLE( table1 ),CBFontEncoding,1,2,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
923 { | |
36608 | 924 int i, append, listed=(subtitle_font_encoding == NULL); |
36607 | 925 for ( i=0;lEncoding[i].name;i++ ) |
926 { | |
36624 | 927 append=(strcasecmp( lEncoding[i].name,ENC_UNICODE ) == 0); |
36607 | 928 #ifdef CONFIG_ICONV |
929 cd=iconv_open( "ucs-4",lEncoding[i].name ); | |
930 | |
931 if (cd != (iconv_t) -1) | |
932 { | |
933 iconv_close(cd); | |
934 append=True; | |
935 } | |
936 #endif | |
36608 | 937 if ( append ) |
938 { | |
939 CBFontEncoding_items=g_list_append( CBFontEncoding_items,lEncoding[i].comment ); | |
940 | |
941 if ( !listed ) | |
942 if ( strcasecmp ( lEncoding[i].name, subtitle_font_encoding ) == 0 ) listed=True; | |
943 } | |
36607 | 944 } |
36608 | 945 if ( !listed ) CBFontEncoding_items=g_list_insert( CBFontEncoding_items,subtitle_font_encoding,1 ); |
33572 | 946 } |
947 gtk_combo_set_popdown_strings( GTK_COMBO( CBFontEncoding ),CBFontEncoding_items ); | |
948 g_list_free( CBFontEncoding_items ); | |
949 | |
950 EFontEncoding=GTK_COMBO( CBFontEncoding )->entry; | |
951 gtk_entry_set_editable( GTK_ENTRY( EFontEncoding ),FALSE ); | |
952 gtk_widget_show( EFontEncoding ); | |
953 | |
36694 | 954 label=gtkAddLabel( MSGTR_GUI_Blur":",NULL ); |
36589 | 955 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,2,3,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); |
33572 | 956 |
957 HSFontBluradj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,100,0.1,0,0 ) ); | |
36830 | 958 HSFontBlur=gtkAddHScale( HSFontBluradj,NULL,1 ); |
36589 | 959 gtk_table_attach( GTK_TABLE( table1 ),HSFontBlur,1,2,2,3,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); |
33572 | 960 |
36694 | 961 label=gtkAddLabel( MSGTR_GUI_Outline":",NULL ); |
36589 | 962 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,3,4,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); |
33572 | 963 |
964 HSFontOutLineadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,100,0.1,0,0 ) ); | |
36830 | 965 HSFontOutLine=gtkAddHScale( HSFontOutLineadj,NULL,1 ); |
36589 | 966 gtk_table_attach( GTK_TABLE( table1 ),HSFontOutLine,1,2,3,4,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); |
33572 | 967 |
36694 | 968 label=gtkAddLabel( MSGTR_GUI_SizeSubtitles":",NULL ); |
36589 | 969 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,4,5,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); |
33572 | 970 |
971 HSFontTextScaleadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,100,0.1,0,0 ) ); | |
36830 | 972 HSFontTextScale=gtkAddHScale( HSFontTextScaleadj,NULL,1 ); |
36589 | 973 gtk_table_attach( GTK_TABLE( table1 ),HSFontTextScale,1,2,4,5,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); |
33572 | 974 |
36694 | 975 label=gtkAddLabel( MSGTR_GUI_SizeOSD":",NULL ); |
36589 | 976 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,5,6,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); |
33572 | 977 |
978 HSFontOSDScaleadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,100,0.1,0,0 ) ); | |
36830 | 979 HSFontOSDScale=gtkAddHScale( HSFontOSDScaleadj,NULL,1 ); |
36589 | 980 gtk_table_attach( GTK_TABLE( table1 ),HSFontOSDScale,1,2,5,6,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); |
36584 | 981 #else |
982 hbox7=gtkAddHBox( vbox603,1 ); | |
36694 | 983 gtkAddLabel( MSGTR_GUI_Outline":",hbox7 ); |
36584 | 984 HSFontFactoradj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,10,0.05,0,0 ) ); |
985 HSFontFactor=gtkAddHScale( HSFontFactoradj,hbox7,2 ); | |
33572 | 986 #endif |
987 | |
36694 | 988 label=gtkAddLabel( MSGTR_GUI_Font,NULL ); |
33572 | 989 gtk_notebook_set_tab_label( GTK_NOTEBOOK( notebook1 ),gtk_notebook_get_nth_page( GTK_NOTEBOOK( notebook1 ),3 ),label ); |
990 | |
34684 | 991 /* 5th page */ |
33572 | 992 |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
993 vbox601=gtkAddVBox( notebook1,0 ); |
33572 | 994 |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
995 vbox602=gtkAddVBox( |
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
996 gtkAddFrame( NULL,GTK_SHADOW_NONE, |
36694 | 997 gtkAddFrame( MSGTR_GUI_Demuxer,GTK_SHADOW_ETCHED_OUT,vbox601,0 ),1 ),0 ); |
33572 | 998 |
36694 | 999 CBNonInterlaved=gtkAddCheckButton( MSGTR_GUI_NonInterleavedParser,vbox602 ); |
1000 CBIndex=gtkAddCheckButton( MSGTR_GUI_SeekingInBrokenMedia,vbox602 ); | |
33572 | 1001 |
36600 | 1002 vbox604=gtkAddVBox( |
1003 gtkAddFrame( NULL,GTK_SHADOW_NONE, | |
36694 | 1004 gtkAddFrame( MSGTR_GUI_Codecs,GTK_SHADOW_ETCHED_OUT,vbox601,0 ),1 ),0 ); |
36600 | 1005 |
1006 hbox5=gtkAddHBox( vbox604,1 ); | |
33572 | 1007 |
36694 | 1008 gtkAddLabel( MSGTR_GUI_CodecFamilyVideo":",hbox5 ); |
33572 | 1009 |
1010 CBVFM=gtk_combo_new(); | |
1011 gtk_widget_show( CBVFM ); | |
1012 gtk_box_pack_start( GTK_BOX( hbox5 ),CBVFM,TRUE,TRUE,0 ); | |
1013 | |
1014 EVFM=GTK_COMBO( CBVFM )->entry; | |
1015 gtk_entry_set_editable( GTK_ENTRY( EVFM ),FALSE ); | |
1016 gtk_widget_show( EVFM ); | |
1017 | |
36600 | 1018 hbox5=gtkAddHBox( vbox604,1 ); |
33572 | 1019 |
36694 | 1020 gtkAddLabel( MSGTR_GUI_CodecFamilyAudio":",hbox5 ); |
33572 | 1021 |
1022 CBAFM=gtk_combo_new(); | |
1023 gtk_widget_show( CBAFM ); | |
1024 gtk_box_pack_start( GTK_BOX( hbox5 ),CBAFM,TRUE,TRUE,0 ); | |
1025 | |
1026 EAFM=GTK_COMBO( CBAFM )->entry; | |
1027 gtk_entry_set_editable( GTK_ENTRY( EAFM ),FALSE ); | |
1028 gtk_widget_show( EAFM ); | |
1029 | |
36694 | 1030 label=gtkAddLabel( MSGTR_GUI_Demuxers_Codecs,NULL ); |
33572 | 1031 gtk_notebook_set_tab_label( GTK_NOTEBOOK( notebook1 ),gtk_notebook_get_nth_page( GTK_NOTEBOOK( notebook1 ),4 ),label ); |
1032 | |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
1033 vbox601=gtkAddVBox( notebook1,0 ); |
33572 | 1034 |
34684 | 1035 /* 6th page */ |
33572 | 1036 |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
1037 vbox602=gtkAddVBox( |
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
1038 gtkAddFrame( NULL,GTK_SHADOW_NONE, |
36694 | 1039 gtkAddFrame( MSGTR_GUI_PostProcessing,GTK_SHADOW_ETCHED_OUT,vbox601,0 ),1 ),0 ); |
33572 | 1040 |
36694 | 1041 CBPostprocess=gtkAddCheckButton( MSGTR_GUI_EnablePostProcessing,vbox602 ); |
33572 | 1042 |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
1043 hbox5=gtkAddHBox( vbox602,1 ); |
33572 | 1044 |
36694 | 1045 gtkAddLabel( MSGTR_GUI_MaximumUsageSpareCPU":",hbox5 ); |
33572 | 1046 |
36831 | 1047 if ( guiInfo.sh_video && guiInfo.Playing ) HSPPQualityadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,get_video_quality_max( guiInfo.sh_video ),1,0,0 ) ); |
1048 else HSPPQualityadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,100,1,0,0 ) ); | |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
1049 HSPPQuality=gtkAddHScale( HSPPQualityadj,hbox5,0 ); |
33572 | 1050 |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
1051 vbox602=gtkAddVBox( |
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
1052 gtkAddFrame( NULL,GTK_SHADOW_NONE, |
36694 | 1053 gtkAddFrame( MSGTR_GUI_Cache,GTK_SHADOW_ETCHED_OUT,vbox601,0 ),1 ),0 ); |
33572 | 1054 |
36694 | 1055 CBCache=gtkAddCheckButton( MSGTR_GUI_EnableCache,vbox602 ); |
33572 | 1056 |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
1057 hbox5=gtkAddHBox( vbox602,1 ); |
33572 | 1058 |
36694 | 1059 gtkAddLabel( MSGTR_GUI_CacheSize":",hbox5 ); |
33572 | 1060 |
34707 | 1061 SBCacheadj=GTK_ADJUSTMENT( gtk_adjustment_new( gtkCacheSize,32,0x7fffffff,1,32,0 ) ); |
33572 | 1062 SBCache=gtk_spin_button_new( GTK_ADJUSTMENT( SBCacheadj ),1,0 ); |
1063 gtk_widget_show( SBCache ); | |
1064 gtk_box_pack_start( GTK_BOX( hbox5 ),SBCache,TRUE,TRUE,0 ); | |
1065 | |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
1066 vbox602=gtkAddVBox( |
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
1067 gtkAddFrame( NULL,GTK_SHADOW_NONE, |
36694 | 1068 gtkAddFrame( MSGTR_GUI_Miscellaneous,GTK_SHADOW_ETCHED_OUT,vbox601,1 ),1 ),0 ); |
33572 | 1069 |
36694 | 1070 CBShowVideoWindow=gtkAddCheckButton( MSGTR_GUI_HideVideoWindow,vbox602 ); |
1071 CBLoadFullscreen=gtkAddCheckButton( MSGTR_GUI_StartFullscreen,vbox602 ); | |
1072 CBSaveWinPos=gtkAddCheckButton( MSGTR_GUI_SaveWindowPositions,vbox602 ); | |
1073 CBStopXScreenSaver=gtkAddCheckButton( MSGTR_GUI_TurnOffXScreenSaver,vbox602 ); | |
1074 CBPlayBar=gtkAddCheckButton( MSGTR_GUI_EnablePlaybar,vbox602 ); | |
1075 CBTVDigital=gtkAddCheckButton( MSGTR_GUI_EnableDigitalTV,vbox602 ); | |
1076 CBNoIdle=gtkAddCheckButton( MSGTR_GUI_QuitAfterPlaying,vbox602 ); | |
33572 | 1077 |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
1078 gtkAddHSeparator( vbox602 ); |
33572 | 1079 |
36694 | 1080 CBAutoSync=gtkAddCheckButton( MSGTR_GUI_EnableAutomaticAVSync,vbox602 ); |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
1081 hbox5=gtkAddHBox( vbox602,1 ); |
36694 | 1082 gtkAddLabel( MSGTR_GUI_SyncValue":",hbox5 ); |
36832 | 1083 SBAutoSyncadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,10000,1,10,0 ) ); |
33572 | 1084 SBAutoSync=gtk_spin_button_new( GTK_ADJUSTMENT( SBAutoSyncadj ),1,0 ); |
1085 gtk_widget_show( SBAutoSync ); | |
1086 gtk_box_pack_start( GTK_BOX( hbox5 ),SBAutoSync,TRUE,TRUE,0 ); | |
1087 | |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
1088 gtkAddHSeparator( vbox602 ); |
33572 | 1089 |
1090 table1=gtk_table_new( 2,2,FALSE ); | |
1091 gtk_widget_show( table1 ); | |
1092 gtk_box_pack_start( GTK_BOX( vbox602 ),table1,FALSE,FALSE,0 ); | |
1093 | |
36694 | 1094 label=gtkAddLabel( MSGTR_GUI_DeviceDVD":",NULL ); |
33572 | 1095 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); |
1096 prEDVDDevice=gtk_entry_new(); | |
1097 gtk_widget_show( prEDVDDevice ); | |
1098 gtk_table_attach( GTK_TABLE( table1 ),prEDVDDevice,1,2,0,1,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1099 | |
36694 | 1100 label=gtkAddLabel( MSGTR_GUI_DeviceCDROM":",NULL ); |
33572 | 1101 gtk_table_attach( GTK_TABLE( table1 ),label,0,1,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); |
1102 prECDRomDevice=gtk_entry_new(); | |
1103 gtk_widget_show( prECDRomDevice ); | |
1104 gtk_table_attach( GTK_TABLE( table1 ),prECDRomDevice,1,2,1,2,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
1105 | |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
1106 // gtkAddHSeparator( vbox602 ); |
33572 | 1107 |
36694 | 1108 label=gtkAddLabel( MSGTR_GUI_Miscellaneous,NULL ); |
33572 | 1109 gtk_notebook_set_tab_label( GTK_NOTEBOOK( notebook1 ),gtk_notebook_get_nth_page( GTK_NOTEBOOK( notebook1 ),5 ),label ); |
1110 | |
34684 | 1111 /* --- */ |
33572 | 1112 |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
1113 gtkAddHSeparator( vbox1 ); |
33572 | 1114 |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
1115 hbuttonbox1=gtkAddHButtonBox( vbox1 ); |
33572 | 1116 gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox1 ),GTK_BUTTONBOX_END ); |
1117 gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox1 ),10 ); | |
36694 | 1118 BOk=gtkAddButton( MSGTR_GUI_Ok,hbuttonbox1 ); |
1119 BCancel=gtkAddButton( MSGTR_GUI_Cancel,hbuttonbox1 ); | |
33572 | 1120 |
1121 gtk_widget_add_accelerator( BOk,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE ); | |
1122 gtk_widget_add_accelerator( BCancel,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE ); | |
1123 | |
36008 | 1124 gtk_signal_connect( GTK_OBJECT( Preferences ),"destroy",GTK_SIGNAL_FUNC( gtk_widget_destroyed ),&Preferences ); |
33572 | 1125 |
36776 | 1126 gtk_signal_connect( GTK_OBJECT( AConfig ),"clicked",GTK_SIGNAL_FUNC( prButton ),GINT_TO_POINTER(bAConfig) ); |
1127 gtk_signal_connect( GTK_OBJECT( BOk ),"clicked",GTK_SIGNAL_FUNC( prButton ),GINT_TO_POINTER(bOk) ); | |
1128 gtk_signal_connect( GTK_OBJECT( BCancel ),"clicked",GTK_SIGNAL_FUNC( prButton ),GINT_TO_POINTER(bCancel) ); | |
1129 gtk_signal_connect( GTK_OBJECT( VConfig ),"clicked",GTK_SIGNAL_FUNC( prButton ),GINT_TO_POINTER(bVconfig) ); | |
33572 | 1130 #if 0 |
36776 | 1131 gtk_signal_connect( GTK_OBJECT( BLoadSubtitle ),"clicked",GTK_SIGNAL_FUNC( prButton ),GINT_TO_POINTER(bLSubtitle) ); |
33572 | 1132 #endif |
36776 | 1133 gtk_signal_connect( GTK_OBJECT( BLoadFont ),"clicked",GTK_SIGNAL_FUNC( prButton ),GINT_TO_POINTER(bLFont) ); |
33572 | 1134 |
36565 | 1135 gtk_signal_connect( GTK_OBJECT( CBSubUtf8 ),"toggled",GTK_SIGNAL_FUNC( button_toggled ),NULL ); |
36566 | 1136 gtk_signal_connect( GTK_OBJECT( CBSubUnicode ),"toggled",GTK_SIGNAL_FUNC( button_toggled ),NULL ); |
33572 | 1137 #if 0 |
1138 gtk_signal_connect( GTK_OBJECT( CBNormalize ),"toggled",GTK_SIGNAL_FUNC( on_CBNormalize_toggled ),NULL ); | |
1139 gtk_signal_connect( GTK_OBJECT( CBSoftwareMixer ),"toggled",GTK_SIGNAL_FUNC( on_CBSoftwareMixer_toggled ),NULL ); | |
1140 gtk_signal_connect( GTK_OBJECT( CBSurround ),"toggled",GTK_SIGNAL_FUNC( on_CBSurround_toggled ),NULL ); | |
1141 gtk_signal_connect( GTK_OBJECT( CBExtraStereo ),"toggled",GTK_SIGNAL_FUNC( on_CBExtraStereo_toggled ),NULL ); | |
1142 gtk_signal_connect( GTK_OBJECT( CBDoubleBuffer ),"toggled",GTK_SIGNAL_FUNC( on_CBDoubleBuffer_toggled ),NULL ); | |
1143 gtk_signal_connect( GTK_OBJECT( CBDR ),"toggled",GTK_SIGNAL_FUNC( on_CBDR_toggled ),NULL ); | |
1144 gtk_signal_connect( GTK_OBJECT( CBFramedrop ),"toggled",GTK_SIGNAL_FUNC( on_CBFramedrop_toggled ),NULL ); | |
1145 gtk_signal_connect( GTK_OBJECT( CBHFramedrop ),"toggled",GTK_SIGNAL_FUNC( on_CBHFramedrop_toggled ),NULL ); | |
1146 gtk_signal_connect( GTK_OBJECT( CBFullScreen ),"toggled",GTK_SIGNAL_FUNC( on_CBFullScreen_toggled ),NULL ); | |
1147 gtk_signal_connect( GTK_OBJECT( CBNonInterlaved ),"toggled",GTK_SIGNAL_FUNC( on_CBNonInterlaved_toggled ),NULL ); | |
1148 gtk_signal_connect( GTK_OBJECT( CBFlip ),"toggled",GTK_SIGNAL_FUNC( on_CBFlip_toggled ),NULL ); | |
1149 gtk_signal_connect( GTK_OBJECT( CBPostprocess ),"toggled",GTK_SIGNAL_FUNC( on_CBPostprocess_toggled ),NULL ); | |
1150 gtk_signal_connect( GTK_OBJECT( CBNoAutoSub ),"toggled",GTK_SIGNAL_FUNC( on_CBNoAutoSub_toggled ),NULL ); | |
1151 gtk_signal_connect( GTK_OBJECT( CBDumpMPSub ),"toggled",GTK_SIGNAL_FUNC( on_CBDumpMPSub_toggled ),NULL ); | |
1152 gtk_signal_connect( GTK_OBJECT( CBDumpSrt ),"toggled",GTK_SIGNAL_FUNC( on_CBDumpSrt_toggled ),NULL ); | |
1153 #endif | |
1154 #if 0 | |
1155 gtk_signal_connect( GTK_OBJECT( RBOSDNone ),"toggled",GTK_SIGNAL_FUNC( on_RBOSDNone_toggled ),NULL ); | |
33777
235c6f2514be
Arrange OSD preferences according to option 'osdlevel'.
ib
parents:
33769
diff
changeset
|
1156 gtk_signal_connect( GTK_OBJECT( RBOSDIndicator ),"toggled",GTK_SIGNAL_FUNC( on_RBOSDIndicator_toggled ),NULL ); |
33572 | 1157 gtk_signal_connect( GTK_OBJECT( RBOSDTandP ),"toggled",GTK_SIGNAL_FUNC( on_RBOSDTandP_toggled ),NULL ); |
1158 gtk_signal_connect( GTK_OBJECT( RBOSDTPTT ),"toggled",GTK_SIGNAL_FUNC( on_RBOSDIndicator_toggled ),NULL ); | |
1159 gtk_signal_connect( GTK_OBJECT( CBAudioEqualizer ),"toggled",GTK_SIGNAL_FUNC( on_CBAudioEqualizer_toggled ),NULL ); | |
1160 #endif | |
1161 #if 0 | |
36101 | 1162 gtk_signal_connect( GTK_OBJECT( HSAudioDelay ),"motion-notify-event",GTK_SIGNAL_FUNC( on_HSAudioDelay_motion_notify_event ),NULL ); |
1163 gtk_signal_connect( GTK_OBJECT( HSPanscan ),"motion-notify-event",GTK_SIGNAL_FUNC( on_HSPanscan_motion_notify_event ),NULL ); | |
1164 gtk_signal_connect( GTK_OBJECT( label2 ),"motion-notify-event",GTK_SIGNAL_FUNC( on_label2_motion_notify_event ),NULL ); | |
1165 gtk_signal_connect( GTK_OBJECT( HSSubDelay ),"motion-notify-event",GTK_SIGNAL_FUNC( on_HSSubDelay_motion_notify_event ),NULL ); | |
1166 gtk_signal_connect( GTK_OBJECT( HSSubPosition ),"motion-notify-event",GTK_SIGNAL_FUNC( on_HSSubPosition_motion_notify_event ),NULL ); | |
1167 gtk_signal_connect( GTK_OBJECT( HSSubFPS ),"motion-notify-event",GTK_SIGNAL_FUNC( on_HSSubFPS_motion_notify_event ),NULL ); | |
1168 gtk_signal_connect( GTK_OBJECT( HSFontFactor ),"motion-notify-event",GTK_SIGNAL_FUNC( on_HSFontFactor_motion_notify_event ),NULL ); | |
1169 gtk_signal_connect( GTK_OBJECT( HSPPQuality ),"motion-notify-event",GTK_SIGNAL_FUNC( on_HSPPQuality_motion_notify_event ),NULL ); | |
33572 | 1170 #endif |
1171 | |
1172 gtk_notebook_set_page( GTK_NOTEBOOK( notebook1 ),2 ); | |
1173 | |
1174 gtk_window_add_accel_group( GTK_WINDOW( Preferences ),accel_group ); | |
1175 | |
1176 return Preferences; | |
1177 } | |
1178 | |
35994 | 1179 void ShowPreferences( void ) |
1180 { | |
36019 | 1181 if ( Preferences ) gtkRaise( Preferences ); |
35996 | 1182 else Preferences=CreatePreferences(); |
35994 | 1183 |
1184 /* 1st page */ | |
1185 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBAudioEqualizer ),gtkEnableAudioEqualizer ); | |
1186 #if 0 | |
1187 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBSurround ),gtkAOSurround ); | |
1188 #endif | |
1189 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBExtraStereo ),gtkAOExtraStereo ); | |
1190 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBNormalize ),gtkAONorm ); | |
1191 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBSoftwareMixer ),soft_vol ); | |
1192 gtk_adjustment_set_value( HSExtraStereoMuladj,gtkAOExtraStereoMul ); | |
1193 { | |
1194 int i = 0; | |
1195 char * tmp[3]; tmp[2]=""; | |
1196 old_audio_driver=-1; | |
1197 if ( CLADrivers ) gtk_clist_clear( GTK_CLIST( CLADrivers ) ); | |
1198 while ( audio_out_drivers[i] ) | |
1199 { | |
1200 const ao_info_t *info = audio_out_drivers[i++]->info; | |
1201 if ( !strcmp( info->short_name,"plugin" ) ) continue; | |
1202 if ( audio_driver_list ) | |
1203 { | |
1204 char * name = gstrdup( audio_driver_list[0] ); | |
1205 char * sep = gstrchr( audio_driver_list[0],':' ); | |
1206 if ( sep ) *sep=0; | |
36840 | 1207 if ( !gstrcmp( name,info->short_name ) ) old_audio_driver=i - 1; |
35994 | 1208 free( name ); |
1209 } | |
1210 tmp[0]=(char *)info->short_name; tmp[1]=(char *)info->name; gtk_clist_append( GTK_CLIST( CLADrivers ),tmp ); | |
1211 } | |
1212 if ( old_audio_driver > -1 ) | |
1213 { | |
1214 gtk_clist_select_row( GTK_CLIST( CLADrivers ),old_audio_driver,0 ); | |
1215 gtk_clist_get_text( GTK_CLIST( CLADrivers ),old_audio_driver,0,(char **)&ao_driver ); | |
1216 gtk_widget_set_sensitive( AConfig,FALSE ); | |
1217 if ( !strncmp( ao_driver[0],"oss",3 ) || | |
1218 !strncmp( ao_driver[0],"alsa",4 ) || | |
1219 !strncmp( ao_driver[0],"esd",3 ) || | |
1220 !strncmp( ao_driver[0],"sdl",3 ) ) | |
1221 gtk_widget_set_sensitive( AConfig,TRUE ); | |
1222 } | |
1223 } | |
1224 | |
1225 /* 2nd page */ | |
1226 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBDoubleBuffer ),vo_doublebuffering ); | |
1227 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBDR ),vo_directrendering ); | |
1228 | |
1229 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBFramedrop ),FALSE ); | |
1230 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBHFramedrop ),FALSE ); | |
1231 switch ( frame_dropping ) | |
1232 { | |
1233 case 2: gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBHFramedrop ),TRUE ); | |
1234 case 1: gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBFramedrop ),TRUE ); | |
1235 } | |
1236 | |
1237 if (flip != -1) | |
1238 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBFlip ),flip ); | |
1239 gtk_adjustment_set_value( HSPanscanadj,vo_panscan ); | |
1240 | |
1241 { | |
1242 int i = 0, c = 0; | |
1243 char * tmp[3]; tmp[2]=""; | |
1244 old_video_driver=0; | |
1245 if ( CLVDrivers ) gtk_clist_clear( GTK_CLIST( CLVDrivers ) ); | |
1246 while ( video_out_drivers[i] ) | |
1247 if ( video_out_drivers[i++]->control( VOCTRL_GUISUPPORT,NULL ) == VO_TRUE ) | |
1248 { | |
36840 | 1249 if ( video_driver_list && !gstrcmp( video_driver_list[0],video_out_drivers[i - 1]->info->short_name ) ) old_video_driver=c; c++; |
35994 | 1250 tmp[0]=(char *)video_out_drivers[i - 1]->info->short_name; tmp[1]=(char *)video_out_drivers[i - 1]->info->name; |
1251 gtk_clist_append( GTK_CLIST( CLVDrivers ),tmp ); | |
1252 } | |
1253 gtk_clist_select_row( GTK_CLIST( CLVDrivers ),old_video_driver,0 ); | |
1254 gtk_clist_get_text( GTK_CLIST( CLVDrivers ),old_video_driver,0,(char **)&vo_driver ); | |
1255 gtk_widget_set_sensitive( VConfig,FALSE ); | |
1256 #ifdef CONFIG_DXR3 | |
1257 if ( !gstrcmp( vo_driver[0],"dxr3" ) ) gtk_widget_set_sensitive( VConfig,TRUE ); | |
1258 #endif | |
1259 } | |
1260 | |
1261 gtk_adjustment_set_value( HSFPSadj,force_fps ); | |
1262 | |
1263 /* 3rd page */ | |
1264 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBSubOverlap ),suboverlap_enabled ); | |
36670 | 1265 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBNoAutoSub ),sub_auto ); |
35994 | 1266 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBDumpMPSub ),gtkSubDumpMPSub ); |
1267 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBDumpSrt ),gtkSubDumpSrt ); | |
36547 | 1268 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBSubUtf8 ),sub_utf8 ); |
35994 | 1269 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBSubUnicode ),sub_unicode ); |
1270 #ifdef CONFIG_ASS | |
1271 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBUseASS ),gtkASS.enabled ); | |
1272 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBASSUseMargins ),gtkASS.use_margins ); | |
36280 | 1273 gtk_spin_button_set_value( (GtkSpinButton *)SBASSTopMargin,gtkASS.top_margin ); |
1274 gtk_spin_button_set_value( (GtkSpinButton *)SBASSBottomMargin,gtkASS.bottom_margin ); | |
35994 | 1275 |
1276 if ( !gtkASS.enabled ) | |
1277 { | |
1278 gtk_widget_set_sensitive( CBASSUseMargins,FALSE ); | |
1279 gtk_widget_set_sensitive( SBASSTopMargin,FALSE ); | |
1280 gtk_widget_set_sensitive( SBASSBottomMargin,FALSE ); | |
1281 } | |
1282 #endif | |
1283 | |
1284 gtk_adjustment_set_value( HSSubDelayadj,sub_delay ); | |
1285 gtk_adjustment_set_value( HSSubFPSadj,sub_fps ); | |
1286 gtk_adjustment_set_value( HSSubPositionadj,sub_pos ); | |
1287 switch ( osd_level ) | |
1288 { | |
1289 case 0: gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( RBOSDNone ),TRUE ); break; | |
1290 case 1: gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( RBOSDIndicator ),TRUE ); break; | |
1291 case 2: gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( RBOSDTandP ),TRUE ); break; | |
1292 case 3: gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( RBOSDTPTT ),TRUE ); break; | |
1293 } | |
1294 #if 0 | |
1295 if ( guiInfo.SubtitleFilename ) gtk_entry_set_text( GTK_ENTRY( ESubtitleName ),guiInfo.SubtitleFilename ); | |
1296 #endif | |
1297 | |
1298 #ifdef CONFIG_ICONV | |
1299 if ( sub_cp ) | |
1300 { | |
1301 int i; | |
1302 for ( i=0;lEncoding[i].name;i++ ) | |
1303 if ( !strcasecmp( sub_cp,lEncoding[i].name ) ) break; | |
1304 if ( lEncoding[i].name ) gtk_entry_set_text( GTK_ENTRY( ESubEncoding ),lEncoding[i].comment ); | |
36563 | 1305 else gtk_entry_set_text( GTK_ENTRY( ESubEncoding ),sub_cp ); |
36564 | 1306 gtk_widget_set_sensitive( CBSubUtf8,FALSE ); |
1307 gtk_widget_set_sensitive( CBSubUnicode,FALSE ); | |
35994 | 1308 } |
36566 | 1309 else gtk_widget_set_sensitive( CBSubEncoding,(!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(CBSubUtf8)) && !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(CBSubUnicode))) ); |
35994 | 1310 #endif |
1311 | |
1312 /* 4th page */ | |
1313 /* font ... */ | |
1314 if ( font_name ) gtk_entry_set_text( GTK_ENTRY( prEFontName ),font_name ); | |
36584 | 1315 #ifdef CONFIG_FREETYPE |
36282
872298702c15
Increase precision of calculation by using constants of type double.
ib
parents:
36280
diff
changeset
|
1316 gtk_adjustment_set_value( HSFontBluradj,subtitle_font_radius / 8.0 * 100.0); // transform 0..8 to 0..100 |
872298702c15
Increase precision of calculation by using constants of type double.
ib
parents:
36280
diff
changeset
|
1317 gtk_adjustment_set_value( HSFontOutLineadj,subtitle_font_thickness / 8.0 * 100.0); // transform 0..8 to 0..100 |
35994 | 1318 gtk_adjustment_set_value( HSFontTextScaleadj,text_font_scale_factor ); |
1319 gtk_adjustment_set_value( HSFontOSDScaleadj,osd_font_scale_factor ); | |
36486 | 1320 { |
1321 int i; | |
36624 | 1322 const char *s = (subtitle_font_encoding ? subtitle_font_encoding : ENC_UNICODE); |
36486 | 1323 for ( i=0;lEncoding[i].name;i++ ) |
1324 if ( !strcasecmp( s,lEncoding[i].name ) ) break; | |
1325 if ( lEncoding[i].name ) gtk_entry_set_text( GTK_ENTRY( EFontEncoding ),lEncoding[i].comment ); | |
36608 | 1326 else gtk_entry_set_text( GTK_ENTRY( EFontEncoding ),s ); |
36486 | 1327 } |
35994 | 1328 switch ( subtitle_autoscale ) |
1329 { | |
1330 case 0: gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( RBFontNoAutoScale ),TRUE ); break; | |
1331 case 1: gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( RBFontAutoScaleHeight ),TRUE ); break; | |
1332 case 2: gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( RBFontAutoScaleWidth ),TRUE ); break; | |
1333 case 3: gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( RBFontAutoScaleDiagonal ),TRUE ); break; | |
1334 } | |
36584 | 1335 #else |
1336 gtk_adjustment_set_value( HSFontFactoradj,font_factor ); | |
35994 | 1337 #endif |
1338 | |
1339 /* 5th page */ | |
1340 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBNonInterlaved ),force_ni ); | |
1341 if ( index_mode == 1 ) gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBIndex ),1 ); | |
1342 { | |
1343 int i; | |
1344 GList * Items = NULL; | |
36842 | 1345 const char * name = NULL; |
35994 | 1346 |
36694 | 1347 Items=g_list_append( Items,MSGTR_GUI__Default_ ); |
35994 | 1348 for( i=0;mpcodecs_vd_drivers[i];i++ ) |
1349 { | |
1350 Items=g_list_append( Items,(char *)mpcodecs_vd_drivers[i]->info->name ); | |
36842 | 1351 if ( video_fm_list && !gstrcmp( video_fm_list[0],mpcodecs_vd_drivers[i]->info->short_name ) ) name=mpcodecs_vd_drivers[i]->info->name; |
35994 | 1352 } |
1353 gtk_combo_set_popdown_strings( GTK_COMBO( CBVFM ),Items ); | |
1354 g_list_free( Items ); | |
1355 if ( name ) gtk_entry_set_text( GTK_ENTRY( EVFM ),name ); | |
1356 } | |
1357 | |
1358 { | |
1359 int i; | |
1360 GList * Items = NULL; | |
36842 | 1361 const char * name = NULL; |
35994 | 1362 |
36694 | 1363 Items=g_list_append( Items,MSGTR_GUI__Default_ ); |
35994 | 1364 for( i=0;mpcodecs_ad_drivers[i];i++ ) |
1365 { | |
1366 Items=g_list_append( Items,(char *)mpcodecs_ad_drivers[i]->info->name ); | |
36842 | 1367 if ( audio_fm_list && !gstrcmp( audio_fm_list[0],mpcodecs_ad_drivers[i]->info->short_name ) ) name=mpcodecs_ad_drivers[i]->info->name; |
35994 | 1368 } |
1369 gtk_combo_set_popdown_strings( GTK_COMBO( CBAFM ),Items ); | |
1370 g_list_free( Items ); | |
1371 if ( name ) gtk_entry_set_text( GTK_ENTRY( EAFM ),name ); | |
1372 } | |
1373 | |
1374 /* 6th page */ | |
1375 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBPostprocess ),gtkVfPP ); | |
1376 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBLoadFullscreen ),gtkLoadFullscreen ); | |
1377 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBSaveWinPos ),gui_save_pos ); | |
36670 | 1378 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBShowVideoWindow ),!gtkShowVideoWindow ); |
35994 | 1379 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBStopXScreenSaver ),stop_xscreensaver ); |
1380 gtk_adjustment_set_value( HSPPQualityadj,auto_quality ); | |
1381 | |
1382 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBPlayBar ),gtkEnablePlayBar ); | |
1383 if ( !guiApp.playbarIsPresent ) | |
1384 { | |
1385 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBPlayBar ),0 ); | |
1386 gtk_widget_set_sensitive( CBPlayBar,FALSE ); | |
1387 } | |
36429 | 1388 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBTVDigital ),gui_tv_digital ); |
1389 #ifndef CONFIG_TV | |
1390 gtk_widget_set_sensitive( CBTVDigital,FALSE ); | |
1391 #endif | |
35994 | 1392 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBNoIdle ),!player_idle_mode ); |
1393 | |
1394 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBCache ),0 ); | |
36275 | 1395 gtk_adjustment_set_value( SBCacheadj,gtkCacheSize ); |
35994 | 1396 if ( !gtkCacheOn ) gtk_widget_set_sensitive( SBCache,FALSE ); |
1397 else gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBCache ),TRUE ); | |
1398 | |
1399 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBAutoSync ),0 ); | |
36275 | 1400 gtk_adjustment_set_value( SBAutoSyncadj,gtkAutoSync ); |
35994 | 1401 if ( !gtkAutoSyncOn ) gtk_widget_set_sensitive( SBAutoSync,FALSE ); |
1402 else gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBAutoSync ),TRUE ); | |
1403 | |
1404 if ( dvd_device ) gtk_entry_set_text( GTK_ENTRY( prEDVDDevice ),dvd_device ); | |
1405 else gtk_entry_set_text( GTK_ENTRY( prEDVDDevice ),DEFAULT_DVD_DEVICE ); | |
1406 if ( cdrom_device ) gtk_entry_set_text( GTK_ENTRY( prECDRomDevice ),cdrom_device ); | |
1407 else gtk_entry_set_text( GTK_ENTRY( prECDRomDevice ),DEFAULT_CDROM_DEVICE ); | |
1408 | |
1409 /* disables */ | |
1410 #ifndef CONFIG_ASS | |
1411 gtk_widget_set_sensitive( CBUseASS,FALSE ); | |
1412 gtk_widget_set_sensitive( CBASSUseMargins,FALSE ); | |
1413 gtk_widget_set_sensitive( SBASSTopMargin,FALSE ); | |
1414 gtk_widget_set_sensitive( SBASSBottomMargin,FALSE ); | |
1415 #endif | |
1416 | |
1417 /* signals */ | |
36776 | 1418 gtk_signal_connect( GTK_OBJECT( CBExtraStereo ),"toggled",GTK_SIGNAL_FUNC( prToggled ),GINT_TO_POINTER(0) ); |
1419 gtk_signal_connect( GTK_OBJECT( CBNormalize ),"toggled",GTK_SIGNAL_FUNC( prToggled ),GINT_TO_POINTER(1) ); | |
1420 gtk_signal_connect( GTK_OBJECT( CBSoftwareMixer ),"toggled",GTK_SIGNAL_FUNC( prToggled ),GINT_TO_POINTER(1) ); | |
1421 gtk_signal_connect( GTK_OBJECT( CBAudioEqualizer ),"toggled",GTK_SIGNAL_FUNC( prToggled ),GINT_TO_POINTER(2) ); | |
1422 gtk_signal_connect( GTK_OBJECT( CBShowVideoWindow ),"toggled",GTK_SIGNAL_FUNC( prToggled ), GINT_TO_POINTER(3) ); | |
35994 | 1423 #ifdef CONFIG_FREETYPE |
36776 | 1424 gtk_signal_connect( GTK_OBJECT( RBFontNoAutoScale ),"toggled",GTK_SIGNAL_FUNC( prToggled ),GINT_TO_POINTER(4) ); |
1425 gtk_signal_connect( GTK_OBJECT( RBFontAutoScaleHeight ),"toggled",GTK_SIGNAL_FUNC( prToggled ),GINT_TO_POINTER(5) ); | |
1426 gtk_signal_connect( GTK_OBJECT( RBFontAutoScaleWidth ),"toggled",GTK_SIGNAL_FUNC( prToggled ),GINT_TO_POINTER(6) ); | |
1427 gtk_signal_connect( GTK_OBJECT( RBFontAutoScaleDiagonal ),"toggled",GTK_SIGNAL_FUNC( prToggled ),GINT_TO_POINTER(7) ); | |
35994 | 1428 #endif |
36776 | 1429 gtk_signal_connect( GTK_OBJECT( CBCache ),"toggled",GTK_SIGNAL_FUNC( prToggled ),GINT_TO_POINTER(8)); |
1430 gtk_signal_connect( GTK_OBJECT( CBAutoSync ),"toggled",GTK_SIGNAL_FUNC( prToggled ),GINT_TO_POINTER(9)); | |
35994 | 1431 #ifdef CONFIG_ASS |
36776 | 1432 gtk_signal_connect( GTK_OBJECT( CBUseASS ),"toggled",GTK_SIGNAL_FUNC( prToggled ),GINT_TO_POINTER(10)); |
35994 | 1433 #endif |
1434 | |
36776 | 1435 gtk_signal_connect( GTK_OBJECT( HSExtraStereoMul ),"motion-notify-event",GTK_SIGNAL_FUNC( prHScaler ),GINT_TO_POINTER(0) ); |
1436 gtk_signal_connect( GTK_OBJECT( HSAudioDelay ),"motion-notify-event",GTK_SIGNAL_FUNC( prHScaler ),GINT_TO_POINTER(1) ); | |
1437 gtk_signal_connect( GTK_OBJECT( HSPanscan ),"motion-notify-event",GTK_SIGNAL_FUNC( prHScaler ),GINT_TO_POINTER(2) ); | |
1438 gtk_signal_connect( GTK_OBJECT( HSSubDelay ),"motion-notify-event",GTK_SIGNAL_FUNC( prHScaler ),GINT_TO_POINTER(3) ); | |
1439 gtk_signal_connect( GTK_OBJECT( HSSubPosition ),"motion-notify-event",GTK_SIGNAL_FUNC( prHScaler ),GINT_TO_POINTER(4) ); | |
36584 | 1440 #ifdef CONFIG_FREETYPE |
36776 | 1441 gtk_signal_connect( GTK_OBJECT( HSFontBlur ),"motion-notify-event",GTK_SIGNAL_FUNC( prHScaler ),GINT_TO_POINTER(6) ); |
1442 gtk_signal_connect( GTK_OBJECT( HSFontOutLine ),"motion-notify-event",GTK_SIGNAL_FUNC( prHScaler ),GINT_TO_POINTER(7) ); | |
1443 gtk_signal_connect( GTK_OBJECT( HSFontTextScale ),"motion-notify-event",GTK_SIGNAL_FUNC( prHScaler ),GINT_TO_POINTER(8) ); | |
1444 gtk_signal_connect( GTK_OBJECT( HSFontOSDScale ),"motion-notify-event",GTK_SIGNAL_FUNC( prHScaler ),GINT_TO_POINTER(9) ); | |
1445 gtk_signal_connect( GTK_OBJECT( EFontEncoding ),"changed",GTK_SIGNAL_FUNC( prEntry ),GINT_TO_POINTER(0) ); | |
36584 | 1446 #else |
36776 | 1447 gtk_signal_connect( GTK_OBJECT( HSFontFactor ),"motion-notify-event",GTK_SIGNAL_FUNC( prHScaler ),GINT_TO_POINTER(5) ); |
35994 | 1448 #endif |
1449 #ifdef CONFIG_ICONV | |
36776 | 1450 gtk_signal_connect( GTK_OBJECT( ESubEncoding ),"changed",GTK_SIGNAL_FUNC( prEntry ),GINT_TO_POINTER(1) ); |
35994 | 1451 #endif |
36776 | 1452 gtk_signal_connect( GTK_OBJECT( HSPPQuality ),"motion-notify-event",GTK_SIGNAL_FUNC( prHScaler ),GINT_TO_POINTER(10) ); |
35994 | 1453 |
36776 | 1454 gtk_signal_connect( GTK_OBJECT( CLADrivers ),"select-row",GTK_SIGNAL_FUNC( prCListRow ),GINT_TO_POINTER(0) ); |
1455 gtk_signal_connect( GTK_OBJECT( CLVDrivers ),"select-row",GTK_SIGNAL_FUNC( prCListRow ),GINT_TO_POINTER(1) ); | |
35994 | 1456 |
1457 gtk_widget_show( Preferences ); | |
1458 gtkSetLayer( Preferences ); | |
1459 } | |
1460 | |
33572 | 1461 #ifdef CONFIG_OSS_AUDIO |
1462 static GList *appendOSSDevices(GList *l) | |
1463 { | |
34684 | 1464 /* careful! the current implementation allows only string constants! */ |
33572 | 1465 l = g_list_append(l, (gpointer)"/dev/dsp"); |
1466 if (gtkAOOSSDevice && strncmp(gtkAOOSSDevice, "/dev/sound", 10) == 0) { | |
1467 l = g_list_append(l, (gpointer)"/dev/sound/dsp0"); | |
1468 l = g_list_append(l, (gpointer)"/dev/sound/dsp1"); | |
1469 l = g_list_append(l, (gpointer)"/dev/sound/dsp2"); | |
1470 l = g_list_append(l, (gpointer)"/dev/sound/dsp3"); | |
1471 } else { | |
1472 l = g_list_append(l, (gpointer)"/dev/dsp0"); | |
1473 l = g_list_append(l, (gpointer)"/dev/dsp1"); | |
1474 l = g_list_append(l, (gpointer)"/dev/dsp2"); | |
1475 l = g_list_append(l, (gpointer)"/dev/dsp3"); | |
1476 } | |
1477 #ifdef CONFIG_DXR3 | |
1478 l = g_list_append(l, (gpointer)"/dev/em8300_ma"); | |
1479 l = g_list_append(l, (gpointer)"/dev/em8300_ma-0"); | |
1480 l = g_list_append(l, (gpointer)"/dev/em8300_ma-1"); | |
1481 l = g_list_append(l, (gpointer)"/dev/em8300_ma-2"); | |
1482 l = g_list_append(l, (gpointer)"/dev/em8300_ma-3"); | |
1483 #endif | |
1484 return l; | |
1485 } | |
1486 | |
1487 static GList *appendOSSMixers(GList *l) | |
1488 { | |
34684 | 1489 /* careful! the current implementation allows only string constants! */ |
33572 | 1490 l = g_list_append(l, (gpointer)"/dev/mixer"); |
1491 if (gtkAOOSSMixer && strncmp(gtkAOOSSMixer, "/dev/sound", 10) == 0) { | |
1492 l = g_list_append(l, (gpointer)"/dev/sound/mixer0"); | |
1493 l = g_list_append(l, (gpointer)"/dev/sound/mixer1"); | |
1494 l = g_list_append(l, (gpointer)"/dev/sound/mixer2"); | |
1495 l = g_list_append(l, (gpointer)"/dev/sound/mixer3"); | |
1496 } else { | |
1497 l = g_list_append(l, (gpointer)"/dev/mixer0"); | |
1498 l = g_list_append(l, (gpointer)"/dev/mixer1"); | |
1499 l = g_list_append(l, (gpointer)"/dev/mixer2"); | |
1500 l = g_list_append(l, (gpointer)"/dev/mixer3"); | |
1501 } | |
1502 return l; | |
1503 } | |
1504 | |
1505 static GList *appendOSSMixerChannels(GList *l) | |
1506 { | |
1507 l = g_list_append(l, (gpointer)"vol"); | |
1508 l = g_list_append(l, (gpointer)"pcm"); | |
1509 l = g_list_append(l, (gpointer)"line"); | |
1510 return l; | |
1511 } | |
1512 #endif | |
1513 | |
1514 #ifdef CONFIG_ALSA | |
1515 static GList *appendALSADevices(GList *l) | |
1516 { | |
1517 l = g_list_append(l, (gpointer)"default"); | |
1518 l = g_list_append(l, (gpointer)"hw=0.0"); | |
1519 l = g_list_append(l, (gpointer)"hw=0.1"); | |
1520 l = g_list_append(l, (gpointer)"hw=0.2"); | |
1521 l = g_list_append(l, (gpointer)"surround40"); | |
1522 l = g_list_append(l, (gpointer)"surround51"); | |
1523 l = g_list_append(l, (gpointer)"plug=surround40"); | |
1524 l = g_list_append(l, (gpointer)"plug=surround51"); | |
1525 return l; | |
1526 } | |
1527 | |
1528 static GList *appendALSAMixers(GList *l) | |
1529 { | |
1530 l = g_list_append(l, (gpointer)"default"); | |
1531 return l; | |
1532 } | |
1533 | |
1534 static GList *appendALSAMixerChannels(GList *l) | |
1535 { | |
1536 l = g_list_append(l, (gpointer)"Master"); | |
1537 l = g_list_append(l, (gpointer)"Line"); | |
1538 l = g_list_append(l, (gpointer)"PCM"); | |
1539 l = g_list_append(l, (gpointer)"PCM,1"); | |
1540 return l; | |
1541 } | |
1542 #endif | |
1543 | |
1544 #ifdef CONFIG_SDL | |
1545 static GList *appendSDLDevices(GList *l) | |
1546 { | |
1547 l = g_list_append(l, (gpointer)"alsa"); | |
1548 l = g_list_append(l, (gpointer)"arts"); | |
1549 l = g_list_append(l, (gpointer)"esd"); | |
1550 l = g_list_append(l, (gpointer)"jack"); | |
1551 l = g_list_append(l, (gpointer)"oss"); | |
1552 l = g_list_append(l, (gpointer)"nas"); | |
1553 return l; | |
1554 } | |
1555 #endif | |
1556 | |
1557 #ifdef CONFIG_ESD | |
1558 static GList *appendESDDevices(GList *l) | |
1559 { | |
1560 l = g_list_append(l, (gpointer)"Enter Remote IP"); | |
1561 l = g_list_append(l, (gpointer)"Use Software Mixer"); | |
1562 return l; | |
1563 } | |
1564 #endif | |
1565 | |
34454 | 1566 #if defined(CONFIG_OSS_AUDIO) || defined(CONFIG_ALSA) || defined(CONFIG_SDL) || defined (CONFIG_ESD) |
33572 | 1567 // Gets text string from a gtk entry, interpreting |
36694 | 1568 // MSGTR_GUI_DefaultSetting as null string. |
33572 | 1569 static const char *getGtkEntryText(GtkWidget *from) |
1570 { | |
1571 const char *tmp = gtk_entry_get_text(GTK_ENTRY(from)); | |
36694 | 1572 if (strcmp(tmp, MSGTR_GUI_DefaultSetting) == 0) { |
33572 | 1573 tmp = NULL; |
1574 } | |
1575 return tmp; | |
1576 } | |
1577 | |
1578 // Sets text string of a gtk entry, interpreting | |
36694 | 1579 // null string as MSGTR_GUI_DefaultSetting. |
33572 | 1580 static void setGtkEntryText(GtkWidget *dest, char *to) |
1581 { | |
1582 if (!to) { | |
36694 | 1583 to = MSGTR_GUI_DefaultSetting; |
33572 | 1584 } |
1585 gtk_entry_set_text(GTK_ENTRY(dest),to); | |
1586 } | |
34454 | 1587 #endif |
33572 | 1588 |
1589 static GtkWidget *CEAudioDevice; | |
1590 static GtkWidget *CBAudioDevice; | |
1591 static GtkWidget *CEAudioMixer; | |
1592 static GtkWidget *CBAudioMixer; | |
1593 static GtkWidget *CEAudioMixerChannel; | |
1594 static GtkWidget *CBAudioMixerChannel; | |
1595 static GtkWidget *BAudioOk; | |
1596 static GtkWidget *BAudioCancel; | |
1597 | |
1598 static void audioButton(GtkButton *button, gpointer user_data) { | |
36010 | 1599 |
1600 (void) button; | |
1601 | |
36776 | 1602 switch( GPOINTER_TO_INT(user_data) ) { |
33572 | 1603 case 1: |
1604 #ifdef CONFIG_OSS_AUDIO | |
1605 if (strncmp(ao_driver[0], "oss", 3) == 0) { | |
33739 | 1606 nfree(gtkAOOSSDevice); |
33572 | 1607 gtkAOOSSDevice = gstrdup(getGtkEntryText(CEAudioDevice)); |
33739 | 1608 nfree(gtkAOOSSMixer); |
33572 | 1609 gtkAOOSSMixer = gstrdup(getGtkEntryText(CEAudioMixer)); |
33739 | 1610 nfree(gtkAOOSSMixerChannel); |
33572 | 1611 gtkAOOSSMixerChannel = gstrdup(getGtkEntryText(CEAudioMixerChannel)); |
1612 } | |
1613 #endif | |
1614 #ifdef CONFIG_ALSA | |
1615 if (strncmp(ao_driver[0], "alsa", 4) == 0) { | |
33739 | 1616 nfree(gtkAOALSADevice); |
33572 | 1617 gtkAOALSADevice = gstrdup(getGtkEntryText(CEAudioDevice)); |
33739 | 1618 nfree(gtkAOALSAMixer); |
33572 | 1619 gtkAOALSAMixer = gstrdup(getGtkEntryText(CEAudioMixer)); |
33739 | 1620 nfree(gtkAOALSAMixerChannel); |
33572 | 1621 gtkAOALSAMixerChannel = gstrdup(getGtkEntryText(CEAudioMixerChannel)); |
1622 } | |
1623 #endif | |
1624 #ifdef CONFIG_SDL | |
1625 if (strncmp(ao_driver[0], "sdl", 3) == 0) { | |
33739 | 1626 nfree(gtkAOSDLDriver); |
33572 | 1627 gtkAOSDLDriver = gstrdup(getGtkEntryText(CEAudioDevice)); |
1628 } | |
1629 #endif | |
1630 #ifdef CONFIG_ESD | |
1631 if (strncmp(ao_driver[0], "esd", 3) == 0) { | |
33739 | 1632 nfree(gtkAOESDDevice); |
33572 | 1633 gtkAOESDDevice = gstrdup(getGtkEntryText(CEAudioDevice)); |
1634 } | |
1635 #endif | |
1636 case 0: | |
36003
8fea01665c83
Remove HidePreferences(), HideAudioConfig() and HideDXR3Config().
ib
parents:
35996
diff
changeset
|
1637 gtk_widget_destroy(AudioConfig); |
33572 | 1638 break; |
1639 } | |
1640 } | |
1641 | |
35996 | 1642 static GtkWidget *CreateAudioConfig( void ) { |
33572 | 1643 GList *items = NULL; |
1644 GtkWidget *vbox; | |
1645 GtkWidget *table; | |
1646 GtkWidget *label; | |
1647 GtkWidget *hbuttonbox; | |
1648 GtkAccelGroup *accel_group; | |
1649 | |
1650 AudioConfig = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
36694 | 1651 gtk_window_set_title(GTK_WINDOW(AudioConfig), MSGTR_GUI_AudioDriverConfiguration); |
33572 | 1652 gtk_window_set_position(GTK_WINDOW(AudioConfig), GTK_WIN_POS_CENTER); |
36063 | 1653 gtk_window_set_policy(GTK_WINDOW(AudioConfig), FALSE, FALSE, TRUE); |
36055 | 1654 gtk_window_set_wmclass(GTK_WINDOW(AudioConfig), "AudioConfig", MPlayer); |
33572 | 1655 |
1656 gtk_widget_realize(AudioConfig); | |
1657 gtkAddIcon(AudioConfig); | |
1658 | |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
1659 vbox = gtkAddVBox(gtkAddDialogFrame(AudioConfig), 0); |
33572 | 1660 |
36585 | 1661 table = gtk_table_new(3, 2, FALSE); |
33572 | 1662 gtk_widget_show(table); |
1663 gtk_box_pack_start(GTK_BOX(vbox), table, TRUE, TRUE, 0); | |
1664 | |
36694 | 1665 label = gtkAddLabel(MSGTR_GUI_Device":", NULL); |
33572 | 1666 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(0), 0, 0); |
1667 | |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
1668 CBAudioDevice = gtkAddCombo(NULL); |
33572 | 1669 gtk_table_attach(GTK_TABLE(table), CBAudioDevice, 1, 2, 0, 1, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)(0), 0, 0); |
36694 | 1670 items = g_list_append(items,(gpointer)MSGTR_GUI_DefaultSetting); |
33572 | 1671 #ifdef CONFIG_OSS_AUDIO |
1672 if (strncmp(ao_driver[0], "oss", 3) == 0) | |
1673 items = appendOSSDevices(items); | |
1674 #endif | |
1675 #ifdef CONFIG_ALSA | |
1676 if (strncmp(ao_driver[0], "alsa", 4) == 0) | |
1677 items = appendALSADevices(items); | |
1678 #endif | |
1679 #ifdef CONFIG_SDL | |
1680 if (strncmp(ao_driver[0], "sdl", 3) == 0) | |
1681 items = appendSDLDevices(items); | |
1682 #endif | |
1683 #ifdef CONFIG_ESD | |
1684 if (strncmp(ao_driver[0], "esd", 3) == 0) | |
1685 items = appendESDDevices(items); | |
1686 #endif | |
1687 gtk_combo_set_popdown_strings(GTK_COMBO(CBAudioDevice), items); | |
1688 g_list_free(items); | |
1689 items = NULL; | |
1690 | |
1691 CEAudioDevice = GTK_COMBO(CBAudioDevice)->entry; | |
1692 gtk_widget_show(CEAudioDevice); | |
1693 | |
36694 | 1694 label = gtkAddLabel(MSGTR_GUI_Mixer":", NULL); |
33572 | 1695 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(0), 0, 0); |
1696 | |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
1697 CBAudioMixer = gtkAddCombo(NULL); |
33572 | 1698 gtk_table_attach(GTK_TABLE(table), CBAudioMixer, 1, 2, 1, 2, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)(0), 0, 0); |
36694 | 1699 items = g_list_append(items, (gpointer)MSGTR_GUI_DefaultSetting); |
33572 | 1700 #ifdef CONFIG_OSS_AUDIO |
1701 if (strncmp(ao_driver[0], "oss", 3) == 0) | |
1702 items = appendOSSMixers(items); | |
1703 #endif | |
1704 #ifdef CONFIG_ALSA | |
1705 if (strncmp(ao_driver[0], "alsa", 4) == 0) | |
1706 items = appendALSAMixers(items); | |
1707 #endif | |
1708 gtk_combo_set_popdown_strings(GTK_COMBO(CBAudioMixer), items); | |
1709 g_list_free(items); | |
1710 items = NULL; | |
1711 | |
1712 CEAudioMixer = GTK_COMBO(CBAudioMixer)->entry; | |
1713 gtk_widget_show(CEAudioMixer); | |
1714 | |
36694 | 1715 label = gtkAddLabel(MSGTR_GUI_MixerChannel":", NULL); |
33572 | 1716 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3, (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(0), 0, 0); |
1717 | |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
1718 CBAudioMixerChannel = gtkAddCombo(NULL); |
33572 | 1719 gtk_table_attach(GTK_TABLE(table), CBAudioMixerChannel, 1, 2, 2, 3, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)(0), 0, 0); |
36694 | 1720 items = g_list_append(items, (gpointer)MSGTR_GUI_DefaultSetting); |
33572 | 1721 #ifdef CONFIG_OSS_AUDIO |
1722 if (strncmp(ao_driver[0], "oss", 3) == 0) | |
1723 items = appendOSSMixerChannels(items); | |
1724 #endif | |
1725 #ifdef CONFIG_ALSA | |
1726 if (strncmp(ao_driver[0], "alsa", 4) == 0) | |
1727 items = appendALSAMixerChannels(items); | |
1728 #endif | |
1729 gtk_combo_set_popdown_strings(GTK_COMBO(CBAudioMixerChannel), items); | |
1730 g_list_free(items); | |
1731 items = NULL; | |
1732 | |
1733 CEAudioMixerChannel = GTK_COMBO(CBAudioMixerChannel)->entry; | |
1734 gtk_widget_show(CEAudioMixerChannel); | |
1735 | |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
1736 gtkAddHSeparator(vbox); |
33572 | 1737 |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
1738 hbuttonbox = gtkAddHButtonBox(vbox); |
33572 | 1739 gtk_button_box_set_layout(GTK_BUTTON_BOX(hbuttonbox), GTK_BUTTONBOX_END); |
1740 gtk_button_box_set_spacing(GTK_BUTTON_BOX(hbuttonbox), 10); | |
36694 | 1741 BAudioOk = gtkAddButton(MSGTR_GUI_Ok, hbuttonbox); |
1742 BAudioCancel = gtkAddButton(MSGTR_GUI_Cancel, hbuttonbox); | |
33572 | 1743 |
36008 | 1744 gtk_signal_connect(GTK_OBJECT(AudioConfig), "destroy", GTK_SIGNAL_FUNC(gtk_widget_destroyed), &AudioConfig); |
36776 | 1745 gtk_signal_connect(GTK_OBJECT(BAudioOk), "clicked", GTK_SIGNAL_FUNC(audioButton), GINT_TO_POINTER(1)); |
1746 gtk_signal_connect(GTK_OBJECT(BAudioCancel), "clicked", GTK_SIGNAL_FUNC(audioButton), GINT_TO_POINTER(0)); | |
33572 | 1747 |
1748 accel_group = gtk_accel_group_new(); | |
1749 gtk_widget_add_accelerator(BAudioOk, "clicked", accel_group, GDK_Return, 0, GTK_ACCEL_VISIBLE); | |
1750 gtk_widget_add_accelerator(BAudioCancel, "clicked", accel_group, GDK_Escape, 0, GTK_ACCEL_VISIBLE); | |
1751 gtk_window_add_accel_group(GTK_WINDOW(AudioConfig), accel_group); | |
1752 | |
1753 return AudioConfig; | |
1754 } | |
1755 | |
35993 | 1756 void ShowAudioConfig( void ) { |
36019 | 1757 if (AudioConfig) gtkRaise(AudioConfig); |
35996 | 1758 else AudioConfig = CreateAudioConfig(); |
35993 | 1759 |
1760 #ifdef CONFIG_OSS_AUDIO | |
1761 if (strncmp(ao_driver[0], "oss", 3) == 0) { | |
1762 setGtkEntryText(CEAudioDevice, gtkAOOSSDevice); | |
1763 setGtkEntryText(CEAudioMixer, gtkAOOSSMixer); | |
1764 setGtkEntryText(CEAudioMixerChannel, gtkAOOSSMixerChannel); | |
1765 } | |
1766 #endif | |
1767 #ifdef CONFIG_ALSA | |
1768 if (strncmp(ao_driver[0], "alsa", 4) == 0) { | |
1769 setGtkEntryText(CEAudioDevice, gtkAOALSADevice); | |
1770 setGtkEntryText(CEAudioMixer, gtkAOALSAMixer); | |
1771 setGtkEntryText(CEAudioMixerChannel, gtkAOALSAMixerChannel); | |
1772 } | |
1773 #endif | |
1774 #ifdef CONFIG_SDL | |
1775 if (strncmp(ao_driver[0], "sdl", 3) == 0) { | |
1776 setGtkEntryText(CEAudioDevice, gtkAOSDLDriver); | |
1777 } | |
1778 #endif | |
1779 #ifdef CONFIG_ESD | |
1780 if (strncmp(ao_driver[0], "esd", 3) == 0) { | |
1781 setGtkEntryText(CEAudioDevice, gtkAOESDDevice); | |
1782 } | |
1783 #endif | |
1784 | |
1785 gtk_widget_show(AudioConfig); | |
1786 gtkSetLayer(AudioConfig); | |
1787 } | |
1788 | |
34684 | 1789 /* dxr3 config box */ |
33572 | 1790 |
1791 static GtkWidget * CBDevice; | |
1792 static GtkWidget * CEDXR3Device; | |
1793 static GtkWidget * RBVNone; | |
1794 static GtkWidget * RBVLavc; | |
1795 static GtkWidget * dxr3BOk; | |
1796 static GtkWidget * dxr3BCancel; | |
1797 | |
35996 | 1798 GtkWidget * CreateDXR3Config( void ); |
33572 | 1799 |
1800 void ShowDXR3Config( void ) | |
1801 { | |
36019 | 1802 if ( DXR3Config ) gtkRaise( DXR3Config ); |
35996 | 1803 else DXR3Config=CreateDXR3Config(); |
33572 | 1804 |
1805 gtk_entry_set_text( GTK_ENTRY( CEDXR3Device ),gtkDXR3Device ); | |
1806 | |
1807 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( RBVNone ),TRUE ); | |
1808 if ( gtkVfLAVC ) gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( RBVLavc ),TRUE ); | |
1809 | |
1810 gtk_widget_show( DXR3Config ); | |
1811 gtkSetLayer( DXR3Config ); | |
1812 } | |
1813 | |
1814 static void dxr3Button( GtkButton * button,gpointer user_data ) | |
1815 { | |
36010 | 1816 (void) button; |
1817 | |
36776 | 1818 switch ( GPOINTER_TO_INT(user_data) ) |
33572 | 1819 { |
1820 case 0: // Ok | |
33739 | 1821 nfree( gtkDXR3Device ); gtkDXR3Device=strdup( gtk_entry_get_text( GTK_ENTRY( CEDXR3Device ) ) ); |
33572 | 1822 gtkVfLAVC=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBVLavc ) ); |
1823 case 1: // Cancel | |
36003
8fea01665c83
Remove HidePreferences(), HideAudioConfig() and HideDXR3Config().
ib
parents:
35996
diff
changeset
|
1824 gtk_widget_destroy( DXR3Config ); |
33572 | 1825 break; |
1826 } | |
1827 } | |
1828 | |
35996 | 1829 GtkWidget * CreateDXR3Config( void ) |
33572 | 1830 { |
1831 GtkWidget * vbox1; | |
1832 GtkWidget * vbox2; | |
1833 GtkWidget * hbox1; | |
1834 GList * CBDevice_items = NULL; | |
1835 GtkWidget * vbox3; | |
1836 GSList * VEncoder_group = NULL; | |
1837 GtkWidget * hbuttonbox1; | |
1838 GtkAccelGroup * accel_group; | |
1839 | |
1840 accel_group=gtk_accel_group_new(); | |
1841 | |
1842 DXR3Config=gtk_window_new( GTK_WINDOW_TOPLEVEL ); | |
1843 // gtk_widget_set_usize( DXR3Config,300,156 ); | |
1844 gtk_window_set_title( GTK_WINDOW( DXR3Config ),"DXR3/H+" ); | |
1845 gtk_window_set_position( GTK_WINDOW( DXR3Config ),GTK_WIN_POS_CENTER ); | |
36063 | 1846 gtk_window_set_policy( GTK_WINDOW( DXR3Config ),FALSE,FALSE,TRUE ); |
36055 | 1847 gtk_window_set_wmclass( GTK_WINDOW( DXR3Config ),"DXR3Config",MPlayer ); |
33572 | 1848 |
1849 gtk_widget_realize( DXR3Config ); | |
1850 gtkAddIcon( DXR3Config ); | |
1851 | |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
1852 vbox1=gtkAddVBox( gtkAddDialogFrame( DXR3Config ),0 ); |
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
1853 vbox2=gtkAddVBox( vbox1,0 ); |
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
1854 hbox1=gtkAddHBox( vbox2,1 ); |
36694 | 1855 gtkAddLabel( MSGTR_GUI_Device":",hbox1 ); |
33572 | 1856 |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
1857 CBDevice=gtkAddCombo( hbox1 ); |
33572 | 1858 |
1859 CBDevice_items=g_list_append( CBDevice_items,( gpointer ) "/dev/em8300" ); | |
1860 CBDevice_items=g_list_append( CBDevice_items,( gpointer ) "/dev/em8300-0" ); | |
1861 CBDevice_items=g_list_append( CBDevice_items,( gpointer ) "/dev/em8300-1" ); | |
1862 CBDevice_items=g_list_append( CBDevice_items,( gpointer ) "/dev/em8300-2" ); | |
1863 CBDevice_items=g_list_append( CBDevice_items,( gpointer ) "/dev/em8300-3" ); | |
1864 gtk_combo_set_popdown_strings( GTK_COMBO( CBDevice ),CBDevice_items ); | |
1865 g_list_free( CBDevice_items ); | |
1866 | |
1867 CEDXR3Device=GTK_COMBO( CBDevice )->entry; | |
1868 gtk_widget_show( CEDXR3Device ); | |
1869 gtk_entry_set_text( GTK_ENTRY( CEDXR3Device ),"/dev/em8300" ); | |
1870 | |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
1871 gtkAddHSeparator( vbox2 ); |
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
1872 vbox3=gtkAddVBox( vbox2,0 ); |
36694 | 1873 gtkAddLabel( MSGTR_GUI_VideoEncoder":",vbox3 ); |
1874 RBVNone=gtkAddRadioButton( MSGTR_GUI_None,&VEncoder_group,vbox3 ); | |
1875 RBVLavc=gtkAddRadioButton( MSGTR_GUI_Lavc,&VEncoder_group,vbox3 ); | |
33572 | 1876 |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
1877 gtkAddHSeparator( vbox1 ); |
33572 | 1878 |
36023
a04e8798227b
Cosmetic: Prefix all functions in dialog/tools.c with gtk.
ib
parents:
36019
diff
changeset
|
1879 hbuttonbox1=gtkAddHButtonBox( vbox1 ); |
33572 | 1880 gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox1 ),GTK_BUTTONBOX_END ); |
1881 gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox1 ),10 ); | |
36694 | 1882 dxr3BOk=gtkAddButton( MSGTR_GUI_Ok,hbuttonbox1 ); |
1883 dxr3BCancel=gtkAddButton( MSGTR_GUI_Cancel,hbuttonbox1 ); | |
33572 | 1884 |
1885 gtk_widget_add_accelerator( dxr3BOk,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE ); | |
1886 gtk_widget_add_accelerator( dxr3BCancel,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE ); | |
1887 | |
36008 | 1888 gtk_signal_connect( GTK_OBJECT( DXR3Config ),"destroy",GTK_SIGNAL_FUNC( gtk_widget_destroyed ),&DXR3Config ); |
33572 | 1889 |
36776 | 1890 gtk_signal_connect( GTK_OBJECT( dxr3BOk ),"clicked",GTK_SIGNAL_FUNC( dxr3Button ),GINT_TO_POINTER(0) ); |
1891 gtk_signal_connect( GTK_OBJECT( dxr3BCancel ),"clicked",GTK_SIGNAL_FUNC( dxr3Button ),GINT_TO_POINTER(1) ); | |
33572 | 1892 |
1893 gtk_window_add_accel_group( GTK_WINDOW( DXR3Config ),accel_group ); | |
1894 | |
1895 return DXR3Config; | |
1896 } |