changeset 6912:5ddd609550d5

- fix equ handling - fix dvd pos bar - fix 10l bug in evLoadPlay bugfix :) - mittomen
author pontscho
date Mon, 05 Aug 2002 01:14:14 +0000
parents 695bd84c1b24
children d5056a166cce
files Gui/cfg.c Gui/cfg.h Gui/interface.c Gui/mplayer/gtk/eq.c Gui/mplayer/gtk/fs.c Gui/mplayer/gtk/opts.c Gui/mplayer/mplayer.c Gui/mplayer/play.c mplayer.c
diffstat 9 files changed, 27 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/Gui/cfg.c	Mon Aug 05 01:06:25 2002 +0000
+++ b/Gui/cfg.c	Mon Aug 05 01:14:14 2002 +0000
@@ -18,7 +18,6 @@
 // --- params
 
 int    gtkEnableAudioEqualizer = 0;
-int    gtkEnableVideoEqualizer = 0;
 
 char * gtkVODriver = NULL;
 int    gtkVODoubleBuffer = 1;
@@ -61,7 +60,6 @@
 static config_t gui_opts[] =
 {
  { "enable_audio_equ",&gtkEnableAudioEqualizer,CONF_TYPE_FLAG,0,0,1,NULL },
- { "enable_video_equ",&gtkEnableVideoEqualizer,CONF_TYPE_FLAG,0,0,1,NULL },
  
  { "vo_driver",&gtkVODriver,CONF_TYPE_STRING,0,0,0,NULL },
  { "vo_panscan",&vo_panscan,CONF_TYPE_FLOAT,CONF_RANGE,0.0,1.0,NULL },
--- a/Gui/cfg.h	Mon Aug 05 01:06:25 2002 +0000
+++ b/Gui/cfg.h	Mon Aug 05 01:14:14 2002 +0000
@@ -3,7 +3,6 @@
 #define __CFG_H
 
 extern int gtkEnableAudioEqualizer;
-extern int gtkEnableVideoEqualizer;
 
 extern char * gtkVODriver;
 extern int    gtkVODoubleBuffer;
--- a/Gui/interface.c	Mon Aug 05 01:06:25 2002 +0000
+++ b/Gui/interface.c	Mon Aug 05 01:14:14 2002 +0000
@@ -87,7 +87,8 @@
  gtkAOOSSDevice=strdup( PATH_DEV_DSP );
    
  gtkInit();
-    
+ wsXInit( (void *)mDisplay );
+     
  cfg_read(); 
  appInit( (void*)mDisplay );
        
@@ -298,6 +299,18 @@
 	}
 	break;
    case guiSetValues:
+// -- video
+	if ( arg )
+	 {
+	  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 ); }
+	 }
 // -- audio
         if ( audio_out )
 	{
--- a/Gui/mplayer/gtk/eq.c	Mon Aug 05 01:06:25 2002 +0000
+++ b/Gui/mplayer/gtk/eq.c	Mon Aug 05 01:14:14 2002 +0000
@@ -116,7 +116,7 @@
  VHueadj->value=(float)vo_gamma_hue;
  VSaturationadj->value=(float)vo_gamma_saturation;
 
- if ( !guiIntfStruct.Playing || !gtkEnableVideoEqualizer )
+ if ( !guiIntfStruct.Playing )
   {
    gtk_widget_set_sensitive( VContrast,FALSE );
    gtk_widget_set_sensitive( VBrightness,FALSE );
@@ -210,7 +210,7 @@
 	 }
 	 else
 	  {
-	   if ( !guiIntfStruct.Playing || !gtkEnableVideoEqualizer ) break;
+	   if ( !guiIntfStruct.Playing ) break;
 	   gtkSet( gtkSetContrast,0.0f,NULL );
 	   gtkSet( gtkSetBrightness,0.0f,NULL );
 	   gtkSet( gtkSetHue,0.0f,NULL );
--- a/Gui/mplayer/gtk/fs.c	Mon Aug 05 01:06:25 2002 +0000
+++ b/Gui/mplayer/gtk/fs.c	Mon Aug 05 01:14:14 2002 +0000
@@ -455,7 +455,7 @@
    item=item->next;
   }
  if ( i ) fsTopList_items=g_list_prepend( fsTopList_items,(gchar *)get_current_dir_name() );
- if ( mplMainAutoPlay ) mplEventHandling( evPlay,0 );
+ if ( mplMainAutoPlay ) { mplMainAutoPlay=0; mplEventHandling( evPlay,0 ); }
 }
 
 void fs_Cancel_released( GtkButton * button,gpointer user_data )
--- a/Gui/mplayer/gtk/opts.c	Mon Aug 05 01:06:25 2002 +0000
+++ b/Gui/mplayer/gtk/opts.c	Mon Aug 05 01:14:14 2002 +0000
@@ -35,7 +35,6 @@
 
 static GtkWidget * CBVFM;
 static GtkWidget * CBAudioEqualizer;
-static GtkWidget * CBVideoEqualizer;
 //static GtkWidget * CBSurround;
 static GtkWidget * CBExtraStereo;
 static GtkWidget * CBNoSound;
@@ -122,7 +121,7 @@
    {
     const ao_info_t *info = audio_out_drivers[i++]->info;
     if ( !strcmp( info->short_name,"plugin" ) ) continue;
-    if ( !strcmp( gtkAODriver,info->short_name ) ) old_audio_driver=i - 1;
+    if ( !gstrcmp( gtkAODriver,info->short_name ) ) old_audio_driver=i - 1;
     tmp[0]=(char *)info->short_name; tmp[1]=(char *)info->name; gtk_clist_append( GTK_CLIST( CLADrivers ),tmp );
    }
   gtk_clist_select_row( GTK_CLIST( CLADrivers ),old_audio_driver,0 );
