Mercurial > mplayer.hg
annotate gui/mplayer/gtk/eq.c @ 32886:5522b2153a0d
Use mp_asprintf in get_metadata instead of limited stack buffer.
author | cboesch |
---|---|
date | Sat, 26 Feb 2011 11:58:53 +0000 |
parents | 32725ca88fed |
children | c5a19bbeac2b |
rev | line source |
---|---|
26458 | 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 */ | |
23077 | 18 |
19 #include <stdlib.h> | |
20 #include <stdio.h> | |
21 #include <sys/types.h> | |
22 #include <sys/stat.h> | |
23 #include <unistd.h> | |
24 #include <string.h> | |
25 | |
26 #include <gdk/gdkkeysyms.h> | |
27 #include <gtk/gtk.h> | |
28 | |
26203 | 29 #include "config.h" |
26365
10dfbc523184
Add gui/ prefix to some #include paths so that compilation from the
diego
parents:
26203
diff
changeset
|
30 #include "gui/app.h" |
10dfbc523184
Add gui/ prefix to some #include paths so that compilation from the
diego
parents:
26203
diff
changeset
|
31 #include "gui/cfg.h" |
23077 | 32 #include "help_mp.h" |
33 #include "libaf/equalizer.h" | |
34 #include "libvo/video_out.h" | |
23154
e564b9cd7290
Fix several implicit declarations of functions warnings.
diego
parents:
23077
diff
changeset
|
35 #include "stream/stream.h" |
e564b9cd7290
Fix several implicit declarations of functions warnings.
diego
parents:
23077
diff
changeset
|
36 #include "libmpdemux/demuxer.h" |
e564b9cd7290
Fix several implicit declarations of functions warnings.
diego
parents:
23077
diff
changeset
|
37 #include "libmpdemux/stheader.h" |
e564b9cd7290
Fix several implicit declarations of functions warnings.
diego
parents:
23077
diff
changeset
|
38 #include "libmpcodecs/dec_video.h" |
26382
b2f4abcf20ed
Make include paths consistent; do not use ../ in them.
diego
parents:
26365
diff
changeset
|
39 #include "gui/mplayer/widgets.h" |
23077 | 40 |
41 #include "eq.h" | |
25601
8a0adeba5910
Rename common.[ch] to gtk_common.[ch], there are too many files by that name.
diego
parents:
23154
diff
changeset
|
42 #include "gtk_common.h" |
23077 | 43 |
44 #define eqRange 15 | |
45 | |
46 GtkWidget * Equalizer = NULL; | |
47 static GtkWidget * EquConfig; | |
48 | |
49 static GtkWidget * Notebook; | |
50 static GtkWidget * ChannelsList; | |
51 static GtkWidget * VContrast, * VBrightness, * VHue, * VSaturation; | |
52 static GtkAdjustment * VContrastadj, * VBrightnessadj, * VHueadj, * VSaturationadj; | |
53 static GtkWidget * Ok, * Clear, * Config; | |
54 static GtkWidget * A3125, * A125, * A6250, * A250, * A500, * A1000, * A2000, * A4000, * A8000, * A16000; | |
55 static GtkAdjustment * A3125adj, * A125adj, * A6250adj, * A250adj, * A500adj, * A1000adj, * A2000adj, * A4000adj, * A8000adj, * A16000adj; | |
56 | |
57 static int Channel = -1; | |
58 | |
59 // --- | |
60 | |
61 char * gtkEquChannel1 = NULL; | |
62 char * gtkEquChannel2 = NULL; | |
63 char * gtkEquChannel3 = NULL; | |
64 char * gtkEquChannel4 = NULL; | |
65 char * gtkEquChannel5 = NULL; | |
66 char * gtkEquChannel6 = NULL; | |
67 | |
68 // --- | |
69 | |
70 void ShowEquConfig( void ); | |
71 void HideEquConfig( void ); | |
72 | |
73 static void eqSetBands( int channel ) | |
74 { | |
75 if ( channel < 0 ) channel=0; | |
76 gtk_adjustment_set_value( A3125adj,0.0f - gtkEquChannels[channel][0] ); | |
77 gtk_adjustment_set_value( A6250adj,0.0f - gtkEquChannels[channel][1] ); | |
78 gtk_adjustment_set_value( A125adj,0.0f - gtkEquChannels[channel][2] ); | |
79 gtk_adjustment_set_value( A250adj,0.0f - gtkEquChannels[channel][3] ); | |
80 gtk_adjustment_set_value( A500adj,0.0f - gtkEquChannels[channel][4] ); | |
81 gtk_adjustment_set_value( A1000adj,0.0f - gtkEquChannels[channel][5] ); | |
82 gtk_adjustment_set_value( A2000adj,0.0f - gtkEquChannels[channel][6] ); | |
83 gtk_adjustment_set_value( A4000adj,0.0f - gtkEquChannels[channel][7] ); | |
84 gtk_adjustment_set_value( A8000adj,0.0f - gtkEquChannels[channel][8] ); | |
85 gtk_adjustment_set_value( A16000adj,0.0f - gtkEquChannels[channel][9] ); | |
86 | |
87 if ( guiIntfStruct.sh_video ) | |
88 { | |
89 get_video_colors( guiIntfStruct.sh_video,"brightness",&vo_gamma_brightness ); | |
90 get_video_colors( guiIntfStruct.sh_video,"contrast",&vo_gamma_contrast ); | |
91 get_video_colors( guiIntfStruct.sh_video,"hue",&vo_gamma_hue ); | |
92 get_video_colors( guiIntfStruct.sh_video,"saturation",&vo_gamma_saturation ); | |
93 } | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26458
diff
changeset
|
94 |
23077 | 95 gtk_adjustment_set_value( VContrastadj,(float)vo_gamma_contrast ); |
96 gtk_adjustment_set_value( VBrightnessadj,(float)vo_gamma_brightness ); | |
97 gtk_adjustment_set_value( VHueadj,(float)vo_gamma_hue ); | |
98 gtk_adjustment_set_value( VSaturationadj,(float)vo_gamma_saturation ); | |
99 } | |
100 | |
101 static void eqSetChannelNames( void ) | |
102 { | |
103 gchar * str[2]; | |
104 gtk_clist_clear( GTK_CLIST( ChannelsList ) ); | |
105 str[1]=""; | |
106 str[0]=MSGTR_EQU_All; | |
107 gtk_clist_append( GTK_CLIST( ChannelsList ) ,str); | |
108 if ( guiIntfStruct.AudioType > 1 ) | |
109 { | |
110 str[0]=gtkEquChannel1; gtk_clist_append( GTK_CLIST( ChannelsList ) ,str); | |
111 str[0]=gtkEquChannel2; gtk_clist_append( GTK_CLIST( ChannelsList ) ,str); | |
112 } | |
113 if ( guiIntfStruct.AudioType > 2 ) | |
114 { | |
115 str[0]=gtkEquChannel3; gtk_clist_append( GTK_CLIST( ChannelsList ) ,str); | |
116 str[0]=gtkEquChannel4; gtk_clist_append( GTK_CLIST( ChannelsList ) ,str); | |
117 } | |
118 if ( guiIntfStruct.AudioType > 4 ) | |
119 { | |
120 str[0]=gtkEquChannel5; gtk_clist_append( GTK_CLIST( ChannelsList ) ,str); | |
121 str[0]=gtkEquChannel6; gtk_clist_append( GTK_CLIST( ChannelsList ) ,str); | |
122 } | |
123 gtk_clist_select_row( GTK_CLIST( ChannelsList ),0,0 ); | |
124 } | |
125 | |
126 void ShowEqualizer( void ) | |
127 { | |
128 if ( Equalizer ) gtkActive( Equalizer ); | |
129 else Equalizer=create_Equalizer(); | |
130 | |
131 if ( !gtkEquChannel1 ) gtkEquChannel1=strdup( MSGTR_EQU_Front_Right ); | |
132 if ( !gtkEquChannel2 ) gtkEquChannel2=strdup( MSGTR_EQU_Front_Left ); | |
133 if ( !gtkEquChannel3 ) gtkEquChannel3=strdup( MSGTR_EQU_Back_Right ); | |
134 if ( !gtkEquChannel4 ) gtkEquChannel4=strdup( MSGTR_EQU_Back_Left ); | |
135 if ( !gtkEquChannel5 ) gtkEquChannel5=strdup( MSGTR_EQU_Center ); | |
136 if ( !gtkEquChannel6 ) gtkEquChannel6=strdup( MSGTR_EQU_Bass ); | |
137 | |
138 eqSetChannelNames(); | |
139 | |
140 if ( !guiIntfStruct.Playing || !guiIntfStruct.sh_video ) | |
141 { | |
142 gtk_widget_set_sensitive( VContrast,FALSE ); | |
143 gtk_widget_set_sensitive( VBrightness,FALSE ); | |
144 gtk_widget_set_sensitive( VHue,FALSE ); | |
145 gtk_widget_set_sensitive( VSaturation,FALSE ); | |
146 } | |
147 Channel=-1; | |
148 eqSetBands( 0 ); | |
149 if ( !guiIntfStruct.Playing || !gtkEnableAudioEqualizer ) | |
150 { | |
151 gtk_widget_set_sensitive( ChannelsList,FALSE ); | |
152 gtk_widget_set_sensitive( A3125,FALSE ); | |
153 gtk_widget_set_sensitive( A125,FALSE ); | |
154 gtk_widget_set_sensitive( A6250,FALSE ); | |
155 gtk_widget_set_sensitive( A250,FALSE ); | |
156 gtk_widget_set_sensitive( A500,FALSE ); | |
157 gtk_widget_set_sensitive( A1000,FALSE ); | |
158 gtk_widget_set_sensitive( A2000,FALSE ); | |
159 gtk_widget_set_sensitive( A4000,FALSE ); | |
160 gtk_widget_set_sensitive( A8000,FALSE ); | |
161 gtk_widget_set_sensitive( A16000,FALSE ); | |
162 } | |
163 | |
164 if ( gtk_notebook_get_current_page( GTK_NOTEBOOK( Notebook ) ) == 0 ) gtk_widget_show( Config ); | |
165 gtk_widget_show( Equalizer ); | |
166 } | |
167 | |
30535
016e5fc1dead
GUI: Mark functions that are not used outside their files as static.
diego
parents:
29263
diff
changeset
|
168 static void HideEqualizer( void ) |
23077 | 169 { |
170 if ( !Equalizer ) return; | |
171 gtk_widget_hide( Equalizer ); | |
172 gtk_widget_destroy( Equalizer ); | |
173 Equalizer=NULL; | |
174 if ( EquConfig ) HideEquConfig(); | |
175 } | |
176 | |
177 static gboolean eqHScaleMotion( GtkWidget * widget,GdkEventMotion * event,gpointer user_data ) | |
178 { | |
179 equalizer_t eq; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26458
diff
changeset
|
180 switch ( (int)user_data ) |
23077 | 181 { |
182 case 0: eq.gain=A3125adj->value; break; | |
183 case 1: eq.gain=A6250adj->value; break; | |
184 case 2: eq.gain=A125adj->value; break; | |
185 case 3: eq.gain=A250adj->value; break; | |
186 case 4: eq.gain=A500adj->value; break; | |
187 case 5: eq.gain=A1000adj->value; break; | |
188 case 6: eq.gain=A2000adj->value; break; | |
189 case 7: eq.gain=A4000adj->value; break; | |
190 case 8: eq.gain=A8000adj->value; break; | |
191 case 9: eq.gain=A16000adj->value; break; | |
192 default: return FALSE; | |
193 } | |
194 eq.gain=0.0f - eq.gain; | |
195 eq.band=(int)user_data; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26458
diff
changeset
|
196 if ( Channel == -1 ) |
23077 | 197 { |
198 int i; | |
199 for ( i=0;i<6;i++ ) | |
200 { eq.channel=i; gtkSet( gtkSetEqualizer,0,&eq ); } | |
201 } else { eq.channel=Channel; gtkSet( gtkSetEqualizer,0,&eq ); } | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26458
diff
changeset
|
202 |
23077 | 203 return FALSE; |
204 } | |
205 | |
206 static gboolean eqVScaleMotion( GtkWidget * widget,GdkEventMotion * event,gpointer user_data ) | |
207 { | |
208 | |
209 switch( (int)user_data ) | |
210 { | |
211 case 1: gtkSet( gtkSetContrast,VContrastadj->value,NULL ); break; | |
212 case 2: gtkSet( gtkSetBrightness,VBrightnessadj->value,NULL ); break; | |
213 case 3: gtkSet( gtkSetHue,VHueadj->value,NULL ); break; | |
214 case 4: gtkSet( gtkSetSaturation,VSaturationadj->value,NULL ); break; | |
215 } | |
216 | |
217 return FALSE; | |
218 } | |
219 | |
220 static void eqButtonReleased( GtkButton * button,gpointer user_data ) | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26458
diff
changeset
|
221 { |
23077 | 222 switch( (int)user_data ) |
223 { | |
224 case 0: HideEqualizer(); break; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26458
diff
changeset
|
225 case 1: |
23077 | 226 if ( gtk_notebook_get_current_page( GTK_NOTEBOOK( Notebook ) ) == 0 ) |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26458
diff
changeset
|
227 { |
23077 | 228 if ( !guiIntfStruct.Playing || !gtkEnableAudioEqualizer ) break; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26458
diff
changeset
|
229 gtkSet( gtkSetEqualizer,0,NULL ); |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26458
diff
changeset
|
230 eqSetBands( Channel ); |
23077 | 231 } |
232 else | |
233 { | |
234 if ( !guiIntfStruct.Playing ) break; | |
235 gtkSet( gtkSetContrast,0.0f,NULL ); | |
236 gtkSet( gtkSetBrightness,0.0f,NULL ); | |
237 gtkSet( gtkSetHue,0.0f,NULL ); | |
238 gtkSet( gtkSetSaturation,0.0f,NULL ); | |
239 eqSetBands( Channel ); | |
240 } | |
241 break; | |
242 case 2: | |
243 ShowEquConfig(); | |
244 break; | |
245 } | |
246 } | |
247 | |
248 static void eqFocus( GtkWindow * window,GtkWidget * widget,gpointer user_data ) | |
249 { eqSetBands( Channel ); } | |
250 | |
251 static void eqSelectChannelsListRow( GtkCList * clist,gint row,gint column,GdkEvent * event,gpointer user_data ) | |
252 { | |
253 Channel=row - 1; | |
254 eqSetBands( Channel ); | |
255 if ( Channel == -1 ) | |
256 { | |
257 int i,j; equalizer_t eq; | |
258 for ( i=1;i<6;i++ ) | |
259 for ( j=0;j<10;j++ ) | |
260 { eq.band=j; eq.channel=i; eq.gain=gtkEquChannels[0][j]; gtkSet( gtkSetEqualizer,0,&eq ); } | |
261 } | |
262 } | |
263 | |
30535
016e5fc1dead
GUI: Mark functions that are not used outside their files as static.
diego
parents:
29263
diff
changeset
|
264 static void eqNotebook( GtkNotebook * notebook, GtkNotebookPage * page, |
016e5fc1dead
GUI: Mark functions that are not used outside their files as static.
diego
parents:
29263
diff
changeset
|
265 gint page_num, gpointer user_data ) |
23077 | 266 { |
267 if ( page_num ) gtk_widget_hide( Config ); | |
268 else gtk_widget_show( Config ); | |
269 } | |
270 | |
271 GtkWidget * create_Equalizer( void ) | |
272 { | |
273 GtkWidget * vbox1; | |
274 GtkWidget * hbox1; | |
275 GtkWidget * scrolledwindow1; | |
276 GtkWidget * table1; | |
277 GtkWidget * hbuttonbox1; | |
278 GtkAccelGroup * accel_group; | |
279 | |
280 accel_group=gtk_accel_group_new(); | |
281 | |
282 Equalizer=gtk_window_new( GTK_WINDOW_TOPLEVEL ); | |
283 gtk_widget_set_name( Equalizer,MSGTR_Equalizer ); | |
284 gtk_object_set_data( GTK_OBJECT( Equalizer ),MSGTR_Equalizer,Equalizer ); | |
285 gtk_widget_set_usize( Equalizer,-1,256 ); | |
286 gtk_window_set_title( GTK_WINDOW( Equalizer ),MSGTR_Equalizer ); | |
287 gtk_window_set_position( GTK_WINDOW( Equalizer ),GTK_WIN_POS_CENTER ); | |
288 gtk_window_set_policy( GTK_WINDOW( Equalizer ),FALSE,FALSE,FALSE ); | |
289 gtk_window_set_wmclass( GTK_WINDOW( Equalizer ),"Equalizer","MPlayer" ); | |
290 | |
291 gtk_widget_realize( Equalizer ); | |
292 gtkAddIcon( Equalizer ); | |
293 | |
294 vbox1=AddVBox( AddDialogFrame( Equalizer ),0 ); | |
295 | |
296 Notebook=gtk_notebook_new(); | |
297 gtk_widget_set_name( Notebook,"Notebook" ); | |
298 gtk_widget_show( Notebook ); | |
299 gtk_box_pack_start( GTK_BOX( vbox1 ),Notebook,TRUE,TRUE,0 ); | |
300 gtk_container_set_border_width( GTK_CONTAINER( Notebook ),1 ); | |
301 | |
302 hbox1=AddHBox( Notebook,0 ); | |
303 | |
304 scrolledwindow1=gtk_scrolled_window_new( NULL,NULL ); | |
305 gtk_widget_set_name( scrolledwindow1,"scrolledwindow1" ); | |
306 gtk_widget_show( scrolledwindow1 ); | |
307 gtk_box_pack_start( GTK_BOX( hbox1 ),scrolledwindow1,FALSE,FALSE,0 ); | |
308 gtk_widget_set_usize( scrolledwindow1,106,-2 ); | |
309 gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scrolledwindow1 ),GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC ); | |
310 | |
311 ChannelsList=gtk_clist_new( 1 ); | |
312 gtk_widget_set_name( ChannelsList,"ChannelsList" ); | |
313 gtk_widget_show( ChannelsList ); | |
314 gtk_container_add( GTK_CONTAINER( scrolledwindow1 ),ChannelsList ); | |
315 gtk_clist_set_column_width( GTK_CLIST( ChannelsList ),0,80 ); | |
316 gtk_clist_column_titles_hide( GTK_CLIST( ChannelsList ) ); | |
317 | |
318 table1=gtk_table_new( 2,10,FALSE ); | |
319 gtk_widget_set_name( table1,"table1" ); | |
320 gtk_widget_show( table1 ); | |
321 gtk_box_pack_start( GTK_BOX( hbox1 ),table1,FALSE,FALSE,0 ); | |
322 gtk_table_set_row_spacings( GTK_TABLE( table1 ),4 ); | |
323 gtk_table_set_col_spacings( GTK_TABLE( table1 ),9 ); | |
324 | |
325 A3125adj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-eqRange,eqRange,0.5,0,0 ) ); | |
326 A3125=AddVScaler( A3125adj,NULL,-1 ); | |
327 gtk_table_attach( GTK_TABLE( table1 ),A3125,0,1,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),0,0 ); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26458
diff
changeset
|
328 |
23077 | 329 A6250adj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-eqRange,eqRange,0.5,0,0 ) ); |
330 A6250=AddVScaler( A6250adj,NULL,-1 ); | |
331 gtk_table_attach( GTK_TABLE( table1 ),A6250,1,2,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),0,0 ); | |
332 | |
333 A125adj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-eqRange,eqRange,0.5,0,0 ) ); | |
334 A125=AddVScaler( A125adj,NULL,-1 ); | |
335 gtk_table_attach( GTK_TABLE( table1 ),A125,2,3,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),0,0 ); | |
336 | |
337 A250adj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-eqRange,eqRange,0.5,0,0 ) ); | |
338 A250=AddVScaler( A250adj,NULL,-1 ); | |
339 gtk_table_attach( GTK_TABLE( table1 ),A250,3,4,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),0,0 ); | |
340 | |
341 A500adj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-eqRange,eqRange,0.5,0,0 ) ); | |
342 A500=AddVScaler( A500adj,NULL,-1 ); | |
343 gtk_table_attach( GTK_TABLE( table1 ),A500,4,5,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),0,0 ); | |
344 | |
345 A1000adj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-eqRange,eqRange,0.5,0,0 ) ); | |
346 A1000=AddVScaler( A1000adj,NULL,-1 ); | |
347 gtk_table_attach( GTK_TABLE( table1 ),A1000,5,6,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),0,0 ); | |
348 | |
349 A2000adj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-eqRange,eqRange,0.5,0,0 ) ); | |
350 A2000=AddVScaler( A2000adj,NULL,-1 ); | |
351 gtk_table_attach( GTK_TABLE( table1 ),A2000,6,7,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),0,0 ); | |
352 | |
353 A4000adj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-eqRange,eqRange,0.5,0,0 ) ); | |
354 A4000=AddVScaler( A4000adj,NULL,-1 ); | |
355 gtk_table_attach( GTK_TABLE( table1 ),A4000,7,8,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),0,0 ); | |
356 | |
357 A8000adj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-eqRange,eqRange,0.5,0,0 ) ); | |
358 A8000=AddVScaler( A8000adj,NULL,-1 ); | |
359 gtk_table_attach( GTK_TABLE( table1 ),A8000,8,9,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),0,0 ); | |
360 | |
361 A16000adj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-eqRange,eqRange,0.5,0,0 ) ); | |
362 A16000=AddVScaler( A16000adj,NULL,-1 ); | |
363 gtk_table_attach( GTK_TABLE( table1 ),A16000,9,10,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),0,0 ); | |
364 | |
365 gtk_table_attach( GTK_TABLE( table1 ), | |
366 AddLabel( "31.25",NULL ), | |
367 0,1,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
368 | |
369 gtk_table_attach( GTK_TABLE( table1 ), | |
370 AddLabel( "62.50",NULL ), | |
371 1,2,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
372 | |
373 gtk_table_attach( GTK_TABLE( table1 ), | |
374 AddLabel( "125",NULL ), | |
375 2,3,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
376 | |
377 gtk_table_attach( GTK_TABLE( table1 ), | |
378 AddLabel( "250",NULL ), | |
379 3,4,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
380 | |
381 gtk_table_attach( GTK_TABLE( table1 ), | |
382 AddLabel( "500",NULL ), | |
383 4,5,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
384 | |
385 gtk_table_attach( GTK_TABLE( table1 ), | |
386 AddLabel( "1000",NULL ), | |
387 5,6,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
388 | |
389 gtk_table_attach( GTK_TABLE( table1 ), | |
390 AddLabel( "2000",NULL ), | |
391 6,7,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
392 | |
393 gtk_table_attach( GTK_TABLE( table1 ), | |
394 AddLabel( "4000",NULL ), | |
395 7,8,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
396 | |
397 gtk_table_attach( GTK_TABLE( table1 ), | |
398 AddLabel( "8000",NULL ), | |
399 8,9,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
400 | |
401 gtk_table_attach( GTK_TABLE( table1 ), | |
402 AddLabel( "16000",NULL ), | |
403 9,10,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
404 | |
405 gtk_notebook_set_tab_label( GTK_NOTEBOOK( Notebook ),gtk_notebook_get_nth_page( GTK_NOTEBOOK( Notebook ),0 ), | |
406 AddLabel( MSGTR_EQU_Audio,NULL ) ); | |
407 | |
408 table1=gtk_table_new( 4,2,FALSE ); | |
409 gtk_widget_set_name( table1,"table1" ); | |
410 gtk_widget_show( table1 ); | |
411 gtk_container_add( GTK_CONTAINER( Notebook ),table1 ); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26458
diff
changeset
|
412 |
23077 | 413 gtk_table_attach( GTK_TABLE( table1 ), |
414 AddLabel( MSGTR_EQU_Contrast,NULL ), | |
415 0,1,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
416 | |
417 gtk_table_attach( GTK_TABLE( table1 ), | |
418 AddLabel( MSGTR_EQU_Brightness,NULL ), | |
419 0,1,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
420 | |
421 gtk_table_attach( GTK_TABLE( table1 ), | |
422 AddLabel( MSGTR_EQU_Hue,NULL ), | |
423 0,1,2,3,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
424 | |
425 gtk_table_attach( GTK_TABLE( table1 ), | |
426 AddLabel( MSGTR_EQU_Saturation,NULL ), | |
427 0,1,3,4,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
428 | |
429 VContrastadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-100,100,1,0,0 ) ); | |
430 VContrast=AddHScaler( VContrastadj,NULL,1 ); | |
431 gtk_table_attach( GTK_TABLE( table1 ),VContrast,1,2,0,1,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
432 gtk_widget_set_usize( VContrast,-1,45 ); | |
433 | |
434 VBrightnessadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-100,100,1,0,0 ) ); | |
435 VBrightness=AddHScaler( VBrightnessadj,NULL,1 ); | |
436 gtk_table_attach( GTK_TABLE( table1 ),VBrightness,1,2,1,2,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
437 gtk_widget_set_usize( VBrightness,-1,45 ); | |
438 | |
439 VHueadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-100,100,1,0,0 ) ); | |
440 VHue=AddHScaler( VHueadj,NULL,1 ); | |
441 gtk_table_attach( GTK_TABLE( table1 ),VHue,1,2,2,3,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
442 gtk_widget_set_usize( VHue,-1,45 ); | |
443 | |
444 VSaturationadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-100,100,1,0,0 ) ); | |
445 VSaturation=AddHScaler( VSaturationadj,NULL,1 ); | |
446 gtk_table_attach( GTK_TABLE( table1 ),VSaturation,1,2,3,4,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
447 gtk_widget_set_usize( VSaturation,-1,45 ); | |
448 | |
449 gtk_notebook_set_tab_label( GTK_NOTEBOOK( Notebook ),gtk_notebook_get_nth_page( GTK_NOTEBOOK( Notebook ),1 ), | |
450 AddLabel( MSGTR_EQU_Video,NULL ) ); | |
451 | |
452 AddHSeparator( vbox1 ); | |
453 | |
454 hbuttonbox1=AddHButtonBox( vbox1 ); | |
455 gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox1 ),GTK_BUTTONBOX_END ); | |
456 gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox1 ),10 ); | |
457 | |
458 Config=AddButton( MSGTR_Config,hbuttonbox1 ); | |
459 Clear=AddButton( MSGTR_Clear,hbuttonbox1 ); | |
460 Ok=AddButton( MSGTR_Ok,hbuttonbox1 ); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26458
diff
changeset
|
461 |
23077 | 462 gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE ); |
463 gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE ); | |
464 | |
465 gtk_signal_connect( GTK_OBJECT( Equalizer ),"destroy",GTK_SIGNAL_FUNC( WidgetDestroy ),&Equalizer ); | |
466 gtk_signal_connect( GTK_OBJECT( Equalizer ),"focus_in_event",GTK_SIGNAL_FUNC( eqFocus ),(void *)2 ); | |
467 | |
468 gtk_signal_connect( GTK_OBJECT( ChannelsList ),"select_row",GTK_SIGNAL_FUNC( eqSelectChannelsListRow ),NULL ); | |
469 | |
470 gtk_signal_connect( GTK_OBJECT( A3125 ),"motion_notify_event",GTK_SIGNAL_FUNC( eqHScaleMotion ),(void*)0 ); | |
471 gtk_signal_connect( GTK_OBJECT( A6250 ),"motion_notify_event",GTK_SIGNAL_FUNC( eqHScaleMotion ),(void*)1 ); | |
472 gtk_signal_connect( GTK_OBJECT( A125 ),"motion_notify_event",GTK_SIGNAL_FUNC( eqHScaleMotion ),(void*)2 ); | |
473 gtk_signal_connect( GTK_OBJECT( A250 ),"motion_notify_event",GTK_SIGNAL_FUNC( eqHScaleMotion ),(void*)3 ); | |
474 gtk_signal_connect( GTK_OBJECT( A500 ),"motion_notify_event",GTK_SIGNAL_FUNC( eqHScaleMotion ),(void*)4 ); | |
475 gtk_signal_connect( GTK_OBJECT( A1000 ),"motion_notify_event",GTK_SIGNAL_FUNC( eqHScaleMotion ),(void*)5 ); | |
476 gtk_signal_connect( GTK_OBJECT( A2000 ),"motion_notify_event",GTK_SIGNAL_FUNC( eqHScaleMotion ),(void*)6 ); | |
477 gtk_signal_connect( GTK_OBJECT( A4000 ),"motion_notify_event",GTK_SIGNAL_FUNC( eqHScaleMotion ),(void*)7 ); | |
478 gtk_signal_connect( GTK_OBJECT( A8000 ),"motion_notify_event",GTK_SIGNAL_FUNC( eqHScaleMotion ),(void*)8 ); | |
479 gtk_signal_connect( GTK_OBJECT( A16000 ),"motion_notify_event",GTK_SIGNAL_FUNC( eqHScaleMotion ),(void*)9 ); | |
480 | |
481 gtk_signal_connect( GTK_OBJECT( VContrast ),"motion_notify_event",GTK_SIGNAL_FUNC( eqVScaleMotion ),(void*)1 ); | |
482 gtk_signal_connect( GTK_OBJECT( VBrightness ),"motion_notify_event",GTK_SIGNAL_FUNC( eqVScaleMotion ),(void*)2 ); | |
483 gtk_signal_connect( GTK_OBJECT( VHue ),"motion_notify_event",GTK_SIGNAL_FUNC( eqVScaleMotion ),(void*)3 ); | |
484 gtk_signal_connect( GTK_OBJECT( VSaturation ),"motion_notify_event",GTK_SIGNAL_FUNC( eqVScaleMotion ),(void *)4 ); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26458
diff
changeset
|
485 |
23077 | 486 gtk_signal_connect( GTK_OBJECT( Ok ),"clicked",GTK_SIGNAL_FUNC( eqButtonReleased ),(void *)0 ); |
487 gtk_signal_connect( GTK_OBJECT( Clear ),"clicked",GTK_SIGNAL_FUNC( eqButtonReleased ),(void *)1 ); | |
488 gtk_signal_connect( GTK_OBJECT( Config ),"clicked",GTK_SIGNAL_FUNC( eqButtonReleased ),(void *)2 ); | |
489 | |
490 gtk_signal_connect( GTK_OBJECT( Notebook ),"switch_page",GTK_SIGNAL_FUNC( eqNotebook ),NULL ); | |
491 | |
492 gtk_window_add_accel_group( GTK_WINDOW( Equalizer ),accel_group ); | |
493 | |
494 return Equalizer; | |
495 } | |
496 | |
497 // --- equalizer config dialog box | |
498 | |
499 static GtkWidget * CBChannel1; | |
500 static GtkWidget * CEChannel1; | |
501 static GtkWidget * CBChannel2; | |
502 static GtkWidget * CEChannel2; | |
503 static GtkWidget * CBChannel3; | |
504 static GtkWidget * CEChannel3; | |
505 static GtkWidget * CBChannel4; | |
506 static GtkWidget * CEChannel4; | |
507 static GtkWidget * CBChannel5; | |
508 static GtkWidget * CEChannel5; | |
509 static GtkWidget * CBChannel6; | |
510 static GtkWidget * CEChannel6; | |
511 static GtkWidget * ecOk; | |
512 static GtkWidget * ecCancel; | |
513 | |
514 GtkWidget * create_EquConfig( void ); | |
515 | |
516 void ShowEquConfig( void ) | |
517 { | |
518 GList * Items = NULL; | |
519 | |
520 if ( EquConfig ) gtkActive( EquConfig ); | |
521 else EquConfig=create_EquConfig(); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26458
diff
changeset
|
522 |
23077 | 523 Items=g_list_append( Items,(gpointer)MSGTR_EQU_Front_Right ); |
524 Items=g_list_append( Items,(gpointer)MSGTR_EQU_Front_Left ); | |
525 Items=g_list_append( Items,(gpointer)MSGTR_EQU_Back_Right ); | |
526 Items=g_list_append( Items,(gpointer)MSGTR_EQU_Back_Left ); | |
527 Items=g_list_append( Items,(gpointer)MSGTR_EQU_Center ); | |
528 Items=g_list_append( Items,(gpointer)MSGTR_EQU_Bass ); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26458
diff
changeset
|
529 |
23077 | 530 gtk_combo_set_popdown_strings( GTK_COMBO( CBChannel1 ),Items ); |
531 gtk_combo_set_popdown_strings( GTK_COMBO( CBChannel2 ),Items ); | |
532 gtk_combo_set_popdown_strings( GTK_COMBO( CBChannel3 ),Items ); | |
533 gtk_combo_set_popdown_strings( GTK_COMBO( CBChannel4 ),Items ); | |
534 gtk_combo_set_popdown_strings( GTK_COMBO( CBChannel5 ),Items ); | |
535 gtk_combo_set_popdown_strings( GTK_COMBO( CBChannel6 ),Items ); | |
536 | |
537 g_list_free( Items ); | |
538 | |
539 gtk_entry_set_text( GTK_ENTRY( CEChannel1 ),gtkEquChannel1 ); gtk_entry_set_editable( GTK_ENTRY( CEChannel1 ),FALSE ); | |
540 gtk_entry_set_text( GTK_ENTRY( CEChannel2 ),gtkEquChannel2 ); gtk_entry_set_editable( GTK_ENTRY( CEChannel2 ),FALSE ); | |
541 gtk_entry_set_text( GTK_ENTRY( CEChannel3 ),gtkEquChannel3 ); gtk_entry_set_editable( GTK_ENTRY( CEChannel3 ),FALSE ); | |
542 gtk_entry_set_text( GTK_ENTRY( CEChannel4 ),gtkEquChannel4 ); gtk_entry_set_editable( GTK_ENTRY( CEChannel4 ),FALSE ); | |
543 gtk_entry_set_text( GTK_ENTRY( CEChannel5 ),gtkEquChannel5 ); gtk_entry_set_editable( GTK_ENTRY( CEChannel5 ),FALSE ); | |
544 gtk_entry_set_text( GTK_ENTRY( CEChannel6 ),gtkEquChannel6 ); gtk_entry_set_editable( GTK_ENTRY( CEChannel6 ),FALSE ); | |
545 | |
546 gtk_widget_show( EquConfig ); | |
547 gtkSetLayer( EquConfig ); | |
548 } | |
549 | |
550 void HideEquConfig( void ) | |
551 { | |
552 if ( !EquConfig ) return; | |
553 gtk_widget_hide( EquConfig ); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26458
diff
changeset
|
554 gtk_widget_destroy( EquConfig ); |
23077 | 555 EquConfig=NULL; |
556 } | |
557 | |
558 static void ecButtonReleased( GtkButton * button,gpointer user_data ) | |
559 { | |
560 if ( (int)user_data ) | |
561 { // if you pressed Ok | |
562 gfree( (void **)>kEquChannel1 ); gtkEquChannel1=gstrdup( gtk_entry_get_text( GTK_ENTRY( CEChannel1 ) ) ); | |
563 gfree( (void **)>kEquChannel2 ); gtkEquChannel2=gstrdup( gtk_entry_get_text( GTK_ENTRY( CEChannel2 ) ) ); | |
564 gfree( (void **)>kEquChannel3 ); gtkEquChannel3=gstrdup( gtk_entry_get_text( GTK_ENTRY( CEChannel3 ) ) ); | |
565 gfree( (void **)>kEquChannel4 ); gtkEquChannel4=gstrdup( gtk_entry_get_text( GTK_ENTRY( CEChannel4 ) ) ); | |
566 gfree( (void **)>kEquChannel5 ); gtkEquChannel5=gstrdup( gtk_entry_get_text( GTK_ENTRY( CEChannel5 ) ) ); | |
567 gfree( (void **)>kEquChannel6 ); gtkEquChannel6=gstrdup( gtk_entry_get_text( GTK_ENTRY( CEChannel6 ) ) ); | |
568 eqSetChannelNames(); | |
569 } | |
570 HideEquConfig(); | |
571 } | |
572 | |
573 GtkWidget * create_EquConfig( void ) | |
574 { | |
575 GtkWidget * vbox1; | |
576 GtkWidget * table1; | |
577 GtkWidget * hbuttonbox1; | |
578 GtkAccelGroup * accel_group; | |
579 | |
580 accel_group=gtk_accel_group_new(); | |
581 | |
582 EquConfig=gtk_window_new( GTK_WINDOW_TOPLEVEL ); | |
583 gtk_widget_set_name( EquConfig,"EquConfig" ); | |
584 gtk_object_set_data( GTK_OBJECT( EquConfig ),"EquConfig",EquConfig ); | |
585 gtk_widget_set_usize( EquConfig,350,260 ); | |
586 GTK_WIDGET_SET_FLAGS( EquConfig,GTK_CAN_DEFAULT ); | |
587 gtk_window_set_title( GTK_WINDOW( EquConfig ),MSGTR_ConfigureEqualizer ); | |
588 gtk_window_set_position( GTK_WINDOW( EquConfig ),GTK_WIN_POS_CENTER ); | |
589 // gtk_window_set_modal( GTK_WINDOW( EquConfig ),TRUE ); | |
590 gtk_window_set_policy( GTK_WINDOW( EquConfig ),FALSE,FALSE,FALSE ); | |
591 gtk_window_set_wmclass( GTK_WINDOW( EquConfig ),"EquConfig","MPlayer" ); | |
592 | |
593 gtk_widget_realize( EquConfig ); | |
594 gtkAddIcon( EquConfig ); | |
595 | |
596 vbox1=AddVBox( AddDialogFrame( EquConfig ),0 ); | |
597 | |
598 table1=gtk_table_new( 6,2,FALSE ); | |
599 gtk_widget_set_name( table1,"table1" ); | |
600 gtk_widget_show( table1 ); | |
601 gtk_box_pack_start( GTK_BOX( vbox1 ),table1,TRUE,TRUE,0 ); | |
602 gtk_table_set_row_spacings( GTK_TABLE( table1 ),4 ); | |
603 gtk_table_set_col_spacings( GTK_TABLE( table1 ),4 ); | |
604 | |
605 gtk_table_attach( GTK_TABLE( table1 ), | |
606 AddLabel( MSGTR_EQU_Channel1,NULL ), | |
607 0,1,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
608 | |
609 gtk_table_attach( GTK_TABLE( table1 ), | |
610 AddLabel( MSGTR_EQU_Channel2,NULL ), | |
611 0,1,1,2,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
612 | |
613 gtk_table_attach( GTK_TABLE( table1 ), | |
614 AddLabel( MSGTR_EQU_Channel3,NULL ), | |
615 0,1,2,3,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
616 | |
617 gtk_table_attach( GTK_TABLE( table1 ), | |
618 AddLabel( MSGTR_EQU_Channel4,NULL ), | |
619 0,1,3,4,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
620 | |
621 gtk_table_attach( GTK_TABLE( table1 ), | |
622 AddLabel( MSGTR_EQU_Channel5,NULL ), | |
623 0,1,4,5,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
624 | |
625 gtk_table_attach( GTK_TABLE( table1 ), | |
626 AddLabel( MSGTR_EQU_Channel6,NULL ), | |
627 0,1,5,6,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
628 | |
629 CBChannel1=AddComboBox( NULL ); | |
630 gtk_table_attach( GTK_TABLE( table1 ),CBChannel1,1,2,0,1,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
631 | |
632 CEChannel1=GTK_COMBO( CBChannel1 )->entry; | |
633 gtk_widget_set_name( CEChannel1,"CEChannel1" ); | |
634 gtk_widget_show( CEChannel1 ); | |
635 | |
636 CBChannel2=AddComboBox( NULL ); | |
637 gtk_table_attach( GTK_TABLE( table1 ),CBChannel2,1,2,1,2,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26458
diff
changeset
|
638 |
23077 | 639 CEChannel2=GTK_COMBO( CBChannel2 )->entry; |
640 gtk_widget_set_name( CEChannel2,"CEChannel2" ); | |
641 gtk_widget_show( CEChannel2 ); | |
642 | |
643 CBChannel3=AddComboBox( NULL ); | |
644 gtk_table_attach( GTK_TABLE( table1 ),CBChannel3,1,2,2,3,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26458
diff
changeset
|
645 |
23077 | 646 CEChannel3=GTK_COMBO( CBChannel3 )->entry; |
647 gtk_widget_set_name( CEChannel3,"CEChannel3" ); | |
648 gtk_widget_show( CEChannel3 ); | |
649 | |
650 CBChannel4=AddComboBox( NULL ); | |
651 gtk_table_attach( GTK_TABLE( table1 ),CBChannel4,1,2,3,4,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26458
diff
changeset
|
652 |
23077 | 653 CEChannel4=GTK_COMBO( CBChannel4 )->entry; |
654 gtk_widget_set_name( CEChannel4,"CEChannel4" ); | |
655 gtk_widget_show( CEChannel4 ); | |
656 | |
657 CBChannel5=AddComboBox( NULL ); | |
658 gtk_table_attach( GTK_TABLE( table1 ),CBChannel5,1,2,4,5,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26458
diff
changeset
|
659 |
23077 | 660 CEChannel5=GTK_COMBO( CBChannel5 )->entry; |
661 gtk_widget_set_name( CEChannel5,"CEChannel5" ); | |
662 gtk_widget_show( CEChannel5 ); | |
663 | |
664 CBChannel6=AddComboBox( NULL ); | |
665 gtk_table_attach( GTK_TABLE( table1 ),CBChannel6,1,2,5,6,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 ); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26458
diff
changeset
|
666 |
23077 | 667 CEChannel6=GTK_COMBO( CBChannel6 )->entry; |
668 gtk_widget_set_name( CEChannel6,"CEChannel6" ); | |
669 gtk_widget_show( CEChannel6 ); | |
670 | |
671 AddHSeparator( vbox1 ); | |
672 | |
673 hbuttonbox1=AddHButtonBox( vbox1 ); | |
674 gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox1 ),GTK_BUTTONBOX_END ); | |
675 gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox1 ),10 ); | |
676 | |
677 ecOk=AddButton( MSGTR_Ok,hbuttonbox1 ); | |
678 ecCancel=AddButton( MSGTR_Cancel,hbuttonbox1 ); | |
679 | |
680 gtk_widget_add_accelerator( ecOk,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE ); | |
681 gtk_widget_add_accelerator( ecCancel,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE ); | |
682 | |
683 gtk_signal_connect( GTK_OBJECT( EquConfig ),"destroy",GTK_SIGNAL_FUNC( WidgetDestroy ),&EquConfig ); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26458
diff
changeset
|
684 |
23077 | 685 gtk_signal_connect( GTK_OBJECT( ecOk ),"clicked",GTK_SIGNAL_FUNC( ecButtonReleased ),(void *)1 ); |
686 gtk_signal_connect( GTK_OBJECT( ecCancel ),"clicked",GTK_SIGNAL_FUNC( ecButtonReleased ),(void *)0 ); | |
687 | |
688 gtk_window_add_accel_group( GTK_WINDOW( EquConfig ),accel_group ); | |
689 | |
690 return EquConfig; | |
691 } |