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