changeset 6627:fd3ac41ee1a1

add equalizer support and fix some small bug...
author pontscho
date Wed, 03 Jul 2002 18:57:52 +0000
parents 036948569977
children 10131c2b3987
files Gui/interface.c Gui/interface.h Gui/mplayer/gtk/eq.c Gui/mplayer/gtk/eq.h Gui/mplayer/gtk/menu.c Gui/mplayer/mw.h Gui/mplayer/widgets.c help_mp-en.h help_mp-hu.h mplayer.c mplayer.h
diffstat 11 files changed, 352 insertions(+), 79 deletions(-) [+]
line wrap: on
line diff
--- a/Gui/interface.c	Wed Jul 03 09:03:20 2002 +0000
+++ b/Gui/interface.c	Wed Jul 03 18:57:52 2002 +0000
@@ -8,6 +8,7 @@
 #include "mplayer/play.h"
 #include "interface.h"
 #include "skin/skin.h"
+#include "mplayer/gtk/eq.h"
 
 #include "../mplayer.h"
 #include "mplayer/widgets.h"
@@ -17,6 +18,9 @@
 #include "../libvo/video_out.h"
 #include "../input/input.h"
 #include "../libao2/audio_out.h"
+#include "../mixer.h"
+#include "../libao2/audio_plugin.h"
+#include "../libao2/eq.h"
 
 #include <inttypes.h>
 #include <sys/types.h>
@@ -26,9 +30,27 @@
 
 guiInterface_t guiIntfStruct;
 
+char * gstrcat( char ** dest,char * src )
+{
+ char * tmp = NULL;
+
+ if ( !src ) return NULL;
+
+ if ( *dest )
+  {
+   tmp=malloc( strlen( *dest ) + strlen( src ) + 1 );
+   strcpy( tmp,*dest ); strcat( tmp,src ); free( *dest ); 
+  }
+  else
+   { tmp=malloc( strlen( src ) + 1 ); strcpy( tmp,src ); }
+ *dest=tmp;
+ return tmp;
+}
+
 void guiInit( void )
 {
  memset( &guiIntfStruct,0,sizeof( guiIntfStruct ) );
+ memset( &gtkEquChannels,0,sizeof( gtkEquChannels ) );
  appInit( (void*)mDisplay );
 }
 
@@ -187,11 +209,63 @@
 	 mixer_getvolume( &l,&r );
 	 guiIntfStruct.Volume=(r>l?r:l);
 	 if ( r != l ) guiIntfStruct.Balance=( ( r - l ) + 100 ) * 0.5f;
-	   else guiIntfStruct.Balance=0.0f;
+	   else guiIntfStruct.Balance=50.0f;
 	 btnModify( evSetVolume,guiIntfStruct.Volume );
 	 btnModify( evSetBalance,guiIntfStruct.Balance );
 	}
-        break;
+
+	if ( gtkEnableVideoEqualizer )
+	 {
+	  gtkSet( gtkSetContrast,gtkContrast,NULL );
+	  gtkSet( gtkSetBrightness,gtkBrightness,NULL );
+	  gtkSet( gtkSetHue,gtkHue,NULL );
+	  gtkSet( gtkSetSaturation,gtkSaturation,NULL );
+	 }
+	if ( gtkEnableAudioEqualizer )
+	 {
+	  equalizer_t eq;
+	  int i,j;
+	  for ( i=0;i<6;i++ )
+	    for ( j=0;j<10;j++ )
+	     {
+	      eq.channel=i; eq.band=j; eq.gain=gtkEquChannels[i][j];
+	      gtkSet( gtkSetEqualizer,0,&eq );
+	     }
+	 }
+	break;
+   case guiSetDefaults:
+#if defined( HAVE_VCD ) || defined( USE_DVDREAD )
+        if ( guiIntfStruct.DiskChanged )
+          {
+#ifdef USE_DVDREAD
+           switch ( guiIntfStruct.StreamType )
+            {
+             case STREAMTYPE_DVD: filename=DEFAULT_DVD_DEVICE; break;
+            }
+#endif
+           guiIntfStruct.DiskChanged=0;
+	   guiGetEvent( guiCEvent,(char *)guiSetPlay );
+	  }
+#endif
+
+#ifdef USE_SUB
+       if ( guiIntfStruct.SubtitleChanged || !guiIntfStruct.FilenameChanged )
+         {
+	  if ( ( guiIntfStruct.Subtitlename )&&( guiIntfStruct.Subtitlename[0] != 0 ) ) sub_name=guiIntfStruct.Subtitlename;
+	  guiIntfStruct.SubtitleChanged=0;
+	 }
+#endif
+				    
+        if ( guiIntfStruct.AudioFile ) audio_stream=guiIntfStruct.AudioFile;
+	  else if ( guiIntfStruct.FilenameChanged ) audio_stream=NULL;
+
+	if ( gtkEnableAudioEqualizer )
+	 {
+	  if ( ao_plugin_cfg.plugin_list ) { if ( !strstr( ao_plugin_cfg.plugin_list,"eq" ) )  gstrcat( &ao_plugin_cfg.plugin_list,"," ); }
+	    else gstrcat( &ao_plugin_cfg.plugin_list,"eq" );
+	 }
+	
+	break;
   }
 }
 
