changeset 8311:37ab4e646f65

add autosync && some 10l bugfix
author pontscho
date Thu, 28 Nov 2002 23:17:14 +0000
parents 171c99ff2649
children ef8c992672f4
files Gui/cfg.c Gui/cfg.h Gui/interface.c Gui/mplayer/gtk/opts.c help/help_mp-en.h mplayer.c mplayer.h
diffstat 7 files changed, 50 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/Gui/cfg.c	Thu Nov 28 23:14:48 2002 +0000
+++ b/Gui/cfg.c	Thu Nov 28 23:17:14 2002 +0000
@@ -42,6 +42,9 @@
 int    gtkCacheOn = 0;
 int    gtkCacheSize = 2048;
 
+int    gtkAutoSyncOn = 0;
+int    gtkAutoSync = 0;
+
 #ifdef HAVE_DXR3
  char * gtkDXR3Device;
 #endif
@@ -111,11 +114,14 @@
  { "font_autoscale",&subtitle_autoscale,CONF_TYPE_INT,CONF_RANGE,0,3,NULL },
 #endif
 
- { "cache",&gtkCacheOn,CONF_TYPE_INT,CONF_RANGE,-1,65535,NULL },
+ { "cache",&gtkCacheOn,CONF_TYPE_FLAG,0,0,1,NULL },
  { "cache_size",&gtkCacheSize,CONF_TYPE_INT,CONF_RANGE,-1,65535,NULL },
  
  { "load_fullscreen",&gtkLoadFullscreen,CONF_TYPE_FLAG,0,0,1,NULL },
  { "stopxscreensaver",&stop_xscreensaver,CONF_TYPE_FLAG,0,0,1,NULL },
+
+ { "autosync",&gtkAutoSyncOn,CONF_TYPE_FLAG,0,0,1,NULL },
+ { "autosync_size",&gtkAutoSync,CONF_TYPE_INT,CONF_RANGE,0,10000,NULL },
  
  { "gui_skin",&skinName,CONF_TYPE_STRING,0,0,0,NULL },
 
--- a/Gui/cfg.h	Thu Nov 28 23:14:48 2002 +0000
+++ b/Gui/cfg.h	Thu Nov 28 23:17:14 2002 +0000
@@ -20,6 +20,9 @@
 extern int    gtkCacheOn;
 extern int    gtkCacheSize;
 
+extern int    gtkAutoSyncOn;
+extern int    gtkAutoSync;
+
 extern int    gtkSubDumpMPSub;
 extern int    gtkSubDumpSrt;
 
--- a/Gui/interface.c	Thu Nov 28 23:14:48 2002 +0000
+++ b/Gui/interface.c	Thu Nov 28 23:17:14 2002 +0000
@@ -167,7 +167,9 @@
 #ifdef HAVE_DXR3
  if ( !gtkDXR3Device ) gtkDXR3Device=strdup( "/dev/em8300-0" );
 #endif
- fullscreen=gtkLoadFullscreen;       
+ fullscreen=gtkLoadFullscreen;
+ if ( stream_cache_size != -1 ) { gtkCacheOn=1; gtkCacheSize=stream_cache_size; }
+ if ( autosync && autosync != gtkAutoSync ) { gtkAutoSyncOn=1; gtkAutoSync=autosync; }
    
  gtkInit();
 // --- initialize X 
@@ -552,6 +554,9 @@
 	if ( gtkCacheOn ) stream_cache_size=gtkCacheSize;
 	 else stream_cache_size=-1;
 
+	if ( gtkAutoSyncOn ) autosync=gtkAutoSync;
+	 else autosync=0;
+
 // -- audio
         if ( audio_out )
 	{
--- a/Gui/mplayer/gtk/opts.c	Thu Nov 28 23:14:48 2002 +0000
+++ b/Gui/mplayer/gtk/opts.c	Thu Nov 28 23:17:14 2002 +0000
@@ -70,6 +70,10 @@
 static GtkWidget * SBCache;
 static GtkAdjustment * SBCacheadj;
 
+static GtkWidget * CBAutoSync;
+static GtkWidget * SBAutoSync;
+static GtkAdjustment * SBAutoSyncadj;
+
 static GtkWidget * RBOSDNone;
 static GtkWidget * RBOSDTandP;
 static GtkWidget * RBOSDIndicator;
@@ -316,7 +320,12 @@
  gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBCache ),0 );
  gtk_adjustment_set_value( SBCacheadj,(float)gtkCacheSize );
  if ( !gtkCacheOn ) gtk_widget_set_sensitive( SBCache,FALSE );
-  else gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBCache ),1 );
+  else gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBCache ),TRUE );
+  
+ gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBAutoSync ),0 );
+ gtk_adjustment_set_value( SBAutoSyncadj,(float)gtkAutoSync );
+ if ( !gtkAutoSyncOn ) gtk_widget_set_sensitive( SBAutoSync,FALSE );
+  else gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBAutoSync ),TRUE );
 
 // -- disables
 #ifndef USE_SUB
@@ -354,6 +363,7 @@
  gtk_signal_connect( GTK_OBJECT( RBFontAutoScaleDiagonal ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)7 );
 #endif
  gtk_signal_connect( GTK_OBJECT( CBCache ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)8);
