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

[XaraXtreme-commits] Commit Complete



Commit by  : luke
Repository : xara
Revision   : 1316
Date       : Wed Jun 14 11:56:49 BST 2006

Changed paths:
   M /Trunk/XaraLX/Kernel/menuops.cpp
   M /Trunk/XaraLX/Kernel/menuops.h
   M /Trunk/XaraLX/wxOil/menucmds.cpp
   M /Trunk/XaraLX/wxOil/menucmds.h
   M /Trunk/XaraLX/wxOil/xrc/EN/ollie-strings.xrc
   M /Trunk/XaraLX/wxOil/xrc/SHARED_MENU.res

Enable both mplayer and wxMediaCtrl replay tests at same time (WARNING closing the wxMediaCtrl window causes application melt-down). Also note that wxMediaCtrl code contains large amounts of rubish and shouldn't be considered anywhere near production quality


Diff:
Index: Trunk/XaraLX/Kernel/menuops.h
===================================================================
--- Trunk/XaraLX/Kernel/menuops.h	(revision 1315)
+++ Trunk/XaraLX/Kernel/menuops.h	(revision 1316)
@@ -135,6 +135,7 @@
 #define OPTOKEN_HELPTOOLS		_T("HelpTools")
 #define OPTOKEN_HELPGALLERIES	_T("HelpGalleries")
 #define OPTOKEN_HELPDEMOS		_T("HelpDemos")
+#define OPTOKEN_HELPDEMOS_NATIVE _T("HelpDemosNative")
 #define OPTOKEN_HELPTECHSUPPORT	_T("HelpTechSupport")
 
 //Graham 20/10/97
Index: Trunk/XaraLX/Kernel/menuops.cpp
===================================================================
--- Trunk/XaraLX/Kernel/menuops.cpp	(revision 1315)
+++ Trunk/XaraLX/Kernel/menuops.cpp	(revision 1316)
@@ -1454,6 +1454,14 @@
 		WebsterDemos();
 	#endif //webster
 	}
+	else if (WhichOp->Token == String(OPTOKEN_HELPDEMOS_NATIVE))
+	{
+	#ifndef WEBSTER
+		HelpDemosNativeAction();
+	#else	// webster
+		WebsterDemos();
+	#endif //webster
+	}
 	else if (WhichOp->Token == String(OPTOKEN_HELPTECHSUPPORT))
 		HelpTechSupportAction();
 //Webster_Ranbir_12	\96
@@ -1592,6 +1600,20 @@
 
 	ERRORIF(!DemosOp, _R(IDE_NOMORE_MEMORY), FALSE);
 
+
+	// REGOP(HELP, DEMOS, HelpOps);
+	OpDescriptor* DemosNativeOp = new OpDescriptor(
+												0, 
+												_R(IDS_HELP_MOVIES_NATIVE),
+												CC_RUNTIME_CLASS(HelpOps), 
+												OPTOKEN_HELPDEMOS_NATIVE,
+												HelpOps::GetState,
+												HID_HELP_DEMOS,
+												_R(IDBBL_HELPDEMOSOP),
+												0 );
+
+	ERRORIF(!DemosNativeOp, _R(IDE_NOMORE_MEMORY), FALSE);
+
 	//Webster_Ranbir_12	\96
 #ifdef INC_WEB_MENU_ITEMS
 
Index: Trunk/XaraLX/wxOil/menucmds.cpp
===================================================================
--- Trunk/XaraLX/wxOil/menucmds.cpp	(revision 1315)
+++ Trunk/XaraLX/wxOil/menucmds.cpp	(revision 1316)
@@ -873,6 +873,81 @@
 	HelpUsingGalleries();
 }
 