@@ -205,3 +279,57 @@
  mplTimer=GetTimerMS() / 20;
 // if ( !( GetTimerMS()%2 ) ) 
 }
+
+// --- 
+
+float gtkContrast = 0.0f;
+float gtkBrightness = 0.0f;
+float gtkHue = 0.0f;
+float gtkSaturation = 0.0f;
+
+float gtkEquChannels[6][10];
+
+void gtkSet( int cmd,float fparam, void * vparam )
+{
+ mp_cmd_t * mp_cmd = (mp_cmd_t *)calloc( 1,sizeof( *mp_cmd ) );
+ equalizer_t * eq = (equalizer_t *)vparam;
+ 
+ switch ( cmd )
+  {
+   case gtkSetContrast:
+	mp_cmd->id=MP_CMD_CONTRAST;   mp_cmd->name=strdup( "contrast" );
+	gtkContrast=fparam;
+	break;
+   case gtkSetBrightness:
+	mp_cmd->id=MP_CMD_BRIGHTNESS; mp_cmd->name=strdup( "brightness" );
+	gtkBrightness=fparam;
+	break;
+   case gtkSetHue:
+	mp_cmd->id=MP_CMD_HUE;        mp_cmd->name=strdup( "hue" );
+	gtkHue=fparam;
+	break;
+   case gtkSetSaturation:
+	mp_cmd->id=MP_CMD_SATURATION; mp_cmd->name=strdup( "saturation" );
+	gtkSaturation=fparam;
+	break;
+   case gtkSetEqualizer:
+        if ( eq )
+	 {
+          gtkEquChannels[eq->channel][eq->band]=eq->gain;
+	  audio_plugin_eq.control( AOCONTROL_PLUGIN_EQ_SET_GAIN,(int)eq );
+	 }
+	 else
+	  {
+	   int i,j; equalizer_t tmp; tmp.gain=0.0f;
+	   memset( gtkEquChannels,0,sizeof( gtkEquChannels ) );
+	   for ( i=0;i<6;i++ )
+	    for ( j=0;j<10;j++ )
+	     { tmp.channel=i; tmp.band=j; audio_plugin_eq.control( AOCONTROL_PLUGIN_EQ_SET_GAIN,(int)&tmp ); }
+	  }
+	return;
+   default: free( mp_cmd ); return;
+  }
+ mp_cmd->args[0].v.i=(int)fparam;
+ mp_cmd->args[1].v.i=1;
+ mp_input_queue_cmd( mp_cmd );
+}
--- a/Gui/interface.h	Wed Jul 03 09:03:20 2002 +0000
+++ b/Gui/interface.h	Wed Jul 03 18:57:52 2002 +0000
@@ -113,6 +113,7 @@
 #define guiClearStruct      10
 #define guiReDraw	    11
 #define guiSetVolume        12
+#define guiSetDefaults	    13
 
 #define guiSetStop  0
 #define guiSetPlay  1
@@ -129,6 +130,21 @@
 extern void guiGetEvent( int type,char * arg );
 extern void guiEventHandling( void );
 
