changeset 4798:c39affa2b376

new interface ? :)
author pontscho
date Thu, 21 Feb 2002 22:48:47 +0000
parents b1a2469e78ac
children ff38befe039c
files Gui/gui.mak Gui/interface.c Gui/interface.h Gui/mplayer/play.c Makefile libvo/x11_common.c mplayer.c mplayer.h
diffstat 8 files changed, 54 insertions(+), 95 deletions(-) [+]
line wrap: on
line diff
--- a/Gui/gui.mak	Thu Feb 21 21:20:52 2002 +0000
+++ b/Gui/gui.mak	Thu Feb 21 22:48:47 2002 +0000
@@ -10,6 +10,6 @@
 	     $(MPLAYERDIR)psignal.c $(GTKSRCS)
 MPLAYEROBJS = $(MPLAYERSRCS:.c=.o)
 
-SRCS = $(SKINSRC) $(BITMAPSRCS) wm/ws.c wm/wsconv.c app.c events.c timer.c error.c
+SRCS = $(SKINSRC) $(BITMAPSRCS) wm/ws.c wm/wsconv.c app.c events.c timer.c error.c interface.c
 OBJS = $(SRCS:.c=.o)
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Gui/interface.c	Thu Feb 21 22:48:47 2002 +0000
@@ -0,0 +1,25 @@
+
+
+#include "ws.h"
+#include "mplayer/play.h"
+#include "interface.h"
+#include "../mplayer.h"
+
+void guiGetEvent( int type,char * arg )
+{
+ switch ( type )
+  {
+   case guiXEvent:
+        wsEvents( wsDisplay,(XEvent *)arg,NULL );
+	break;
+   case guiCEvent:
+	break;
+  }
+}
+
+void guiEventHandling( void )
+{
+ if ( use_gui && !mplShMem->Playing ) wsHandleEvents();
+ mplTimerHandler(0); // handle GUI timer events
+ if ( mplShMem->SkinChange ) { ChangeSkin(); mplShMem->SkinChange=0;  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Gui/interface.h	Thu Feb 21 22:48:47 2002 +0000
@@ -0,0 +1,14 @@
+
+#ifndef _INTERFACE_H
+#define _INTERFACE_H
+
+#include "mplayer/play.h"
+#include "../mplayer.h"
+
+#define guiXEvent 0
+#define guiCEvent 1
+
+extern void guiGetEvent( int type,char * arg );
+extern void guiEventHandling( void );
+
+#endif
\ No newline at end of file
--- a/Gui/mplayer/play.c	Thu Feb 21 21:20:52 2002 +0000
+++ b/Gui/mplayer/play.c	Thu Feb 21 22:48:47 2002 +0000
@@ -225,12 +225,6 @@
  btnModify( evFullScreen,!appMPlayer.subWindow.isFullScreen );
 }
 
-void EventHandling( void )
-{
- wsHandleEvents();mplTimerHandler(0); // handle GUI timer events
- if ( mplShMem->SkinChange ) { ChangeSkin(); mplShMem->SkinChange=0;  }
-}
-
 void mplResizeToMovieSize( unsigned int width,unsigned int height )
 {
  if ( !appMPlayer.subWindow.isFullScreen )
--- a/Makefile	Thu Feb 21 21:20:52 2002 +0000
+++ b/Makefile	Thu Feb 21 22:48:47 2002 +0000
@@ -194,7 +194,7 @@
 endif
 
 $(PRG):	$(MPLAYER_DEP)
-	$(CC) $(CFLAGS) -o $(PRG) $(OBJS_MPLAYER) $(CODEC_LIBS) -Llibmpdemux -lmpdemux $(GUI_LIBS) $(VO_LIBS) $(AO_LIBS) $(LIB_LOADER) $(COMMON_LIBS) $(EXTRA_LIB) $(A_LIBS) $(V_LIBS) $(LIRC_LIB) $(CSS_LIB) $(ARCH_LIB) $(DECORE_LIB) $(TERMCAP_LIB) $(STATIC_LIB) $(GTK_LIBS) $(PNG_LIB) $(Z_LIB) $(STREAMING_LIB) $(VIDIX_LIBS) -Linput -linput -lm
+	$(CC) $(CFLAGS) -o $(PRG) $(OBJS_MPLAYER) $(CODEC_LIBS) -Llibmpdemux -lmpdemux $(VO_LIBS) $(GUI_LIBS) $(AO_LIBS) $(LIB_LOADER) $(COMMON_LIBS) $(EXTRA_LIB) $(A_LIBS) $(V_LIBS) $(LIRC_LIB) $(CSS_LIB) $(ARCH_LIB) $(DECORE_LIB) $(TERMCAP_LIB) $(STATIC_LIB) $(GTK_LIBS) $(PNG_LIB) $(Z_LIB) $(STREAMING_LIB) $(VIDIX_LIBS) -Linput -linput -lm
 
 $(PRG_FIBMAP): fibmap_mplayer.o
 	$(CC) -o $(PRG_FIBMAP) fibmap_mplayer.o
--- a/libvo/x11_common.c	Thu Feb 21 21:20:52 2002 +0000
+++ b/libvo/x11_common.c	Thu Feb 21 22:48:47 2002 +0000
@@ -34,6 +34,10 @@
 #include "../input/mouse.h"
 #endif
 
+#ifdef HAVE_NEW_GUI
+#include "../Gui/interface.h"
+#endif
+
 /*
  * If SCAN_VISUALS is defined, vo_init() scans all available TrueColor
  * visuals for the 'best' visual for MPlayer video display.  Note that
@@ -429,9 +433,9 @@
  while ( XPending( mydisplay ) )
   {
    XNextEvent( mydisplay,&Event );
-//   #ifdef HAVE_NEW_GUI
-//    if ( use_gui ) gEvent( 0,(char*)&Event );
-//   #endif
+   #ifdef HAVE_NEW_GUI
+    if ( use_gui ) guiGetEvent( 0,(char*)&Event );
+   #endif
    if ( vo_window == Event.xany.window )
     switch( Event.type )
      {
--- a/mplayer.c	Thu Feb 21 21:20:52 2002 +0000
+++ b/mplayer.c	Thu Feb 21 22:48:47 2002 +0000
@@ -70,7 +70,7 @@
 #endif
 
 #ifdef HAVE_NEW_GUI
-#include "Gui/mplayer/play.h"
+#include "Gui/interface.h"
 #endif
 
 #ifdef HAVE_NEW_INPUT
@@ -741,7 +741,7 @@
 //      mplShMem->Playing= (gui_no_filename) ? 0 : 1;
       while(mplShMem->Playing!=1){
 	usleep(20000);
-	EventHandling();
+	guiEventHandling();
       }
 
 play_dvd:
@@ -1657,7 +1657,7 @@
 	  }
       }
 #ifdef HAVE_NEW_GUI
-      if(use_gui) EventHandling();
+      if(use_gui) guiEventHandling();
 #endif
       video_out->check_events(); // check events AST
     } else {
@@ -1747,7 +1747,7 @@
 
 #ifdef HAVE_NEW_GUI
       if(use_gui){
-	EventHandling();
+	guiEventHandling();
       }
 #endif
 
@@ -2001,7 +2001,7 @@
 #endif /* HAVE_NEW_INPUT */
 #ifdef HAVE_NEW_GUI
              if(use_gui){
-		EventHandling();
+		guiEventHandling();
 		if(mplShMem->Playing!=2 || (rel_seek_secs || abs_seek_pos))
 		  { gui_pause_flag=1; break; } // end of pause or seek
              }
--- a/mplayer.h	Thu Feb 21 21:20:52 2002 +0000
+++ b/mplayer.h	Thu Feb 21 22:48:47 2002 +0000
@@ -2,84 +2,6 @@
 #ifndef __MPLAYER_MAIN
 #define __MPLAYER_MAIN
 
-extern int divx_quality;
-
-extern char* filename;
-extern int i;
-extern char *seek_to_sec;
-extern int seek_to_byte;
-extern int f; // filedes
-extern int stream_type;
-extern stream_t* stream;
-extern int file_format;
-extern int has_audio;
-//int has_video=1;
-//
-extern int audio_format;
-#ifdef ALSA_TIMER
-extern int alsa;
-#else
-extern int alsa;
-#endif
-extern int audio_buffer_size;
-extern int audio_id;
-extern int video_id;
-extern int dvdsub_id;
-extern float default_max_pts_correction;
-extern int delay_corrected;
-extern float force_fps;
-extern float audio_delay;
-extern int vcd_track;
-#ifdef VCD_CACHE
-extern int vcd_cache_size;
-#endif
-extern int index_mode;  // -1=untouched  0=don't use index  1=use (geneate) index
-#ifdef AVI_SYNC_BPS
-extern int pts_from_bps;
-#else
-extern int pts_from_bps;
-#endif
-extern char* title;
-// screen info:
-extern char* video_driver; //"mga"; // default
-vo_functions_t *video_out;
-extern int fullscreen;
-extern int vidmode;
-extern int softzoom;
-extern int screen_size_x;//SCREEN_SIZE_X;
-extern int screen_size_y;//SCREEN_SIZE_Y;
-extern int screen_size_xy;
-// movie info:
-extern int out_fmt;
-extern char *dsp;
-extern int force_ni;
-extern char *conffile;
-extern int conffile_fd;
-extern char *font_name;
-extern float font_factor;
-extern char *sub_name;
-extern float sub_delay;
-extern float sub_fps;
-extern int   sub_auto;
-extern char *stream_dump_name;
-extern int stream_dump_type;
-//int user_bpp=0;
-
-extern int verbose;
-
-extern int osd_level;
-extern int nogui;
-
-float a_frame;    // Audio
-
-extern float rel_seek_secs;
-
-extern int osd_visible;
-extern int osd_function;
-extern int osd_last_pts;
-
-extern int mplayer(int argc,char* argv[], char *envp[]);
-extern void parse_cfgfiles( void );
-extern void exit_player(char* how);
+extern int use_gui;
 
 #endif
\ No newline at end of file