[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

[XaraXtreme-dev] movie(s) path



Hi,

Looking at wxOil/menucmds.cpp I see that the path where the .ogm movie
is expected to be is hardcoded. So I tried to invent something to be
able to configure this path at compile time. One possible way to do
this is to use this patch:

--- cut ---
Index: wxOil/menucmds.cpp
===================================================================
--- wxOil/menucmds.cpp	(revision 1391)
+++ wxOil/menucmds.cpp	(working copy)
@@ -960,9 +960,17 @@
 }
 #endif
 
+#ifndef STRDATAPATH
+#define STRDATAPATH "/usr/share"
+#endif
+
+#ifndef STRVIDEOPATH
+#define STRVIDEOPATH "/xaralx/video"
+#endif
+
 static void StartMovie( const wxString &strFile )
 {
-	wxString			strDataPath( br_find_data_dir( "/usr/share" ), wxConvUTF8 );
+	wxString			strDataPath( br_find_data_dir( STRDATAPATH ), wxConvUTF8 );
 	if( !wxDir::Exists( strDataPath ) )
 	{
 #if defined(_DEBUG)
@@ -972,7 +980,7 @@
 	}
 
 	wxString			strVideoPath( strDataPath );
-	strVideoPath += _("/xaralx/video");
+	strVideoPath += _(STRVIDEOPATH);
 	
 	wxString			strCommand( _T("mplayer -slave \"") );
 	strCommand += strVideoPath + _T("/") + strFile + _T("\"");	
@@ -991,7 +999,7 @@
 static void StartMovieNative( const wxString &strFile )
 {
 #if wxUSE_MEDIACTRL
-	wxString			strDataPath( br_find_data_dir( "/usr/share" ), wxConvUTF8 );
+	wxString			strDataPath( br_find_data_dir( STRDATAPATH ), wxConvUTF8 );
 	if( !wxDir::Exists( strDataPath ) )
 	{
 #if defined(_DEBUG)
@@ -1001,7 +1009,7 @@
 	}
 
 	wxString			strVideoPath( strDataPath );
-	strVideoPath += _("/xaralx/video");
+	strVideoPath += _(STRVIDEOPATH);
 	
 	CReplayWnd*		pWnd	= new CReplayWnd( CCamFrame::GetMainFrame() );
 	pWnd->Load( strVideoPath + _T("/") + strFile );
--- cut ---

And then try to define STRDATAPATH and STRVIDEOPATH by setting
CFLAGS like this "-DSTRDATAPATH=..." in the configure's environment.

Does this sound reasonable?
Any other ideas?

-- 
Vasil Dimov
gro.DSBeerF@dv

Testing can show the presence of bugs, but not their absence.
                -- Edsger W. Dijkstra

Attachment: pgpfrVTTx8fqD.pgp
Description: PGP signature