+#define gtkSetContrast   0
+#define gtkSetBrightness 1
+#define gtkSetHue	 2
+#define gtkSetSaturation 3
+#define gtkSetEqualizer  4
+
+extern float gtkContrast;
+extern float gtkBrightness;
+extern float gtkHue;
+extern float gtkSaturation;
+
+extern float gtkEquChannels[6][10];
+
+extern void gtkSet( int cmd,float param, void * vparam );
+
 #define gstrdup( s,ss ) { s=malloc( strlen( ss ) + 3 ); strcpy( s,ss ); }
 
 #define guiSetFilename( s,n ) { if ( s ) free( s ); s=strdup( n ); }
--- a/Gui/mplayer/gtk/eq.c	Wed Jul 03 09:03:20 2002 +0000
+++ b/Gui/mplayer/gtk/eq.c	Wed Jul 03 18:57:52 2002 +0000
@@ -9,81 +9,198 @@
 #include <gdk/gdkkeysyms.h>
 #include <gtk/gtk.h>
 
+#include "../../events.h"
+#include "../../../config.h"
+#include "../../../help_mp.h"
+#include "../../../mplayer.h"
+#include "../../../libao2/eq.h"
+#include "../widgets.h"
+#include "../mplayer.h"
+
 #include "eq.h"
 
-static GtkWidget * Equalizer;
+GtkWidget * Equalizer;
+
+static GtkWidget * Notebook;
 static GtkWidget * ChannelsList;
 static GtkWidget * VContrast, * VBrightness, * VHue, * VSaturation;
 static GtkAdjustment * VContrastadj, * VBrightnessadj, * VHueadj, * VSaturationadj;
-static GtkWidget * Ok;
+static GtkWidget * Ok, * Clear;
 static GtkWidget * A3125,  * A125, * A6250, * A250, * A500, * A1000, * A2000, * A4000, * A8000, * A16000;
 static GtkAdjustment * A3125adj, * A125adj, * A6250adj, * A250adj, * A500adj, * A1000adj, * A2000adj, * A4000adj, * A8000adj, * A16000adj;
 
 static int Channel = -1;