+ gtk_signal_connect( GTK_OBJECT( CBAutoSync ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)9);
 
  gtk_signal_connect( GTK_OBJECT( HSExtraStereoMul ),"motion_notify_event",GTK_SIGNAL_FUNC( prHScaler ),(void*)0 );
  gtk_signal_connect( GTK_OBJECT( HSAudioDelay ),"motion_notify_event",GTK_SIGNAL_FUNC( prHScaler ),(void*)1 );
@@ -477,6 +487,9 @@
 
 	if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBCache ) ) ) { gtkCacheSize=(int)SBCacheadj->value; gtkCacheOn=1; }
 	 else gtkCacheOn=0;
+	
+	if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBAutoSync ) ) ) { gtkAutoSync=(int)SBAutoSyncadj->value; gtkAutoSyncOn=1; }
+	 else gtkAutoSyncOn=0;
 
 	{
 	 int i;
@@ -592,6 +605,10 @@
 	if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBCache ) ) ) gtk_widget_set_sensitive( SBCache,TRUE );
 	 else gtk_widget_set_sensitive( SBCache,FALSE );
 	break;
+   case 9:
+	if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBAutoSync ) ) ) gtk_widget_set_sensitive( SBAutoSync,TRUE );
+	 else gtk_widget_set_sensitive( SBAutoSync,FALSE );
+	break;
   }
 }
 
@@ -763,7 +780,6 @@
     gtk_widget_set_usize( vbox5,250,-2 );
 
   CBDoubleBuffer=AddCheckButton( MSGTR_PREFERENCES_DoubleBuffer,vbox5 );
-//  gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBDoubleBuffer ),TRUE );
   CBDR=AddCheckButton( MSGTR_PREFERENCES_DirectRender,vbox5 );
   CBFramedrop=AddCheckButton( MSGTR_PREFERENCES_FrameDrop,vbox5 );
   CBHFramedrop=AddCheckButton( MSGTR_PREFERENCES_HFrameDrop,vbox5 );
@@ -998,7 +1014,17 @@
       AddFrame( MSGTR_PREFERENCES_FRAME_Misc,GTK_SHADOW_ETCHED_OUT,vbox601,0 ),1 ),0 );
 
   CBLoadFullscreen=AddCheckButton( MSGTR_PREFERENCES_LoadFullscreen,vbox602 );
-  CBStopXScreenSaver=AddCheckButton( MSGTR_PREFERENCES_XSREENSAVER,vbox602 );
+  CBStopXScreenSaver=AddCheckButton( MSGTR_PREFERENCES_XSCREENSAVER,vbox602 );
+
+  AddHSeparator( vbox602 );
+
+  CBAutoSync=AddCheckButton( MSGTR_PREFERENCES_AutoSync,vbox602 );
+  hbox5=AddHBox( vbox602,1 );
+  AddLabel( MSGTR_PREFERENCES_AutoSyncValue,hbox5 );
+  SBAutoSyncadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,10000,1,10,10 ) );
+  SBAutoSync=gtk_spin_button_new( GTK_ADJUSTMENT( SBAutoSyncadj ),1,0 );
+  gtk_widget_show( SBAutoSync );
+  gtk_box_pack_start( GTK_BOX( hbox5 ),SBAutoSync,TRUE,TRUE,0 );
 
   label=AddLabel( MSGTR_PREFERENCES_Misc,NULL );
     gtk_notebook_set_tab_label( GTK_NOTEBOOK( notebook1 ),gtk_notebook_get_nth_page( GTK_NOTEBOOK( notebook1 ),3 ),label );
--- a/help/help_mp-en.h	Thu Nov 28 23:14:48 2002 +0000
+++ b/help/help_mp-en.h	Thu Nov 28 23:17:14 2002 +0000
@@ -491,6 +491,9 @@
 #define MSGTR_PREFERENCES_Cache "Cache on/off"
 #define MSGTR_PREFERENCES_LoadFullscreen "Start in fullscreen"
 #define MSGTR_PREFERENCES_CacheSize "Cache size: "
+#define MSGTR_PREFERENCES_XSCREENSAVER "Stop XScreenSaver"
+#define MSGTR_PREFERENCES_AutoSync "AutoSync on/off"
+#define MSGTR_PREFERENCES_AutoSyncValue "Autosync: "
 
 // --- messagebox
 #define MSGTR_MSGBOX_LABEL_FatalError "Fatal error!"
--- a/mplayer.c	Thu Nov 28 23:14:48 2002 +0000
+++ b/mplayer.c	Thu Nov 28 23:17:14 2002 +0000
@@ -186,7 +186,7 @@
 static int loop_times=-1;
 
 // A/V sync:
-static int autosync=0; // 30 might be a good default value.
+       int autosync=0; // 30 might be a good default value.
 
 // may be changed by GUI:  (FIXME!)
 float rel_seek_secs=0;
--- a/mplayer.h	Thu Nov 28 23:14:48 2002 +0000
+++ b/mplayer.h	Thu Nov 28 23:17:14 2002 +0000
@@ -38,6 +38,7 @@
 extern int stream_cache_size;
 extern int force_ni;
 extern int index_mode;
+extern int autosync;
 
 // libmpcodecs:
 extern int fullscreen;