[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xine-cvslog
Subject:    [xine-cvs] CVS: xine-win32 Makefile.common,NONE,1.1 afxres.h,NONE,1.1 config.h,NONE,1.1 ChangeLog,1.
From:       Frantisek Dvorak <valtri () users ! sourceforge ! net>
Date:       2004-08-31 20:56:00
Message-ID: E1C2Ffc-0003LX-Ps () sc8-pr-cvs1 ! sourceforge ! net
[Download RAW message or body]

Update of /cvsroot/xine/xine-win32
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12739

Modified Files:
	ChangeLog Makefile main.cpp wnd.ctrl.cpp wnd.playlist.cpp 
	xineui.cpp xineui.h 
Added Files:
	Makefile.common afxres.h config.h 
Log Message:
MinGW port:
 - replacement for setenv, gettimeofday from xine-lib
 - fix warnings
 - debug messages
 - xine verbosity in debug build


--- NEW FILE: Makefile.common ---
# Common Makefile for compilation xineui. It's called from Makefile.

CFLAGS=-W -Wall -g -O2
DEBUG_CFLAGS=-W -Wall -g -O2 -DDEBUG
XINE_CONFIG=xine-config
PACKAGE=xine-win32
VERSION=0.1

SOURCES=main.cpp wnd.ctrl.cpp wnd.panel.cpp wnd.playlist.cpp wnd.video.cpp xineui.cpp resource.rc 
HEADERS=afxres.h common.h config.h xineui.h xineint.h resource.h
EXTRA_DIST=*.bmp icon1.ico AUTHORS ChangeLog README xineui.dsp Makefile.common

OBJECTS=$(addsuffix .o, $(basename $(SOURCES)))
OS_OBJECTS=$(addprefix lib/, $(OS_OBJS))
distdir=$(PACKAGE)-$(VERSION)
COMPILE=$(CXX) $(CFLAGS) $(OS_CFLAGS) `$(XINE_CONFIG) --cflags`

all: xineui

debug:
	$(MAKE) -f Makefile.common CFLAGS="$(DEBUG_CFLAGS)"

xineui: $(OBJECTS) $(OS_OBJECTS)
	$(CXX) $(OBJECTS) $(OS_OBJECTS) -o $@ `$(XINE_CONFIG) --libs` $(LIBS)

resource.o: resource.rc
	windres -i $< -o $@

.cpp.o .c.o: $<
	$(COMPILE) -c $< -o $@

clean:
	-$(RM) *.o lib/*.o *.exe *~ lib/*~ $(distdir).tar.gz

dist:
	-$(RM) -Rf $(distdir)
	mkdir $(distdir)
	cp Makefile $(SOURCES) $(HEADERS) $(EXTRA_DIST) $(distdir)/
	mkdir $(distdir)/lib
	cp lib/*.c $(distdir)/lib/
	tar chof - $(distdir) | gzip -c > $(distdir).tar.gz
	-$(RM) -Rf $(distdir)

--- NEW FILE: afxres.h ---
#ifndef _AFXRES_H
#define _AFXRES_H
#if __GNUC__ >= 3

#pragma GCC system_header

#endif



#ifdef __cplusplus

extern "C" {

#endif



#ifndef _WINDOWS_H
#include <windows.h>

#endif


/* IDC_STATIC is documented in winuser.h, but not defined. */
#ifndef IDC_STATIC

#define IDC_STATIC (-1)

#endif



#ifdef __cplusplus

}

#endif

#endif


--- NEW FILE: config.h ---
/* config.h.  Generated by configure.  */
/* config.h.in.  Generated from configure.ac by autoheader.  */


#ifndef _CONFIG_H_
#define _CONFIG_H_

#ifdef __CYGWIN__
#include <strings.h>
#endif

#ifndef HAVE_SETENV
#define setenv(NAME, VAL, XX) _x_setenv(NAME, VAL)
void _x_setenv(const char *name, const char *val);
#endif

#ifndef HAVE_GETTIMEOFDAY
/* use gettimeofday from libxine */
struct timezone {
    int     tz_minuteswest; /* minutes west of Greenwich */
    int     tz_dsttime;     /* type of dst correction */
};