+static int gtkVEqualizer = 0;
+
+int gtkEnableAudioEqualizer = 1;
+int gtkEnableVideoEqualizer = 1;
+
+static void eqSetBands( int channel )
+{
+ if ( channel < 0 ) channel=0;
+ gtk_adjustment_set_value( A3125adj,0.0f - gtkEquChannels[channel][0] );
+ gtk_adjustment_set_value( A6250adj,0.0f - gtkEquChannels[channel][1] );
+ gtk_adjustment_set_value( A125adj,0.0f - gtkEquChannels[channel][2] );
+ gtk_adjustment_set_value( A250adj,0.0f - gtkEquChannels[channel][3] );
+ gtk_adjustment_set_value( A500adj,0.0f - gtkEquChannels[channel][4] );
+ gtk_adjustment_set_value( A1000adj,0.0f - gtkEquChannels[channel][5] );
+ gtk_adjustment_set_value( A2000adj,0.0f - gtkEquChannels[channel][6] );
+ gtk_adjustment_set_value( A4000adj,0.0f - gtkEquChannels[channel][7] );
+ gtk_adjustment_set_value( A8000adj,0.0f - gtkEquChannels[channel][8] );
+ gtk_adjustment_set_value( A16000adj,0.0f - gtkEquChannels[channel][9] );
+ gtk_adjustment_set_value( VContrastadj,gtkContrast );
+ gtk_adjustment_set_value( VBrightnessadj,gtkBrightness );
+ gtk_adjustment_set_value( VHueadj,gtkHue );
+ gtk_adjustment_set_value( VSaturationadj,gtkSaturation );
+}
+
+void ShowEqualizer( void )
+{
+ if ( gtkVEqualizer ) gtkActive( Equalizer );
+    else Equalizer=create_Equalizer();
+
+  {
+   gchar * str[2];  str[1]="";
+   str[0]="All"; gtk_clist_append( GTK_CLIST( ChannelsList ) ,str);
+   if ( guiIntfStruct.AudioType > 1 )
+    {
+     str[0]="Front Right"; gtk_clist_append( GTK_CLIST( ChannelsList ) ,str);
+     str[0]="Front Left"; gtk_clist_append( GTK_CLIST( ChannelsList ) ,str);
+    }
+   if ( guiIntfStruct.AudioType > 2 )
+    {
+     str[0]="Channel 3. (Back Right?)"; gtk_clist_append( GTK_CLIST( ChannelsList ) ,str);
+     str[0]="Channel 4. (Back Left?)"; gtk_clist_append( GTK_CLIST( ChannelsList ) ,str);
+    }
+   if ( guiIntfStruct.AudioType > 4 )
+    {
+     str[0]="Channel 5. (?)"; gtk_clist_append( GTK_CLIST( ChannelsList ) ,str);
+     str[0]="Channel 6. (?)"; gtk_clist_append( GTK_CLIST( ChannelsList ) ,str);
+    }
+   gtk_clist_select_row( GTK_CLIST( ChannelsList ),1,0 );
+
+   VContrastadj->value=gtkContrast;
+   VBrightnessadj->value=gtkBrightness;
+   VHueadj->value=gtkHue;
+   VSaturationadj->value=gtkSaturation;
+
+   if ( !guiIntfStruct.Playing && gtkEnableVideoEqualizer )
+    {
+     
+     gtk_widget_set_sensitive( VContrast,FALSE );
+     gtk_widget_set_sensitive( VBrightness,FALSE );
+     gtk_widget_set_sensitive( VHue,FALSE );
+     gtk_widget_set_sensitive( VSaturation,FALSE );
+    }
+
+   Channel=0;
+   eqSetBands( 0 );
+    
+   if ( !guiIntfStruct.Playing && gtkEnableAudioEqualizer )
+    {
+     gtk_widget_set_sensitive( ChannelsList,FALSE );
+     gtk_widget_set_sensitive( A3125,FALSE );
+     gtk_widget_set_sensitive( A125,FALSE );
+     gtk_widget_set_sensitive( A6250,FALSE );
+     gtk_widget_set_sensitive( A250,FALSE );
+     gtk_widget_set_sensitive( A500,FALSE );
+     gtk_widget_set_sensitive( A1000,FALSE );
+     gtk_widget_set_sensitive( A2000,FALSE );
+     gtk_widget_set_sensitive( A4000,FALSE );
+     gtk_widget_set_sensitive( A8000,FALSE );
+     gtk_widget_set_sensitive( A16000,FALSE );
+    }
+  }
+
+ gtk_widget_show( Equalizer );
+}
 
 void HideEqualizer( void )
-{ gtk_widget_hide( Equalizer ); gtk_widget_destroy( Equalizer ); gtk_main_quit(); }
+{ gtkVEqualizer=0; gtk_widget_hide( Equalizer ); gtk_widget_destroy( Equalizer ); }
 
-gboolean eqHScaleMotion( GtkWidget * widget,GdkEventMotion  * event,gpointer user_data )
+static gboolean eqHScaleMotion( GtkWidget * widget,GdkEventMotion  * event,gpointer user_data )
 {
- float value;
+ equalizer_t eq;
  switch ( (int)user_data ) 
   {
-    case 0: value=A3125adj->value; break;
-	case 1: value=A6250adj->value; break;
-	case 2: value=A125adj->value; break;
-	case 3: value=A250adj->value; break;
-	case 4: value=A500adj->value; break;
-	case 5: value=A1000adj->value; break;
-	case 6: value=A2000adj->value; break;
-	case 7: value=A4000adj->value; break;
-	case 8: value=A8000adj->value; break;
-	case 9: value=A16000adj->value; break;
-	default: return FALSE;
+   case 0: eq.gain=A3125adj->value; break;
+   case 1: eq.gain=A6250adj->value; break;
+   case 2: eq.gain=A125adj->value; break;
+   case 3: eq.gain=A250adj->value; break;
+   case 4: eq.gain=A500adj->value; break;
+   case 5: eq.gain=A1000adj->value; break;
+   case 6: eq.gain=A2000adj->value; break;
+   case 7: eq.gain=A4000adj->value; break;
+   case 8: eq.gain=A8000adj->value; break;
+   case 9: eq.gain=A16000adj->value; break;
+   default: return FALSE;
   }
- value=0.0f - value;
+ eq.gain=0.0f - eq.gain;
+ eq.band=(int)user_data;
+ if ( Channel == -1 ) 
+  {
+   int i;
+   for ( i=0;i<6;i++ )
+    { eq.channel=i; gtkSet( gtkSetEqualizer,0,&eq ); }
+  } else { eq.channel=Channel; gtkSet( gtkSetEqualizer,0,&eq ); }
   
-  printf( "hscale: %d -> %.2f\n",(int)user_data,value );
-  return FALSE;
+ return FALSE;
 }
 
