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

[XaraXtreme-commits] Commit Complete



Commit by  : luke
Repository : xara
Revision   : 1296
Date       : Mon Jun 12 05:18:10 BST 2006

Changed paths:
   M /Trunk/XaraLX/wxOil/menucmds.cpp

Try native mplayer first


Diff:
Index: Trunk/XaraLX/wxOil/menucmds.cpp
===================================================================
--- Trunk/XaraLX/wxOil/menucmds.cpp	(revision 1295)
+++ Trunk/XaraLX/wxOil/menucmds.cpp	(revision 1296)
@@ -873,36 +873,38 @@
 	HelpUsingGalleries();
 }
 
-
-
-void HelpDemosAction()
+static void StartMovie( const wxString &strFile )
 {
-#if 1
-	wxString			strVideoPath( br_find_data_dir( "/usr/share" ), wxConvUTF8 );
-	if( !wxDir::Exists( strVideoPath ) )
+	wxString			strDataPath( br_find_data_dir( "/usr/share" ), wxConvUTF8 );
+	if( !wxDir::Exists( strDataPath ) )
 	{
 #if defined(_DEBUG)
 		// We'll try default location under debug to make life easier
-		strVideoPath = _T("/usr/share");
+		strDataPath = _T("/usr/share");
 #endif
 	}
 
-	wxString			strBinaryPath( strVideoPath );
-	strBinaryPath += _("/xaralx/bin");
+	wxString			strVideoPath( strDataPath );
 	strVideoPath += _("/xaralx/video");
+	
+	wxString			strCommand( _T("mplayer -slave \"") );
+	strCommand += strVideoPath + _T("/") + strFile + _T("\"");	
+	long /*TYPENOTE: CORRECT*/ lResult = wxExecute( strCommand, wxEXEC_SYNC, NULL );
+	if( 255 == lResult )
+	{
+		strCommand = strDataPath + _T("/xaralx/bin/mplayer -slave \"");
+		strCommand += strVideoPath + strVideoPath + _T("/") + strFile + _T("\"");
 
-	wxString			strCommand( strBinaryPath + _T("/mplayer -slave \"") );
-	strCommand += strVideoPath + _T("/Part_1_master_inc_audio_smaller_q35_fr15_hi.ogm\"");
+		lResult = wxExecute( strCommand, wxEXEC_SYNC, NULL );
+		if( 255 == lResult )
+			InformWarning( _R(IDS_MPLAYER_MISSING), _R(IDS_OK) );
+	}
+}
 
-	TRACEUSER( "jlh92", _T("Executing %s
"), PCTSTR(strCommand) );
-
-	wxProcess*	pProcess = new wxProcess;
-	// NB this should return -1 for failure, but instead is returning 255
-	long /*TYPENOTE: CORRECT*/ lResult = wxExecute( strCommand, wxEXEC_SYNC, pProcess );
-	if( 255 == lResult )
-		InformWarning( _R(IDS_MPLAYER_MISSING), _R(IDS_OK) );
-
-	TRACEUSER( "jlh92", _T("Exec err = %d
"), lResult );
+void HelpDemosAction()
+{
+#if 0
+	StartMovie( _T("Part_1_master_inc_audio_smaller_q35_fr15_hi.ogm") );
 #else
 	wxWindow*		pWnd	= new wxTopLevelWindow( CCamFrame::GetMainFrame(), wxID_ANY, _T("Demo Video") );
 	wxSizer*		pSizer	= new wxBoxSizer( wxHORIZONTAL );


Xara