extern "C" {
  int gettimeofday(struct timeval *tp, struct timezone *tzp);
}
#endif

/* Name of package */
#define PACKAGE "xine-lib"

/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT ""

/* Define to the full name of this package. */
#define PACKAGE_NAME ""

/* Define to the full name and version of this package. */
#define PACKAGE_STRING ""

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME ""

/* Define to the version of this package. */
#define PACKAGE_VERSION ""

/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1

/* Version number of package */
#define VERSION "1-beta12"

/* xine major version number */
#define XINE_MAJOR 1

/* xine minor version number */
#define XINE_MINOR 0

/* xine sub version number */
#define XINE_SUB 0

/* Define to 1 if the X Window System is missing or not being used. */
#define X_DISPLAY_MISSING 1

/* Define to 1 if your processor stores words with the most significant byte
   first (like Motorola and SPARC, unlike Intel and VAX). */
/* #undef WORDS_BIGENDIAN */


#if defined(WIN32)

#define ssize_t __int64

#ifndef PATH_MAX
#define PATH_MAX MAX_PATH
#endif

/* Ridiculous hack to return valid xine support
 * directories. These should be read from
 * a registry entry set at install time.
 */
/*
static char tmp_win32_path[ 1024 ];
static char * exec_path_append_subdir( char * string )
{
	char * tmpchar;
	char * cmdline;
	char * back_slash;
	char * fore_slash;
	char * last_slash;

	// get program exec command line
	cmdline = GetCommandLine();

	// check for " at beginning of string
	if( *cmdline == '\"' )
	{
		// copy command line, skip first quote
		strcpy( tmp_win32_path, cmdline + 1 );

		// terminate at second set of quotes
		tmpchar = strchr( tmp_win32_path, '\"' );
		*tmpchar = 0;
	}
	else
	{
		// copy command line
		strcpy( tmp_win32_path, cmdline );

		// terminate at first space
		tmpchar = strchr( tmp_win32_path, ' ' );
		if (tmpchar) *tmpchar = 0;
	}

	// find the last occurance of a back 
	// slash or fore slash
	back_slash = strrchr( tmp_win32_path, '\\' );
	fore_slash = strrchr( tmp_win32_path, '/' );

	// make sure the last back slash was not
	// after a drive letter
	if( back_slash > tmp_win32_path )
		if( *( back_slash - 1 ) == ':' )
			back_slash = 0;

	// which slash was the latter slash
	if( back_slash > fore_slash )
		last_slash = back_slash;
	else
		last_slash = fore_slash;

	// detect if we had a relative or
	// distiguished path ( had a slash )
	if( last_slash )
	{
		// we had a slash charachter in our
		// command line
		*( last_slash + 1 ) = 0;

		// if had a string to append to the path
		if( string )
			strcat( tmp_win32_path, string );
	}
	else
	{
		// no slash, assume local directory
		strcpy( tmp_win32_path, "./" );

		// if had a string to append to the path
		if( string )
			strcat( tmp_win32_path, string );
	}

	return tmp_win32_path;
}

#define XINE_HOMEDIR	exec_path_append_subdir( 0 )
#define XINE_PLUGINDIR	exec_path_append_subdir( "plugins" )
#define XINE_FONTDIR	exec_path_append_subdir( "fonts" )
#define XINE_LOCALEDIR	exec_path_append_subdir( "locale" )
*/
#define S_ISDIR(m) ((m) & _S_IFDIR)
#define S_ISREG(m) ((m) & _S_IFREG)
#define S_ISBLK(m) 0
#define S_ISCHR(m) 0

#define mkdir(A, B) _mkdir(A)

#else

/* Path where catalog files will be. */
#define XINE_LOCALEDIR "/usr/local/share/locale"

/* Define this to plugins directory location */
#define XINE_PLUGINDIR "/usr/local/lib/xine/plugins/1.0.0"

/* Path where aclocal m4 files will be. */
#define XINE_ACFLAGS "-I ${prefix}/share/aclocal"

#endif

#endif /* defined CONFIG_H */