-gboolean eqVScaleMotion( GtkWidget * widget,GdkEventMotion  * event,gpointer user_data )
+static gboolean eqVScaleMotion( GtkWidget * widget,GdkEventMotion  * event,gpointer user_data )
 {
-  float value;
-  switch( (int)user_data )
+
+ switch( (int)user_data )
   {
-   case 1: value=VContrastadj->value; break;
-   case 2: value=VBrightnessadj->value; break;
-   case 3: value=VHueadj->value; break;
-   case 4: value=VSaturationadj->value; break;
-   default: return FALSE;
+   case 1: gtkSet( gtkSetContrast,VContrastadj->value,NULL );      break;
+   case 2: gtkSet( gtkSetBrightness,VBrightnessadj->value,NULL );  break;
+   case 3: gtkSet( gtkSetHue,VHueadj->value,NULL );		   break;
+   case 4: gtkSet( gtkSetSaturation,VSaturationadj->value,NULL );  break;
   }
 
-  printf( "vscale: %d -> %.2f\n",(int)user_data,value );
-  return FALSE;
+ return FALSE;
 }
 
-void eqButtonReleased( GtkButton * button,gpointer user_data )
-{ HideEqualizer(); }
+static void eqButtonReleased( GtkButton * button,gpointer user_data )
+{ 
+ switch( (int)user_data )
+  {
+   case 0: HideEqualizer(); break;
+   case 1: 
+	if ( gtk_notebook_get_current_page( Notebook ) == 0 )
+	 { 
+	  gtkSet( gtkSetEqualizer,0,NULL ); 
+	  eqSetBands( Channel ); 
+	 }
+	 else
+	  {
+	   gtkSet( gtkSetContrast,0.0f,NULL );
+	   gtkSet( gtkSetBrightness,0.0f,NULL );
+	   gtkSet( gtkSetHue,0.0f,NULL );
+	   gtkSet( gtkSetSaturation,0.0f,NULL );
+	  }
+	break;
+  }
+}
 
 gboolean eqDestroy( GtkWidget * widget,GdkEvent * event,gpointer user_data )
 { HideEqualizer(); return FALSE; }
 
-void eqShow( GtkWidget * widget,gpointer user_data )
-{
- gchar * str[2];  str[1]="";
- str[0]="All"; gtk_clist_append( GTK_CLIST( ChannelsList ) ,str);
- str[0]="Left"; gtk_clist_append( GTK_CLIST( ChannelsList ) ,str);
- str[0]="Right"; gtk_clist_append( GTK_CLIST( ChannelsList ) ,str);
- gtk_clist_select_row( GTK_CLIST( ChannelsList ),0,0 );
-}
+static void eqShow( GtkWidget * widget,gpointer user_data )
+{ gtkVEqualizer=(int)user_data; }
 
-void eqSelectChannelsListRow( GtkCList * clist,gint row,gint column,GdkEvent * event,gpointer user_data )
+static void eqSelectChannelsListRow( GtkCList * clist,gint row,gint column,GdkEvent * event,gpointer user_data )
 {
  char * tmp;
  Channel=row - 1;
- gtk_clist_get_text( clist,row,0,&tmp );
- printf( "Selected channel: %s (%d)\n",tmp,Channel );
+ eqSetBands( Channel );
+ if ( Channel == -1 )
+  {
+   int i,j; equalizer_t eq;
+   for ( i=1;i<6;i++ )
+    for ( j=0;j<10;j++ )
+     { eq.band=j; eq.channel=i; eq.gain=gtkEquChannels[0][j]; gtkSet( gtkSetEqualizer,0,&eq ); }
+  }
 }
 
 GtkWidget * create_Equalizer( void )