@@ -132,7 +131,6 @@
  }
 
 // -- 2. page
- gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBVideoEqualizer ),gtkEnableVideoEqualizer );
  gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBDoubleBuffer ),gtkVODoubleBuffer );
  gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBDR ),gtkVODirectRendering );
  gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBFramedrop ),gtkVFrameDrop );
@@ -282,7 +280,6 @@
 	gtkVODriver=gstrdup( vo_driver[0] );
 
 	// -- 2. page
-	gtkEnableVideoEqualizer=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBVideoEqualizer ) );
 	gtkVODoubleBuffer=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBDoubleBuffer ) );
 	gtkVODirectRendering=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBDR ) );
 	gtkVFrameDrop=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBFramedrop ) );
@@ -822,13 +819,6 @@
   gtk_container_add( GTK_CONTAINER( frame ),vbox5 );
   gtk_widget_set_usize( vbox5,250,-2 );
 
-  CBVideoEqualizer=gtk_check_button_new_with_label( MSGTR_PREFERENCES_VideoEqu );
-  gtk_widget_set_name( CBVideoEqualizer,"CBVideoEqualizer" );
-  gtk_widget_ref( CBVideoEqualizer );
-  gtk_object_set_data_full( GTK_OBJECT( Preferences ),"CBVideoEqualizer",CBVideoEqualizer,(GtkDestroyNotify)gtk_widget_unref );
-  gtk_widget_show( CBVideoEqualizer );
-  gtk_box_pack_start( GTK_BOX( vbox5 ),CBVideoEqualizer,FALSE,FALSE,0 );
-
   CBDoubleBuffer=gtk_check_button_new_with_label( MSGTR_PREFERENCES_DoubleBuffer );
   gtk_widget_set_name( CBDoubleBuffer,"CBDoubleBuffer" );
   gtk_widget_ref( CBDoubleBuffer );
--- a/Gui/mplayer/mplayer.c	Mon Aug 05 01:06:25 2002 +0000
+++ b/Gui/mplayer/mplayer.c	Mon Aug 05 01:14:14 2002 +0000
@@ -54,10 +54,10 @@
 
  // read gui.conf, gui.pl
  cfg_read();
-#endif 
 
  // opens X display, checks for extensions (XShape, DGA etc)
  wsXInit( disp );
+#endif 
 
  if ( ( mplDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.main.Bitmap.ImageSize ) ) == NULL )
   {
--- a/Gui/mplayer/play.c	Mon Aug 05 01:06:25 2002 +0000
+++ b/Gui/mplayer/play.c	Mon Aug 05 01:14:14 2002 +0000
@@ -102,11 +102,14 @@
   } 
   else
     {
-     if ( mplMainAutoPlay ) { mplMainAutoPlay=0; return; }
+     if ( guiIntfStruct.FilenameChanged ) return;
 
      guiIntfStruct.TimeSec=0;
      guiIntfStruct.Position=0;
      guiIntfStruct.AudioType=0;
+     guiIntfStruct.DVD.current_title=1;
+     guiIntfStruct.DVD.current_chapter=1;
+     guiIntfStruct.DVD.current_angle=1;
 
      if ( !appMPlayer.subWindow.isFullScreen )
       {
--- a/mplayer.c	Mon Aug 05 01:06:25 2002 +0000
+++ b/mplayer.c	Mon Aug 05 01:14:14 2002 +0000
@@ -1358,7 +1358,7 @@
      guiGetEvent( guiSetFileName,filename );
      if ( sh_audio ) guiIntfStruct.AudioType=sh_audio->channels; else guiIntfStruct.AudioType=0;
      if ( !sh_video && sh_audio ) guiGetEvent( guiSetAudioOnly,(char *)1 ); else guiGetEvent( guiSetAudioOnly,(char *)0 );
-     guiGetEvent( guiSetValues,NULL );
+     guiGetEvent( guiSetValues,(char *)sh_video );
     }
 #endif
 
@@ -2920,12 +2920,9 @@
 	  // get pos from frame number / total frames
 	  guiIntfStruct.Position=(float)d_video->pack_no*100.0f/sh_video->video.dwLength;
 	} else {
-	  // get pos from file position / filesize
-          int len=((demuxer->movi_end-demuxer->movi_start));
-	  int pos;
-	  if ( demuxer->file_format==DEMUXER_TYPE_AUDIO ) pos=stream->pos;
-	   else pos=(demuxer->file_format==DEMUXER_TYPE_AVI)?demuxer->filepos:d_video->pos;
-	  guiIntfStruct.Position=(len<=0)?0:((float)(pos-demuxer->movi_start) / len * 100.0f);
+	 int len = ( ( demuxer->movi_end - demuxer->movi_start ) >> 8 );
+	 int pos = ( demuxer->file_format == DEMUXER_TYPE_AUDIO?stream->pos:demuxer->filepos );
+	 guiIntfStruct.Position=(len <= 0? 0.0f : ( pos - demuxer->movi_start ) / len / 2.56f /* / 256.0f * 100.0f */ );
 	}
 	if ( sh_video ) guiIntfStruct.TimeSec=d_video->pts;
 	  else if ( sh_audio ) guiIntfStruct.TimeSec=sh_audio->timer;