changeset 7217:7527dc997596

rewrite eq interface and add *.rm to fs
author pontscho
date Sun, 01 Sep 2002 11:28:18 +0000
parents b960f8cf0de1
children f554864f9e12
files Gui/Makefile Gui/interface.c Gui/interface.h Gui/mplayer/gtk/eq.c Gui/mplayer/gtk/fs.c Gui/mplayer/gtk/opts.c
diffstat 6 files changed, 39 insertions(+), 54 deletions(-) [+]
line wrap: on
line diff
--- a/Gui/Makefile	Sun Sep 01 11:27:29 2002 +0000
+++ b/Gui/Makefile	Sun Sep 01 11:28:18 2002 +0000
@@ -4,7 +4,7 @@
 include ../config.mak
 include config.mak
 
-INCDIR  = -I. -I./event -I./wm -I./skin $(GTKINC) $(EXTRA_INC) $(FREETYPE_INC)
+INCDIR  = -I. -I../loader -I./wm -I./skin $(GTKINC) $(EXTRA_INC) $(FREETYPE_INC) 
 
 OPTIMIZE =  $(OPTFLAGS) -fomit-frame-pointer \
             -fexpensive-optimizations -fschedule-insns2 -Wall
--- a/Gui/interface.c	Sun Sep 01 11:27:29 2002 +0000
+++ b/Gui/interface.c	Sun Sep 01 11:28:18 2002 +0000
@@ -36,6 +36,8 @@
 
 #include "../libmpdemux/stream.h"
 #include "../libmpdemux/demuxer.h"
+#include "../libmpdemux/stheader.h"
+#include "../libmpcodecs/dec_video.h"
 
 guiInterface_t guiIntfStruct;
 
@@ -175,20 +177,6 @@
   evSkinBrowser
  };
 
-typedef struct 
-{
- demux_stream_t *ds;
- unsigned int format;
- struct codecs_st *codec;
- int inited;
- // output format:                                                                                
- float timer;
- float fps;
- float frametime;
- int i_bps;
- int disp_w,disp_h;
-} tmp_sh_video_t;
-
 extern ao_functions_t * audio_out;
 extern vo_functions_t * video_out;
 extern int    		frame_dropping;
@@ -436,18 +424,11 @@
 	break;
    case guiSetValues:
 // -- video
+	guiIntfStruct.sh_video=arg;
 	if ( arg )
 	 {
-	  tmp_sh_video_t * sh = (tmp_sh_video_t *)arg;
+	  sh_video_t * sh = (sh_video_t *)arg;
 	  guiIntfStruct.FPS=sh->fps;
-	  if ( vo_gamma_brightness == 1000 )
-	   { vo_gamma_brightness=0; get_video_colors( (void *)arg,"brightness",&vo_gamma_brightness ); }
-	  if ( vo_gamma_contrast == 1000 )
-	   { vo_gamma_contrast=0; get_video_colors( (void *)arg,"contrast",&vo_gamma_contrast ); }
-	  if ( vo_gamma_hue == 1000 )
-	   { vo_gamma_hue=0; get_video_colors( (void *)arg,"hue",&vo_gamma_hue ); }
-	  if ( vo_gamma_saturation  == 1000 )
-	   { vo_gamma_saturation=0; get_video_colors( (void *)arg,"saturation",&vo_gamma_saturation ); }
 	 }
 
 	if ( guiIntfStruct.NoWindow ) wsVisibleWindow( &appMPlayer.subWindow,wsHideWindow );