Index: ChangeLog
===================================================================
RCS file: /cvsroot/xine/xine-win32/ChangeLog,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ChangeLog	29 Aug 2004 15:19:57 -0000	1.2
+++ ChangeLog	31 Aug 2004 20:55:56 -0000	1.3
@@ -1,5 +1,6 @@
  * add forgotten header files
- * prepare build for MinGW
+ * port to MinGW
+ * fix warnings
 
 xine-win32 (0.1)
  * importing win32 contrib sources and msvc build environment

Index: Makefile
===================================================================
RCS file: /cvsroot/xine/xine-win32/Makefile,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- Makefile	21 Jun 2004 10:29:31 -0000	1.1.1.1
+++ Makefile	31 Aug 2004 20:55:56 -0000	1.2
@@ -1,33 +1,19 @@
-# Makefile for compilation xineui under cygwin.
+# Makefile for compilation xineui under cygwin or mingw.
 # It requires installed libxine1.
 
-CFLAGS=-W -Wall -g -O2
-XINE_CONFIG=xine-config
-PACKAGE=xine-win32
-VERSION=0.1
-
-SOURCES=main.cpp wnd.ctrl.cpp wnd.panel.cpp wnd.playlist.cpp wnd.video.cpp xineui.cpp resource.rc 
-HEADERS=xineui.h
-EXTRA_DIST=*.bmp icon1.ico AUTHORS ChangeLog README xineui.dsp
-
-OBJECTS=$(addsuffix .o, $(basename $(SOURCES)))
-distdir=$(PACKAGE)-$(VERSION)
-
-all: $(OBJECTS)
-	$(CXX) $(OBJECTS) `$(XINE_CONFIG) --libs` -luser32 -lgdi32 -lcomdlg32 -lcomctl32 -o xineui
-
-resource.o: resource.rc
-	windres -i $< -o $@
-
-clean:
-	-$(RM) $(OBJECTS) *.exe *~ $(distdir).tar.gz
-
-.cpp.o: $<
-	$(CXX) $(CFLAGS) `$(XINE_CONFIG) --cflags` -c $<
-
-dist:
-	-$(RM) -Rf $(distdir)
-	mkdir $(distdir)
-	cp Makefile $(SOURCES) $(HEADERS) $(EXTRA_DIST) $(distdir)
-	tar chof - $(distdir) | gzip -c > $(distdir).tar.gz
-	-$(RM) -Rf $(distdir)
+all clean dist debug xineui %.o:
+	case "`uname`" in \
+	  MINGW*) \
+	    make -f Makefile.common $@ \
+	      OS_OBJS="setenv.o" \
+	      LIBS="-luser32 -lgdi32 -lcomdlg32 -lcomctl32 -lwinmm"\
+	    ;;\
+	  CYGWIN*) \
+	    make -f Makefile.common $@ \
+	      OS_CFLAGS="-DHAVE_GETTIMEOFDAY -DHAVE_SETENV" \
+	      LIBS="-luser32 -lgdi32 -lcomdlg32 -lcomctl32" \
+	    ;; \
+	  *) \
+	    echo Not prepared for this platform. \
+	    ;; \
+	esac

