annotate gui/mplayer/gtk/eq.c @ 25234:02518a3daeef

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