@@ -619,7 +600,6 @@
 
 void * gtkSet( int cmd,float fparam, void * vparam )
 {
- mp_cmd_t    * mp_cmd;
  equalizer_t * eq = (equalizer_t *)vparam;
  plItem      * item = (plItem *)vparam;
  
@@ -775,31 +755,30 @@
         audio_delay=gtkAODelay=fparam;
 	return NULL;
    case gtkSetPanscan:
-        mp_cmd=(mp_cmd_t *)calloc( 1,sizeof( *mp_cmd ) );
-        mp_cmd->id=MP_CMD_PANSCAN;    mp_cmd->name=strdup( "panscan" );
-	mp_cmd->args[0].v.f=fparam;   mp_cmd->args[1].v.i=1;
-	mp_input_queue_cmd( mp_cmd );
+        {
+	 mp_cmd_t * mp_cmd;
+         mp_cmd=(mp_cmd_t *)calloc( 1,sizeof( *mp_cmd ) );
+         mp_cmd->id=MP_CMD_PANSCAN;    mp_cmd->name=strdup( "panscan" );
+	 mp_cmd->args[0].v.f=fparam;   mp_cmd->args[1].v.i=1;
+	 mp_input_queue_cmd( mp_cmd );
+	}
         return NULL;
    case gtkSetAutoq:
 	auto_quality=(int)fparam;
 	return NULL;
 // --- set equalizers
    case gtkSetContrast:
-        mp_cmd=(mp_cmd_t *)calloc( 1,sizeof( *mp_cmd ) );
-	mp_cmd->id=MP_CMD_CONTRAST;   mp_cmd->name=strdup( "contrast" );
-	break;
+        if ( guiIntfStruct.sh_video ) set_video_colors( guiIntfStruct.sh_video,"contrast",(int)fparam );
+	return NULL;
    case gtkSetBrightness:
-        mp_cmd=(mp_cmd_t *)calloc( 1,sizeof( *mp_cmd ) );
-	mp_cmd->id=MP_CMD_BRIGHTNESS; mp_cmd->name=strdup( "brightness" );
-	break;
+        if ( guiIntfStruct.sh_video ) set_video_colors( guiIntfStruct.sh_video,"brightness",(int)fparam );
+	return NULL;
    case gtkSetHue:
-        mp_cmd=(mp_cmd_t *)calloc( 1,sizeof( *mp_cmd ) );
-	mp_cmd->id=MP_CMD_HUE;        mp_cmd->name=strdup( "hue" );
-	break;
+        if ( guiIntfStruct.sh_video ) set_video_colors( guiIntfStruct.sh_video,"hue",(int)fparam );
+	return NULL;
    case gtkSetSaturation:
-        mp_cmd=(mp_cmd_t *)calloc( 1,sizeof( *mp_cmd ) );
-	mp_cmd->id=MP_CMD_SATURATION; mp_cmd->name=strdup( "saturation" );
-	break;
+        if ( guiIntfStruct.sh_video ) set_video_colors( guiIntfStruct.sh_video,"saturation",(int)fparam );
+	return NULL;
    case gtkSetEqualizer:
         if ( eq )
 	 {
@@ -815,10 +794,6 @@
 	     { tmp.channel=i; tmp.band=j; audio_plugin_eq.control( AOCONTROL_PLUGIN_EQ_SET_GAIN,(int)&tmp ); }
 	  }
 	return NULL;
-   default: return NULL;
   }
- mp_cmd->args[0].v.i=(int)fparam;
- mp_cmd->args[1].v.i=1;
- mp_input_queue_cmd( mp_cmd );
  return NULL;
 }
--- a/Gui/interface.h	Sun Sep 01 11:27:29 2002 +0000
+++ b/Gui/interface.h	Sun Sep 01 11:28:18 2002 +0000
@@ -57,8 +57,10 @@
    guiResizeStruct      resize;
    guiVideoStruct       videodata;
    guiUnknowErrorStruct error;
+   
+   void * sh_video;
 
-   int                  DiskChanged;
+   int    DiskChanged;
 
 #ifdef USE_DVDREAD
    guiDVDStruct         DVD;
--- a/Gui/mplayer/gtk/eq.c	Sun Sep 01 11:27:29 2002 +0000
+++ b/Gui/mplayer/gtk/eq.c	Sun Sep 01 11:28:18 2002 +0000
@@ -66,6 +66,14 @@
  gtk_adjustment_set_value( A8000adj,0.0f - gtkEquChannels[channel][8] );
  gtk_adjustment_set_value( A16000adj,0.0f - gtkEquChannels[channel][9] );
 
+ if ( guiIntfStruct.sh_video )
+  {
+   get_video_colors( guiIntfStruct.sh_video,"brightness",&vo_gamma_brightness );
+   get_video_colors( guiIntfStruct.sh_video,"contrast",&vo_gamma_contrast );
+   get_video_colors( guiIntfStruct.sh_video,"hue",&vo_gamma_hue );
+   get_video_colors( guiIntfStruct.sh_video,"saturation",&vo_gamma_saturation );
+  }
+										    
  gtk_adjustment_set_value( VContrastadj,(float)vo_gamma_contrast );
  gtk_adjustment_set_value( VBrightnessadj,(float)vo_gamma_brightness );
  gtk_adjustment_set_value( VHueadj,(float)vo_gamma_hue );
@@ -111,12 +119,7 @@
 
  eqSetChannelNames();
 
- VContrastadj->value=(float)vo_gamma_contrast;
- VBrightnessadj->value=(float)vo_gamma_brightness;
- VHueadj->value=(float)vo_gamma_hue;
- VSaturationadj->value=(float)vo_gamma_saturation;
-
- if ( !guiIntfStruct.Playing )
+ if ( !guiIntfStruct.Playing || !guiIntfStruct.sh_video )
   {
    gtk_widget_set_sensitive( VContrast,FALSE );
    gtk_widget_set_sensitive( VBrightness,FALSE );
@@ -215,7 +218,6 @@
 	   gtkSet( gtkSetBrightness,0.0f,NULL );
 	   gtkSet( gtkSetHue,0.0f,NULL );
 	   gtkSet( gtkSetSaturation,0.0f,NULL );
-	   vo_gamma_brightness=vo_gamma_contrast=vo_gamma_hue=vo_gamma_saturation=0;
 	   eqSetBands( Channel );
 	  }
 	break;
@@ -231,6 +233,9 @@
 static void eqShow( GtkWidget * widget,gpointer user_data )
 { gtkVEqualizer=(int)user_data; }
 
+static void eqFocus( GtkWindow * window,GtkWidget * widget,gpointer user_data )
+{ eqSetBands( Channel ); }
+
 static void eqSelectChannelsListRow( GtkCList * clist,gint row,gint column,GdkEvent * event,gpointer user_data )
 {
  Channel=row - 1;
@@ -708,6 +713,8 @@
   gtk_signal_connect( GTK_OBJECT( Equalizer ),"destroy",GTK_SIGNAL_FUNC( eqDestroy ),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( Equalizer ),"focus_in_event",GTK_SIGNAL_FUNC( eqFocus ),(void *)2 );
+
   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 );
--- a/Gui/mplayer/gtk/fs.c	Sun Sep 01 11:27:29 2002 +0000
+++ b/Gui/mplayer/gtk/fs.c	Sun Sep 01 11:28:18 2002 +0000
@@ -48,6 +48,7 @@
            { "QT files (*.mov)",   				  	"*.mov" },
            { "ASF files (*.asf)",  				  	"*.asf" },
            { "VIVO files (*.viv)", 				  	"*.viv" },
+	   { "RealVideo files (*.rm)",					"*.rm"  },
 	   { "Windows Media Video (*.wmv)",			  	"*.wmv" },
 	   { "MP3 files (*.mp3,mp2)",					"*.mp3,*.mp2" },
 	   { "Wave files (*.wav)",					"*.wav" },
--- a/Gui/mplayer/gtk/opts.c	Sun Sep 01 11:27:29 2002 +0000
+++ b/Gui/mplayer/gtk/opts.c	Sun Sep 01 11:28:18 2002 +0000
@@ -655,7 +655,7 @@
 #endif
   gtk_window_set_title( GTK_WINDOW( Preferences ),MSGTR_Preferences );
   gtk_window_set_position( GTK_WINDOW( Preferences ),GTK_WIN_POS_CENTER );
-  gtk_window_set_policy( GTK_WINDOW( Preferences ),FALSE,FALSE,FALSE );
+//  gtk_window_set_policy( GTK_WINDOW( Preferences ),FALSE,FALSE,FALSE );
   gtk_window_set_wmclass( GTK_WINDOW( Preferences ),"Preferences","MPlayer" );
   
   gtk_widget_realize( Preferences );