@@ -93,7 +210,6 @@
   GtkWidget * frame3;
   GtkWidget * frame4;
   GtkWidget * vbox1;
-  GtkWidget * Notebook;
   GtkWidget * hbox1;
   GtkWidget * scrolledwindow1;
   GtkWidget * table1;
@@ -455,7 +571,7 @@
   gtk_widget_show( vbox3 );
   gtk_box_pack_start( GTK_BOX( hbox2 ),vbox3,TRUE,TRUE,0 );
 
-  VContrastadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-100,100,1,0,0 ) );
+  VContrastadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,100,1,0,0 ) );
   VContrast=gtk_hscale_new( VContrastadj );
   gtk_widget_set_name( VContrast,"VContrast" );
   gtk_widget_ref( VContrast );
@@ -464,7 +580,7 @@
   gtk_box_pack_start( GTK_BOX( vbox3 ),VContrast,TRUE,TRUE,0 );
   gtk_scale_set_value_pos( GTK_SCALE( VContrast ),GTK_POS_RIGHT );
 
-  VBrightnessadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-100,100,1,0,0 ) );
+  VBrightnessadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,100,1,0,0 ) );
   VBrightness=gtk_hscale_new( VBrightnessadj );
   gtk_widget_set_name( VBrightness,"VBrightness" );
   gtk_widget_ref( VBrightness );
@@ -473,7 +589,7 @@
   gtk_box_pack_start( GTK_BOX( vbox3 ),VBrightness,TRUE,TRUE,0 );
   gtk_scale_set_value_pos( GTK_SCALE( VBrightness ),GTK_POS_RIGHT );
 
-  VHueadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-100,100,1,0,0 ) );
+  VHueadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,100,1,0,0 ) );
   VHue=gtk_hscale_new( VHueadj );
   gtk_widget_set_name( VHue,"VHue" );
   gtk_widget_ref( VHue );
@@ -482,7 +598,7 @@
   gtk_box_pack_start( GTK_BOX( vbox3 ),VHue,TRUE,TRUE,0 );
   gtk_scale_set_value_pos( GTK_SCALE( VHue ),GTK_POS_RIGHT );
 
-  VSaturationadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-100,100,1,0,0 ) );
+  VSaturationadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,100,1,0,0 ) );
   VSaturation=gtk_hscale_new( VSaturationadj );
   gtk_widget_set_name( VSaturation,"VSaturation" );
   gtk_widget_ref( VSaturation );
@@ -505,6 +621,16 @@
   gtk_widget_show( hbuttonbox1 );
   gtk_box_pack_end( GTK_BOX( vbox1 ),hbuttonbox1,FALSE,TRUE,0 );
   gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox1 ),GTK_BUTTONBOX_END );
+  gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox1 ),0 );
+
+  Clear=gtk_button_new_with_label( "Clear" );
+  gtk_widget_set_name( Clear,"Clear" );
+  gtk_widget_ref( Clear );
+  gtk_object_set_data_full( GTK_OBJECT( Equalizer ),"Clear",Clear,(GtkDestroyNotify)gtk_widget_unref );
+  gtk_widget_show( Clear );
+  gtk_container_add( GTK_CONTAINER( hbuttonbox1 ),Clear );
+  GTK_WIDGET_UNSET_FLAGS( Clear,GTK_CAN_FOCUS );
+  GTK_WIDGET_SET_FLAGS( Clear,GTK_CAN_DEFAULT );
 
   Ok=gtk_button_new_with_label( "Ok" );
   gtk_widget_set_name( Ok,"Ok" );
@@ -526,7 +652,8 @@
   gtk_widget_set_usize( hseparator1,-2,5 );
 
   gtk_signal_connect( GTK_OBJECT( Equalizer ),"destroy",GTK_SIGNAL_FUNC( eqDestroy ),NULL );
-  gtk_signal_connect( GTK_OBJECT( Equalizer ),"show",GTK_SIGNAL_FUNC( eqShow ),NULL );
+  gtk_signal_connect( GTK_OBJECT( Equalizer ),"show",GTK_SIGNAL_FUNC( eqShow ),(void *)1 );
+  gtk_signal_connect( GTK_OBJECT( Equalizer ),"hide",GTK_SIGNAL_FUNC( eqShow ),(void *)0 );
   gtk_signal_connect( GTK_OBJECT( ChannelsList ),"select_row",GTK_SIGNAL_FUNC( eqSelectChannelsListRow ),NULL );
 
   gtk_signal_connect( GTK_OBJECT( A3125 ),"motion_notify_event",GTK_SIGNAL_FUNC( eqHScaleMotion ),(void*)0 );
@@ -545,7 +672,8 @@
   gtk_signal_connect( GTK_OBJECT( VHue ),"motion_notify_event",GTK_SIGNAL_FUNC( eqVScaleMotion ),(void*)3 );
   gtk_signal_connect( GTK_OBJECT( VSaturation ),"motion_notify_event",GTK_SIGNAL_FUNC( eqVScaleMotion ),(void *)4 );
   
-  gtk_signal_connect( GTK_OBJECT( Ok ),"released",GTK_SIGNAL_FUNC( eqButtonReleased ),NULL );
+  gtk_signal_connect( GTK_OBJECT( Ok ),"released",GTK_SIGNAL_FUNC( eqButtonReleased ),(void *)0 );
+  gtk_signal_connect( GTK_OBJECT( Clear ),"released",GTK_SIGNAL_FUNC( eqButtonReleased ),(void *)1 );
 
   gtk_window_add_accel_group( GTK_WINDOW( Equalizer ),accel_group );
 
--- a/Gui/mplayer/gtk/eq.h	Wed Jul 03 09:03:20 2002 +0000
+++ b/Gui/mplayer/gtk/eq.h	Wed Jul 03 18:57:52 2002 +0000
@@ -1,5 +1,15 @@
-/*
- * DO NOT EDIT THIS FILE - it is generated by Glade.
- */
+
+#ifndef __GUI_EQ_H
+#define __GUI_EQ_H
+
+#include <gtk/gtk.h>
+
+extern GtkWidget * Equalizer;
 
-GtkWidget* create_Equalizer (void);
+extern int gtkEnableAudioEqualizer;
+extern int gtkEnableVideoEqualizer;
+
+extern GtkWidget * create_Equalizer( void );
+extern void ShowEqualizer( void );
+
+#endif
\ No newline at end of file
--- a/Gui/mplayer/gtk/menu.c	Wed Jul 03 09:03:20 2002 +0000
+++ b/Gui/mplayer/gtk/menu.c	Wed Jul 03 18:57:52 2002 +0000
@@ -385,6 +385,7 @@
   AddMenuItem( Menu,MSGTR_MENU_PlayList, evPlayList );
   AddMenuItem( Menu,MSGTR_MENU_SkinBrowser, evSkinBrowser );
   AddMenuItem( Menu,MSGTR_MENU_Preferences, evPreferences );
+  AddMenuItem( Menu,MSGTR_Equalizer, evEqualizer );
   AddSeparator( Menu );
   AddMenuItem( Menu,MSGTR_MENU_Exit, evExit );
 
--- a/Gui/mplayer/mw.h	Wed Jul 03 09:03:20 2002 +0000
+++ b/Gui/mplayer/mw.h	Wed Jul 03 18:57:52 2002 +0000
@@ -371,7 +371,7 @@
    case evSkinBrowser: gtkShow( evSkinBrowser,skinName ); break;
    case evAbout:       gtkShow( evAbout,NULL ); break;
    case evPreferences: gtkShow( evPreferences,NULL ); break;
-   case evEqualizer:   gtkMessageBox( GTK_MB_WARNING,"Sorry, this feature is not implemented yet ..." ); break;
+   case evEqualizer:   gtkShow( evEqualizer,NULL ); break;
 
    case evForward1min:      mplRelSeek( 60 );  break;
    case evBackward1min:     mplRelSeek( -60 ); break;
--- a/Gui/mplayer/widgets.c	Wed Jul 03 09:03:20 2002 +0000
+++ b/Gui/mplayer/widgets.c	Wed Jul 03 18:57:52 2002 +0000
@@ -46,6 +46,7 @@
 #include "gtk/opts.h"
 #include "gtk/menu.h"
 #include "gtk/url.h"