+enum
+{
+	wxID_MEDIACTRL
+};
+
+class CReplayWnd : public wxDialog
+{
+private:
+	wxMediaCtrl*	m_pMediaCtrl;
+
+public:
+	CReplayWnd( wxWindow *pWnd ) : wxDialog( pWnd, wxID_ANY, _T("Movie Replay") )
+	{
+		m_pMediaCtrl = new wxMediaCtrl;
+
+		m_pMediaCtrl->Create(this, wxID_MEDIACTRL, wxEmptyString,
+                                    wxDefaultPosition, wxDefaultSize, 0 );
+		wxSizer*	pSizer	= new wxBoxSizer( wxHORIZONTAL );
+		pSizer->Add( m_pMediaCtrl );
+
+		SetSizer( pSizer );
+	}
+	virtual ~CReplayWnd()
+	{
+		TRACEUSER( "luke", _T("Destruct CRW
") );
+	}
+
+	void Load( const wxString& str )
+	{
+		TRACEUSER( "luke", _T("Load Video
") );
+		m_pMediaCtrl->Load( str );
+	}
+
+	void OnClose( wxCloseEvent& event );
+	void OnCreate( wxWindowCreateEvent& event );
+	void OnDestroy( wxWindowDestroyEvent& event );
+
+	void OnLoaded( wxMediaEvent& event );
+
+	DECLARE_CLASS( CReplayWnd )
+	DECLARE_EVENT_TABLE();
+};
+
+IMPLEMENT_CLASS( CReplayWnd, wxDialog )
+BEGIN_EVENT_TABLE( CReplayWnd, wxDialog )
+	EVT_CLOSE(			CReplayWnd::OnClose )
+	EVT_WINDOW_DESTROY( CReplayWnd::OnDestroy )
+	EVT_WINDOW_CREATE(	CReplayWnd::OnCreate )
+
+	EVT_MEDIA_LOADED(	wxID_MEDIACTRL, CReplayWnd::OnLoaded )
+END_EVENT_TABLE()
+
+void CReplayWnd::OnCreate( wxWindowCreateEvent& )
+{
+	TRACEUSER( "luke", _T("Create video
") );
+}
+
+void CReplayWnd::OnDestroy( wxWindowDestroyEvent& )
+{
+	TRACEUSER( "luke", _T("Destroy video
") );
+	m_pMediaCtrl->Stop();
+}
+
+void CReplayWnd::OnClose( wxCloseEvent& )
+{
+	TRACEUSER( "luke", _T("Close video
") );
+	m_pMediaCtrl->Stop();
+}
+
+void CReplayWnd::OnLoaded( wxMediaEvent& )
+{
+	TRACEUSER( "luke", _T("Play Video
") );
+	m_pMediaCtrl->Play();
+}
+
 static void StartMovie( const wxString &strFile )
 {
 	wxString			strDataPath( br_find_data_dir( "/usr/share" ), wxConvUTF8 );
@@ -893,7 +968,7 @@
 	if( 255 == lResult )
 	{
 		strCommand = strDataPath + _T("/xaralx/bin/mplayer -slave \"");
-		strCommand += strVideoPath + strVideoPath + _T("/") + strFile + _T("\"");
+		strCommand += strVideoPath + _T("/") + strFile + _T("\"");
 
 		lResult = wxExecute( strCommand, wxEXEC_SYNC, NULL );
 		if( 255 == lResult )
@@ -901,23 +976,42 @@
 	}
 }
 
+static void StartMovieNative( const wxString &strFile )
+{
+	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
+		strDataPath = _T("/usr/share");
+#endif
+	}
+
+	wxString			strVideoPath( strDataPath );
+	strVideoPath += _("/xaralx/video");
+	
+	CReplayWnd*		pWnd	= new CReplayWnd( CCamFrame::GetMainFrame() );
+	pWnd->Load( strVideoPath + _T("/") + strFile );
+}
+
+
 void HelpDemosAction()
 {
-#if 1
 	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 );
-	wxMediaCtrl*	pMedia	= new wxMediaCtrl( pWnd, wxID_ANY, _T("AbsBegin.ogm") );
-	pSizer->Add( pMedia );
-	pMedia->Play();
-	pWnd->SetSizer( pSizer );
-#endif
+
 //	HelpOnlineDemos();
 }
 
 
+void HelpDemosNativeAction()
+{
+	StartMovieNative( _T("Part_1_master_inc_audio_smaller_q35_fr15_hi.ogm") );
 
+//	HelpOnlineDemos();
+}
+
+
+
 void HelpTechSupportAction()
 {
 	HelpTechnicalSupport();
Index: Trunk/XaraLX/wxOil/xrc/EN/ollie-strings.xrc
===================================================================
--- Trunk/XaraLX/wxOil/xrc/EN/ollie-strings.xrc	(revision 1315)
+++ Trunk/XaraLX/wxOil/xrc/EN/ollie-strings.xrc	(revision 1316)
@@ -37,11 +37,17 @@
 			<object class="sizeritem">
 				<flag>wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE</flag>
 				<object class="wxStaticText" name="IDS_HELP_MOVIES">
-					<label>Movies;Show a list of movies you can watch</label>
+					<label>Movies test 1 (mplayer);Show a list of movies you can watch</label>
 				</object>
 			</object>
 			<object class="sizeritem">
 				<flag>wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE</flag>
+				<object class="wxStaticText" name="IDS_HELP_MOVIES_NATIVE">
+					<label>Movies test 2 (wxMediaCtrl);Show a list of movies you can watch</label>
+				</object>
+			</object>
+			<object class="sizeritem">
+				<flag>wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE</flag>
 				<object class="wxStaticText" name="IDS_HELP_TOPICS">
 					<label>Xara Xtreme &amp;Help...;Opens Xara Xtreme help</label>
 				</object>
Index: Trunk/XaraLX/wxOil/xrc/SHARED_MENU.res
===================================================================
--- Trunk/XaraLX/wxOil/xrc/SHARED_MENU.res	(revision 1315)
+++ Trunk/XaraLX/wxOil/xrc/SHARED_MENU.res	(revision 1316)
@@ -173,6 +173,7 @@
 		END
 		
 		MENUITEM "HelpDemos"
+		MENUITEM "HelpDemosNative"
 		MENUITEM "TipsDlg"			SEPARATOR
 		MENUITEM "Update"				SEPARATOR
 		MENUITEM "Register"			SEPARATOR
Index: Trunk/XaraLX/wxOil/menucmds.h
===================================================================
--- Trunk/XaraLX/wxOil/menucmds.h	(revision 1315)
+++ Trunk/XaraLX/wxOil/menucmds.h	(revision 1316)
@@ -157,6 +157,7 @@
 void HelpToolsAction();
 void HelpGalleriesAction();
 void HelpDemosAction();
+void HelpDemosNativeAction();
 void HelpTechSupportAction();
 void HelpXaraPurchasePage();
 


Xara