[xiph-commits] r8079 - trunk/oggdsf/src/lib/plugin/axAnxOggPlayer

illiminable at motherfish-iii.xiph.org illiminable at motherfish-iii.xiph.org
Sun Oct 24 01:25:04 PDT 2004


Author: illiminable
Date: 2004-10-24 01:25:04 -0700 (Sun, 24 Oct 2004)
New Revision: 8079

Added:
   trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/IMediaEventNotification.cpp
   trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/IMediaEventNotification.h
Modified:
   trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/DSPlayer.cpp
   trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/DSPlayer.h
   trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayer.vcproj
Log:
* All the managed code is converted to unmanaged.

Modified: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/DSPlayer.cpp
===================================================================
--- trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/DSPlayer.cpp	2004-10-24 07:56:05 UTC (rev 8078)
+++ trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/DSPlayer.cpp	2004-10-24 08:25:04 UTC (rev 8079)
@@ -62,11 +62,11 @@
 			while (locHR = mMediaEvent->GetEvent(&locEventCode, &locParam1, &locParam2, 0), SUCCEEDED(locHR)) 
 			{
 	            
-				//cout<<"Event : "<<evCode<<" Params : "<<param1<<", "<<param2<<endl;
+				debugLog<<"Event : "<<locEventCode<<" Params : "<<locParam1<<", "<<locParam2<<endl;
 				
-				//FIX::: MANAGED CODE
-				if (mDNMediaEvent != NULL) {
-					mDNMediaEvent->eventNotification(locEventCode, locParam1, locParam2);
+				
+				if (mMediaEventNotify != NULL) {
+					mMediaEventNotify->eventNotification(locEventCode, locParam1, locParam2);
 				}
 
 				mMediaEvent->FreeEventParams(locEventCode, locParam1, locParam2);
@@ -78,8 +78,8 @@
 
 DSPlayer::~DSPlayer(void) {
 	debugLog<<"Killing DSPlayer"<<endl;
-	debugLog->close();
-	delete debugLog;
+	debugLog.close();
+	
 	releaseInterfaces();
 	CoUninitialize();
 }
@@ -141,14 +141,13 @@
 
 	releaseInterfaces();
 	HRESULT locHR = S_OK;
-	//FIX::: MANAGED CODE
-	char* locFileName = Wrappers::netStrToCStr(inFileName);
-	debugLog<<"File = "<<locFileName<<endl;
-	wstring locWFileName = illiminable::libDSPlayDotNET::toWStr(locFileName);
+
 	
-	Wrappers::releaseCStr(locFileName);
-	locFileName = NULL;
-	//
+	debugLog<<"File = "<<inFileName<<endl;
+	wstring locWFileName = StringHelper::toWStr(inFileName);
+	
+	
+	
 
 	//Have to use a local pointer or taking the adress of a member function makes the second level
 	// of indirection a __gc pointer.
@@ -211,12 +210,12 @@
 
 		if (locCMMLFilter != NULL) {
 			ICMMLAppControl* locCMMLAppControl = NULL;
-			//FIX::: MANAGED CODE
+			
 			locHR = locCMMLFilter->QueryInterface(X_IID_ICMMLAppControl, (void**)&locCMMLAppControl);
 			if (locCMMLAppControl != NULL) {
 				mCMMLAppControl = locCMMLAppControl;
-				//FIX::: MANAGED CODE
-				mCMMLAppControl->setCallbacks(mCMMLProxy);
+				
+				mCMMLAppControl->setCallbacks(mCMMLCallback);
 			}
 			numRef = 
                 locCMMLFilter->Release();
@@ -354,22 +353,23 @@
 
 bool DSPlayer::isFileAnnodex(string inFilename)
 {
-	//FIX::: MANAGED CODE
-	String* locExt = (inFilename->Substring(inFilename->Length - 4, 4))->ToUpper();
-	if (locExt->Equals(".ANX")) {
+	//BUG::: Case sensitive
+	string locExt = inFilename.substr(inFilename.size() - 4, 4);
+	
+	if (locExt == ".anx") {
 		return true;
 	} else {
 		return false;
 	}
 }
 
-//bool DSPlayer::setMediaEventCallback(IDNMediaEvent* inMediaEventCallback) {
-//	mDNMediaEvent = inMediaEventCallback;
-//	return true;
-//}
-//IDNMediaEvent* DSPlayer::getMediaEventCallback() {
-//	return mDNMediaEvent;
-//}
+bool DSPlayer::setMediaEventCallback(IMediaEventNotification* inMediaEventCallback) {
+	mMediaEventNotify = inMediaEventCallback;
+	return true;
+}
+IMediaEventNotification* DSPlayer::getMediaEventCallback() {
+	return mMediaEventNotify;
+}
 
 
 

Modified: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/DSPlayer.h
===================================================================
--- trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/DSPlayer.h	2004-10-24 07:56:05 UTC (rev 8078)
+++ trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/DSPlayer.h	2004-10-24 08:25:04 UTC (rev 8079)
@@ -11,6 +11,8 @@
 #include "ICMMLCallbacks.h"
 #include "ICMMLAppControl.h"
 #include "libCMMLTags.h"
+#include "IMediaEventNotification.h"
+#include "StringHelper.h"
 
 
 
@@ -20,11 +22,17 @@
 
 
 using namespace std;
+
+// {6188AD0C-62CB-4658-A14E-CD23CF84EC31}
+DEFINE_GUID(X_IID_ICMMLAppControl, 
+0x6188ad0c, 0x62cb, 0x4658, 0xa1, 0x4e, 0xcd, 0x23, 0xcf, 0x84, 0xec, 0x31);
 class DSPlayer
 {
 public:
+	
 	DSPlayer(void);
 	~DSPlayer(void);
+	//static const GUID X_IID_ICMMLAppControl = {0x6188ad0c, 0x62cb, 0x4658, {0xa1, 0x4e, 0xcd, 0x23, 0xcf, 0x84, 0xec, 0x31};
 
 		bool loadFile(string inFileName);
 		bool play();
@@ -39,8 +47,8 @@
 		__int64 fileDuration();
 	
 
-		//bool setMediaEventCallback(IDNMediaEvent* inMediaEventCallback);
-		//IDNMediaEvent* getMediaEventCallback();
+		bool setMediaEventCallback(IMediaEventNotification* inMediaEventCallback);
+		IMediaEventNotification* getMediaEventCallback();
 
 		//bool setCMMLCallbacks(IDNCMMLCallbacks* inCMMLCallbacks);
 		bool checkEvents();
@@ -53,6 +61,8 @@
 		IMediaSeeking* mMediaSeeking;
 		IMediaEvent* mMediaEvent;
 		ICMMLAppControl* mCMMLAppControl;
+		ICMMLCallbacks* mCMMLCallback;
+		IMediaEventNotification* mMediaEventNotify;
 
 		HANDLE mEventHandle;
 

Added: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/IMediaEventNotification.cpp
===================================================================
--- trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/IMediaEventNotification.cpp	2004-10-24 07:56:05 UTC (rev 8078)
+++ trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/IMediaEventNotification.cpp	2004-10-24 08:25:04 UTC (rev 8079)
@@ -0,0 +1,10 @@
+#include "StdAfx.h"
+#include ".\imediaeventnotification.h"
+
+IMediaEventNotification::IMediaEventNotification(void)
+{
+}
+
+IMediaEventNotification::~IMediaEventNotification(void)
+{
+}

Added: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/IMediaEventNotification.h
===================================================================
--- trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/IMediaEventNotification.h	2004-10-24 07:56:05 UTC (rev 8078)
+++ trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/IMediaEventNotification.h	2004-10-24 08:25:04 UTC (rev 8079)
@@ -0,0 +1,10 @@
+#pragma once
+
+class IMediaEventNotification
+{
+public:
+	IMediaEventNotification(void);
+	virtual ~IMediaEventNotification(void);
+
+	virtual bool eventNotification(int inEventCode, int inParam1, int inParam2) = 0;
+};

Modified: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayer.vcproj
===================================================================
--- trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayer.vcproj	2004-10-24 07:56:05 UTC (rev 8078)
+++ trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayer.vcproj	2004-10-24 08:25:04 UTC (rev 8079)
@@ -20,7 +20,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\..\codecs\cmml\dsfCMMLDecoder;..\..\codecs\cmml\libCMMLTags;C:\DXSDK\Include"
+				AdditionalIncludeDirectories="..\..\codecs\cmml\dsfCMMLDecoder;..\..\codecs\cmml\libCMMLTags;C:\DXSDK\Include;..\..\helper\libilliCore"
 				PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_USRDLL"
 				MinimalRebuild="TRUE"
 				BasicRuntimeChecks="3"
@@ -80,7 +80,7 @@
 			CharacterSet="2">
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="..\..\codecs\cmml\dsfCMMLDecoder;..\..\codecs\cmml\libCMMLTags;C:\DXSDK\Include"
+				AdditionalIncludeDirectories="..\..\codecs\cmml\dsfCMMLDecoder;..\..\codecs\cmml\libCMMLTags;C:\DXSDK\Include;..\..\helper\libilliCore"
 				PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;_USRDLL"
 				RuntimeLibrary="2"
 				TreatWChar_tAsBuiltInType="TRUE"
@@ -161,6 +161,9 @@
 				RelativePath=".\DSPlayer.cpp">
 			</File>
 			<File
+				RelativePath=".\IMediaEventNotification.cpp">
+			</File>
+			<File
 				RelativePath=".\stdafx.cpp">
 				<FileConfiguration
 					Name="Debug|Win32">
@@ -196,6 +199,9 @@
 				RelativePath=".\DSPlayer.h">
 			</File>
 			<File
+				RelativePath=".\IMediaEventNotification.h">
+			</File>
+			<File
 				RelativePath=".\Resource.h">
 			</File>
 			<File



More information about the commits mailing list