+#include "gtk/eq.h"
 
 // --- init & close gtk
 
@@ -134,6 +135,10 @@
 {
  switch( type )
   {
+   case evEqualizer:
+	ShowEqualizer();
+	gtkSetLayer( Equalizer );
+	break;
    case evSkinBrowser:
 	ShowSkinBrowser();
 //        gtkClearList( SkinList );
--- a/help_mp-en.h	Wed Jul 03 09:03:20 2002 +0000
+++ b/help_mp-en.h	Wed Jul 03 18:57:52 2002 +0000
@@ -239,6 +239,7 @@
 #define MSGTR_AudioFileSelect "Select external audio channel ..."
 #define MSGTR_MessageBox "MessageBox"
 #define MSGTR_PlayList "PlayList"
+#define MSGTR_Equalizer "Equalizer"
 #define MSGTR_SkinBrowser "Skin Browser"
 
 // --- buttons ---
--- a/help_mp-hu.h	Wed Jul 03 09:03:20 2002 +0000
+++ b/help_mp-hu.h	Wed Jul 03 18:57:52 2002 +0000
@@ -233,6 +233,7 @@
 #define MSGTR_OtherSelect "File kiválasztása ..."
 #define MSGTR_AudioFileSelect "Külső audio csatorna választása ..."
 #define MSGTR_MessageBox "Üzenetablak"
+#define MSGTR_Equalizer "Equalizer"
 #define MSGTR_PlayList "Lejátszási lista"
 #define MSGTR_SkinBrowser "Skin böngésző"
 
--- a/mplayer.c	Wed Jul 03 09:03:20 2002 +0000
+++ b/mplayer.c	Wed Jul 03 18:57:52 2002 +0000
@@ -208,6 +208,7 @@
 char* dvdsub_lang=NULL;
 static char* spudec_ifo=NULL;
 int vcd_track=0;
+char* filename=NULL; //"MI2-Trailer.avi";
 
 // cache2:
 static int stream_cache_size=0;
@@ -492,7 +493,6 @@
 // for multifile support:
 play_tree_iter_t* playtree_iter = NULL;
 
-char* filename=NULL; //"MI2-Trailer.avi";
 int file_format=DEMUXER_TYPE_UNKNOWN;
 
 int delay_corrected=1;
@@ -815,27 +815,8 @@
 #endif
        } 
 
-#if defined( HAVE_VCD ) && defined( USE_DVDREAD )
-     if ( guiIntfStruct.DiskChanged )
-      {
-#ifdef USE_DVDREAD 
-       switch ( guiIntfStruct.StreamType )
-        {
-         case STREAMTYPE_DVD: filename=DEFAULT_DVD_DEVICE; break;
-	}
-#endif
-       guiIntfStruct.DiskChanged=0;
-       guiGetEvent( guiCEvent,(char *)guiSetPlay );
-      }
-#endif
-
-#ifdef USE_SUB
-      if ( guiIntfStruct.SubtitleChanged || !guiIntfStruct.FilenameChanged )
-       {
-        if ( ( guiIntfStruct.Subtitlename )&&( guiIntfStruct.Subtitlename[0] != 0 ) ) sub_name=guiIntfStruct.Subtitlename;
-        guiIntfStruct.SubtitleChanged=0;
-       }
-#endif
+      guiGetEvent( guiSetDefaults,NULL );
+
       if ( ( guiIntfStruct.FilenameChanged || !filename )
 #ifdef USE_DVDREAD
            && ( guiIntfStruct.StreamType != STREAMTYPE_DVD )
@@ -862,7 +843,6 @@
          }
    	guiIntfStruct.FilenameChanged=0;
        } 
-     audio_stream=guiIntfStruct.AudioFile; 
     }
 #endif
 //---------------------------------------------------------------------------
--- a/mplayer.h	Wed Jul 03 09:03:20 2002 +0000
+++ b/mplayer.h	Wed Jul 03 18:57:52 2002 +0000
@@ -10,6 +10,9 @@
 extern int osd_level;
 extern int osd_visible;
 
+extern char * sub_name;
+extern char * filename;
+
 extern void exit_player(char* how);
 
 #endif