Index: main.cpp
===================================================================
RCS file: /cvsroot/xine/xine-win32/main.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- main.cpp	21 Jun 2004 10:29:31 -0000	1.1.1.1
+++ main.cpp	31 Aug 2004 20:55:56 -0000	1.2
@@ -99,7 +99,6 @@
 {
 	XINE_UI xine_ui;
 
-
 	/* We only need the output window for MSVC */
 	RedirectIOToConsole();
 

Index: wnd.ctrl.cpp
===================================================================
RCS file: /cvsroot/xine/xine-win32/wnd.ctrl.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- wnd.ctrl.cpp	21 Jun 2004 10:29:31 -0000	1.1.1.1
+++ wnd.ctrl.cpp	31 Aug 2004 20:55:56 -0000	1.2
@@ -36,9 +36,7 @@
     {
 		case WM_COMMAND:
 		{
-			WORD ncode = HIWORD( wparam );	// notification code 
 			WORD cid = LOWORD( wparam );	// item, control, or accelerator identifier 
-			HWND chwnd = ( HWND ) lparam;	// handle of control 
 			
 			if( cid == ID_PLAY_BTTN )
 			{

Index: wnd.playlist.cpp
===================================================================
RCS file: /cvsroot/xine/xine-win32/wnd.playlist.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- wnd.playlist.cpp	21 Jun 2004 10:29:31 -0000	1.1.1.1
+++ wnd.playlist.cpp	31 Aug 2004 20:55:56 -0000	1.2
@@ -101,7 +101,6 @@
 	{

 		case WM_NOTIFY:

 		{

-			int		controlid = ( int ) wparam; 

 			NMHDR *			lpnm = ( NMHDR * ) lparam; 

 			NMLVDISPINFO *	nmlvdi = ( NMLVDISPINFO * ) lparam;

 			

@@ -127,9 +126,7 @@
 

 		case WM_COMMAND:

 		{

-			WORD ncode = HIWORD( wparam );	// notification code 

 			WORD cid = LOWORD( wparam );	// item, control, or accelerator identifier 

-			HWND chwnd = ( HWND ) lparam;	// handle of control 

 			

 			if( cid == ID_ADD )

 			{

@@ -201,15 +198,13 @@
 				HWND hlistwnd = GetDlgItem( hwnd, ID_LIST );

 				int	lvindex;

 

-				while( ( lvindex = ListView_GetNextItem( hlistwnd, -1, LVNI_SELECTED ) ) != -1 )

+				while( ( lvindex = ListView_GetNextItem( hlistwnd, (UINT)-1, LVNI_SELECTED ) ) != -1 )

 				{

 					LVITEM lvitem;

 					lvitem.mask = LVIF_PARAM;

 					lvitem.iItem = lvindex;

 					ListView_GetItem( hlistwnd, &lvitem );

 

-					PLAYITEM * playitem = ( PLAYITEM * ) lvitem.lParam;

-

 					if( xine_ui->PlaylistDel( lvindex ) )

 						ListView_DeleteItem( hlistwnd, lvindex );

 				}


Index: xineui.cpp
===================================================================
RCS file: /cvsroot/xine/xine-win32/xineui.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- xineui.cpp	21 Jun 2004 10:29:32 -0000	1.1.1.1
+++ xineui.cpp	31 Aug 2004 20:55:56 -0000	1.2
@@ -29,6 +29,7 @@
 #  include <sys/stat.h>
 #endif
 #include <pthread.h>
+#include <time.h>
 
 /*
 #define LOG 1
@@ -157,7 +158,9 @@
 
     if (!video_port) {
       printf (("main: all available video drivers failed.\n"));
+#ifdef DEBUG
       getchar();
+#endif
       exit (1);
     }
     
@@ -190,7 +193,9 @@
     
     if(!video_port) {
       printf (("main: video driver <%s> failed\n"), video_driver_ids[driver_number]);
+#ifdef DEBUG
       getchar();
+#endif
       exit (1);
     }
     
@@ -290,7 +295,9 @@
 
       if (!audio_port) {
         printf (("main: audio driver <%s> failed\n"), audio_driver_ids[driver_number]);
+#ifdef DEBUG
         getchar();
+#endif
         exit (1);
       }
     
@@ -307,7 +314,7 @@
 static void event_listener(void *user_data, const xine_event_t *event) {
   struct timeval tv;
 
-	XINE_UI * xine_ui = ( XINE_UI * ) user_data;
+  XINE_UI * xine_ui = ( XINE_UI * ) user_data;
 
   /*
    * Ignoring finished event logo is displayed (or played), that save us
@@ -317,7 +324,7 @@
     return;
   
   gettimeofday (&tv, NULL);
-  
+
   if(abs(tv.tv_sec - event->tv.tv_sec) > 3) {
     printf("Event too old, discarding\n");
     return;
@@ -434,16 +441,19 @@
 
 bool _XINE_UI::InitXine()
 {
-  int                     i;
+  int                     i, verbosity;
   int                     audio_channel = -1;
   int                     spu_channel = -1;
   char                   *audio_driver_id = NULL;
   char                   *video_driver_id = NULL;
   int                     driver_num;
-  int                     session = -1;
-  char                   *session_mrl = NULL;
   int major, minor, sub;
 
+#ifdef DEBUG
+  verbosity = 2;
+#else
+  verbosity = 0;
+#endif
   /* Check xine library version */
   if( !xine_check_version( 0, 9, 4 ) )
   {
@@ -497,17 +507,15 @@
       sprintf (gGui->configfile + strlen(gGui->configfile), "/%s", cfgfile);
     }
 
-#if (0)
-    /* Popup setup window if there is no config file */
-    if(stat(gGui->configfile, &st) < 0)
-      gGui->actions_on_start[aos++] = ACTID_SETUP;
-#endif
-
   }
 #endif
 
     gGui->xine = xine_new();
+    dprintf("xine_new() OK\n");
     xine_config_load(gGui->xine, gGui->configfile);
+    dprintf("loading config OK\n");
+    xine_engine_set_param(gGui->xine, XINE_ENGINE_PARAM_VERBOSITY, verbosity);
+    dprintf("verbosity is %d\n", verbosity);
 
 #if (0)
   /*
@@ -536,9 +544,9 @@
    */
   /* Video out plugin */
   driver_num = -1;
+  i = 0;
   {
     const char *const *vids = xine_list_video_output_plugins(gGui->xine);
-    int                i = 0;
 
     while(vids[i++]);
 
@@ -563,23 +571,13 @@
     gGui->vo_port = load_video_out_driver(driver_num, &win32_visual);
   }
 
-  {
-    xine_cfg_entry_t  cfg_vo_entry;
-    
-    if(xine_config_lookup_entry(gGui->xine, "video.driver", &cfg_vo_entry)) {
-
-      if(!strcasecmp(video_driver_ids[cfg_vo_entry.num_value], "dxr3")) {
-     	xine_cfg_entry_t  cfg_entry;	
-      }
-    }
-  }
   SAFE_FREE(video_driver_id);
 
   /* Audio out plugin */
   driver_num = -1;
+  i = 0;
   {
     const char *const *aids = xine_list_audio_output_plugins(gGui->xine);
-    int                i = 0;
     
     while(aids[i++]);
     

Index: xineui.h
===================================================================
RCS file: /cvsroot/xine/xine-win32/xineui.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- xineui.h	29 Aug 2004 15:19:57 -0000	1.2
+++ xineui.h	31 Aug 2004 20:55:56 -0000	1.3
@@ -21,6 +21,9 @@
  * by Matthew Grooms <elon@altavista.com>

  */

 

+#ifndef _XINEUI_H_

+#define _XINEUI_H_

+

 #if defined(__CYGWIN32__) || defined(__MINGW32__)

 #  define _WIN32_IE 0xFFFF

 #endif

@@ -48,9 +51,6 @@
 #endif

 

 

-#ifndef _XINEUI_H_

-#define _XINEUI_H_

-

 #define ID_PANEL		10001

 #define ID_TIMEBAR		10002

 #define ID_TOOLBAR		10003

@@ -170,4 +170,35 @@
 

 extern gGui_t *gGui;

 

+#ifdef DEBUG

+  #ifdef __GNUC__

+    #define dprintf(fmt, args...)                                           \

+      do {                                                                  \

+        printf(fmt, ##args);                                                \

+      } while(0)

+  #else /* __GNUC__ */

+    #ifdef _MSC_VER

+      #define dprintf(fmtargs)                                              \

+        do {                                                                \

+          printf("%s", fmtargs);                                            \

+        } while(0)

+    #else /* _MSC_VER */

+      #define dprintf(fmt, ...)                                             \

+        do {                                                                \

+          printf(__VA_ARGS__);                                              \

+        } while(0)

+    #endif  /* _MSC_VER */

+  #endif /* __GNUC__ */

+#else /* DEBUG */

+  #ifdef __GNUC__

+    #define dprintf(fmt, args...)     do {} while(0)

+  #else

+  #ifdef _MSC_VER

+    #define dprintf

+  #else

+    #define dprintf(...)              do {} while(0)

+  #endif /* _MSC_VER */

+  #endif /* __GNUC__ */

+#endif /* DEBUG */

+

 #endif




-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
_______________________________________________
Xine-cvslog mailing list
Xine-cvslog@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xine-cvslog
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic