[xiph-commits] r7308 - in trunk/oggdsf: sln/oggdsf_all

illiminable at dactyl.lonelymoon.com illiminable
Sat Jul 24 01:51:42 PDT 2004


src/lib/core/ogg/libVorbisComment
src/lib/core/ogg/libVorbisCommentDotNET
Message-ID: <20040724085142.89BEE9AAAB at dactyl.lonelymoon.com>

Author: illiminable
Date: Sat Jul 24 01:51:42 2004
New Revision: 7308

Modified:
trunk/oggdsf/sln/oggdsf_all/oggdsf_all.sln
trunk/oggdsf/src/lib/core/ogg/libVorbisComment/libVorbisComment.h
trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/FileComments.cpp
trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/FileComments.h
trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/SingleVorbisComment.cpp
trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/SingleVorbisComment.h
trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/Stdafx.h
trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/StreamCommentInfo.cpp
trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/StreamCommentInfo.h
trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/VorbisComments.cpp
trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/VorbisComments.h
trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/libVorbisCommentDotNET.vcproj
Log:
* .NET wrappers for vorbis comment library pretty much done.

Modified: trunk/oggdsf/sln/oggdsf_all/oggdsf_all.sln
===================================================================
--- trunk/oggdsf/sln/oggdsf_all/oggdsf_all.sln	2004-07-24 07:43:21 UTC (rev 7307)
+++ trunk/oggdsf/sln/oggdsf_all/oggdsf_all.sln	2004-07-24 08:51:40 UTC (rev 7308)
@@ -1043,6 +1043,9 @@
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libVorbisCommentDotNET", "..\..\src\lib\core\ogg\libVorbisCommentDotNET\libVorbisCommentDotNET.vcproj", "{9599D980-84D8-4470-B7E2-1F7B52C781E7}"
ProjectSection(ProjectDependencies) = postProject
+		{223ACC19-608E-4E1B-A054-067F0CACB272} = {223ACC19-608E-4E1B-A054-067F0CACB272}
+		{FCFE729D-EADE-45BA-9506-7E82A46403F7} = {FCFE729D-EADE-45BA-9506-7E82A46403F7}
+		{DC4D86E2-72C1-4995-8FB1-0F08655E620A} = {DC4D86E2-72C1-4995-8FB1-0F08655E620A}
EndProjectSection
EndProject
Global

Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisComment/libVorbisComment.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisComment/libVorbisComment.h	2004-07-24 07:43:21 UTC (rev 7307)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisComment/libVorbisComment.h	2004-07-24 08:51:40 UTC (rev 7308)
@@ -40,3 +40,4 @@
#else
#define LIBVORBISCOMMENT_API __declspec(dllimport)
#endif
+

Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/FileComments.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/FileComments.cpp	2004-07-24 07:43:21 UTC (rev 7307)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/FileComments.cpp	2004-07-24 08:51:40 UTC (rev 7308)
@@ -9,13 +9,43 @@

FileComments::FileComments(void)
{
+	mNativeClass = new ::FileComments;
}

FileComments::~FileComments(void)
{
+	delete mNativeClass;
}



+bool FileComments::loadFile(String* inFileName) {
+	char* locCS = Wrappers::netStrToCStr(inFileName);
+	bool locRet = mNativeClass->loadFile(locCS);
+	Wrappers::releaseCStr(locCS);
+	return locRet;
+}
+String* FileComments::fileName() {
+	return Wrappers::CStrToNetStr(mNativeClass->fileName().c_str());
+}

+bool FileComments::writeOutAll() {
+	return mNativeClass->writeOutAll();
+}
+bool FileComments::writeOutStream(Int64 inIndex) {
+	return mNativeClass->writeOutStream(inIndex);
+}
+
+//bool FileComments::addStreamComment(StreamCommentInfo* inStreamComment) {
+//
+//}
+StreamCommentInfo* FileComments::getStreamComment(Int64 inIndex) {
+	return new StreamCommentInfo(mNativeClass->getStreamComment(inIndex));
+}
+
+Int64 FileComments::streamCount() {
+	return mNativeClass->streamCount();
+}
+
+
}}}
\ No newline at end of file

Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/FileComments.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/FileComments.h	2004-07-24 07:43:21 UTC (rev 7307)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/FileComments.h	2004-07-24 08:51:40 UTC (rev 7308)
@@ -1,3 +1,11 @@
+#pragma once
+#pragma unmanaged
+#include "dllstuff.h"
+#include "libVorbisComment/FileComments.h"
+
+#pragma managed
+using namespace System;
+using namespace illiminable::libiWrapper;
namespace illiminable {
namespace Ogg {
namespace libVorbisCommentDotNET {
@@ -3,9 +11,56 @@


+//class LIBVORBISCOMMENT_API FileComments
+//	:	public IOggCallback
+//{
+//public:
+//	FileComments(void);
+//	~FileComments(void);
+//
+//
+//
+//	bool loadFile(string inFileName);
+//	string fileName();
+//
+//	bool writeOutAll();
+//	bool writeOutStream(unsigned long inIndex);
+//
+//	bool addStreamComment(StreamCommentInfo* inStreamComment);
+//	StreamCommentInfo* getStreamComment(unsigned long inIndex);
+//
+//	unsigned long streamCount();
+//
+//	//IOggCallback implementation
+//	virtual bool acceptOggPage(OggPage* inOggPage);
+//protected:
+//	vector<StreamCommentInfo*> mStreams;
+//	string mFileName;
+//	unsigned long mMinorStreamCount;
+//	__int64 mBytePos;
+//};
+
+
+
+
public __gc class FileComments
{
public:
FileComments(void);
~FileComments(void);
+
+
+	bool loadFile(String* inFileName);
+	String* fileName();
+
+	bool writeOutAll();
+	bool writeOutStream(Int64 inIndex);
+
+	bool addStreamComment(StreamCommentInfo* inStreamComment);
+	StreamCommentInfo* getStreamComment(Int64 inIndex);
+
+	Int64 streamCount();
+
+protected:
+	::FileComments* mNativeClass;
};


Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/SingleVorbisComment.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/SingleVorbisComment.cpp	2004-07-24 07:43:21 UTC (rev 7307)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/SingleVorbisComment.cpp	2004-07-24 08:51:40 UTC (rev 7308)
@@ -6,12 +6,50 @@
namespace Ogg {
namespace libVorbisCommentDotNET {
SingleVorbisComment::SingleVorbisComment(void)
+	:	mNativeClass(NULL)
{
+	mNativeClass = new ::SingleVorbisComment;
}

SingleVorbisComment::~SingleVorbisComment(void)
{
+	delete mNativeClass;
}


-		}}}
\ No newline at end of file
+
+String* SingleVorbisComment::key() {
+	return Wrappers::CStrToNetStr(mNativeClass->key().c_str());
+}
+bool SingleVorbisComment::setKey(String* inKey) {
+	char* locCS = Wrappers::netStrToCStr(inKey);
+	mNativeClass->setKey(locCS);
+	Wrappers::releaseCStr(locCS);
+	return true;
+}
+
+String* SingleVorbisComment::value() {
+	return Wrappers::CStrToNetStr(mNativeClass->value().c_str());
+}
+bool SingleVorbisComment::setValue(String* inValue) {
+	char* locCS = Wrappers::netStrToCStr(inValue);
+	mNativeClass->setValue(locCS);
+	Wrappers::releaseCStr(locCS);
+	return true;
+}
+
+String* SingleVorbisComment::toString() {
+	return Wrappers::CStrToNetStr(mNativeClass->toString().c_str());
+}
+
+Int64 SingleVorbisComment::length() {
+	Int64 locLength = mNativeClass->length();
+	return locLength;
+}
+
+
+
+
+
+
+}}}
\ No newline at end of file

Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/SingleVorbisComment.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/SingleVorbisComment.h	2004-07-24 07:43:21 UTC (rev 7307)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/SingleVorbisComment.h	2004-07-24 08:51:40 UTC (rev 7308)
@@ -1,14 +1,63 @@
#pragma once

+#pragma unmanaged
+//The directory is necessary to avoid recursive inclusion. native and DN class have same names.
+#include "libVorbisComment/SingleVorbisComment.h"

+#pragma managed
+
+using namespace illiminable::libiWrapper;
+using namespace System;
+
namespace illiminable {
namespace Ogg {
namespace libVorbisCommentDotNET {
+
+//NATIVE CLASS
+//class LIBVORBISCOMMENT_API SingleVorbisComment
+//{
+//public:
+//	SingleVorbisComment(void);
+//	~SingleVorbisComment(void);
+//
+//	string key();
+//	bool setKey(string inKey);
+//
+//	string value();
+//	bool setValue(string inValue);
+//
+//	string toString();
+//
+//	unsigned long length();
+//
+//	bool parseComment(string inCommentString);
+//
+//protected:
+//	string mKey;
+//	string mValue;
+//};
+
+
public __gc class SingleVorbisComment
{
public:
SingleVorbisComment(void);
~SingleVorbisComment(void);
+
+	String* key();
+	bool setKey(String* inKey);
+
+	String* value();
+	bool setValue(String* inValue);
+
+	String* toString();
+
+	Int64 length();
+
+protected:
+
+	::SingleVorbisComment* mNativeClass;
+	//bool parseComment(String inCommentString);
};



Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/Stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/Stdafx.h	2004-07-24 07:43:21 UTC (rev 7307)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/Stdafx.h	2004-07-24 08:51:40 UTC (rev 7308)
@@ -4,3 +4,4 @@

#pragma once

+#using "libiWrapper.dll"
\ No newline at end of file

Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/StreamCommentInfo.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/StreamCommentInfo.cpp	2004-07-24 07:43:21 UTC (rev 7307)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/StreamCommentInfo.cpp	2004-07-24 08:51:40 UTC (rev 7308)
@@ -10,11 +10,59 @@

StreamCommentInfo::StreamCommentInfo(void)
{
+	mNativeClass = new ::StreamCommentInfo;
}

StreamCommentInfo::~StreamCommentInfo(void)
{
+	delete mNativeClass;
}


+
+
+VorbisComments* StreamCommentInfo::comments() {
+	return new VorbisComments(mNativeClass->comments());
+}
+	//void setComments(VorbisComments* inComments);
+
+Int64 StreamCommentInfo::pageStart() {
+	Int64 locNum = mNativeClass->pageStart();
+	return locNum;
+}
+void StreamCommentInfo::setPageStart(Int64 inPageStart) {
+	mNativeClass->setPageStart(inPageStart);
+}
+
+Int32 StreamCommentInfo::codecID() {
+	Int32 locNum = mNativeClass->codecID();
+	return locNum;
+}
+void StreamCommentInfo::setCodecID(Int32 inCodecID) {
+	mNativeClass->setCodecID(inCodecID);
+}
+
+bool StreamCommentInfo::isDirty() {
+	return mNativeClass->isDirty();
+}
+void StreamCommentInfo::setIsDirty(bool inIsDirty) {
+	mNativeClass->setIsDirty(inIsDirty);
+}
+
+Int64 StreamCommentInfo::majorStreamNo() {
+	Int64 locNum = mNativeClass->majorStreamNo();
+	return locNum;
+}
+void StreamCommentInfo::setMajorStreamNo(Int64 inMajorStreamNo) {
+	mNativeClass->setMajorStreamNo(inMajorStreamNo);
+}
+
+Int64 StreamCommentInfo::minorStreamNo() {
+	Int64 locNum = mNativeClass->minorStreamNo();
+	return locNum;
+}
+void StreamCommentInfo::setMinorStreamNo(Int64 inMinorStreamNo) {
+	mNativeClass->setMinorStreamNo(inMinorStreamNo);
+}
+
}}}
\ No newline at end of file

Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/StreamCommentInfo.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/StreamCommentInfo.h	2004-07-24 07:43:21 UTC (rev 7307)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/StreamCommentInfo.h	2004-07-24 08:51:40 UTC (rev 7308)
@@ -1,11 +1,96 @@
+#pragma once
+
+#pragma unmanaged
+#include "dllstuff.h"
+#include "libVorbisComment/VorbisComments.h"
+#include "libVorbisComment/StreamCommentInfo.h"
+
+#pragma managed
+using namespace System;
+using namespace illiminable::libiWrapper;
namespace illiminable {
namespace Ogg {
namespace libVorbisCommentDotNET {
+
+//NATIVE CLASS
+//class LIBVORBISCOMMENT_API StreamCommentInfo
+//{
+//public:
+//	StreamCommentInfo(void);
+//	~StreamCommentInfo(void);
+//
+//	enum eCodecIDs {
+//		NO_CODEC = 0,
+//		VORBIS = 1,
+//		THEORA = 2
+//
+//	};
+//	VorbisComments* comments();
+//	void setComments(VorbisComments* inComments);
+//
+//	__int64 pageStart();
+//	void setPageStart(__int64 inPageStart);
+//
+//	unsigned short codecID();
+//	void setCodecID(unsigned short inCodecID);
+//
+//	bool isDirty();
+//	void setIsDirty(bool inIsDirty);
+//
+//	unsigned long majorStreamNo();
+//	void setMajorStreamNo(unsigned long inMajorStreamNo);
+//
+//	unsigned long minorStreamNo();
+//	void setMinorStreamNo(unsigned long inMinorStreamNo);
+//
+//protected:
+//	VorbisComments* mComments;
+//	__int64 mPageStart;
+//	unsigned short mCodecID;
+//
+//	bool mIsDirty;
+//
+//	unsigned long mMajorStreamNo;
+//	unsigned long mMinorStreamNo;
+//};
+
+
+
+
+
+
public __gc class StreamCommentInfo
{
public:
StreamCommentInfo(void);
~StreamCommentInfo(void);
+
+
+
+	/*const Int32	NO_CODEC = 0;
+	const Int32 VORBIS = 1;
+	const Int32 THEORA = 2;*/
+
+	VorbisComments* comments();
+	//void setComments(VorbisComments* inComments);
+
+	Int64 pageStart();
+	void setPageStart(Int64 inPageStart);
+
+	Int32 codecID();
+	void setCodecID(Int32 inCodecID);
+
+	bool isDirty();
+	void setIsDirty(bool inIsDirty);
+
+	Int64 majorStreamNo();
+	void setMajorStreamNo(Int64 inMajorStreamNo);
+
+	Int64 minorStreamNo();
+	void setMinorStreamNo(Int64 inMinorStreamNo);
+
+protected:
+	::StreamCommentInfo* mNativeClass;
};



Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/VorbisComments.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/VorbisComments.cpp	2004-07-24 07:43:21 UTC (rev 7307)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/VorbisComments.cpp	2004-07-24 08:51:40 UTC (rev 7308)
@@ -7,12 +7,62 @@
namespace Ogg {
namespace libVorbisCommentDotNET {
VorbisComments::VorbisComments(void)
+	:	mNativeClass(NULL)
{
+	mNativeClass = new ::VorbisComments;
}

VorbisComments::~VorbisComments(void)
{
+	delete mNativeClass;
}


+
+String* VorbisComments::vendorString() {
+	return Wrappers::CStrToNetStr(mNativeClass->vendorString().c_str());
+}
+bool VorbisComments::setVendorString(String* inVendorString) {
+	char* locCS = Wrappers::netStrToCStr(inVendorString);
+	mNativeClass->setVendorString(locCS);
+	Wrappers::releaseCStr(locCS);
+	return true;
+}
+
+Int64 VorbisComments::numUserComments() {
+	Int64 locNum = mNativeClass->numUserComments();
+	return locNum;
+}
+SingleVorbisComment* VorbisComments::getUserComment(Int64 inIndex) {
+	unsigned long locIndex = inIndex;
+
+	//FIX::: Need to clone this... or bad things will happen when garbage colelcted.
+	return new SingleVorbisComment(mNativeClass->getUserComment(locIndex));
+}
+
+	//vector<SingleVorbisComment> getCommentsByKey(String* inKey);
+
+//bool VorbisComments::addComment(SingleVorbisComment* inComment) {
+//
+//}
+bool VorbisComments::addComment(String* inKey, String* inValue) {
+	char* locCS1 = Wrappers::netStrToCStr(inKey);
+	char* locCS2 = Wrappers::netStrToCStr(inValue);
+	mNativeClass->addComment(locCS1, locCS2);
+	Wrappers::releaseCStr(locCS1);
+	Wrappers::releaseCStr(locCS2);
+	return true;
+}
+
+	//bool parseOggPacket(OggPacket* inPacket, unsigned long inStartOffset);
+	//OggPacket* toOggPacket();
+String* VorbisComments::toString() {
+	return Wrappers::CStrToNetStr(mNativeClass->toString().c_str());
+}
+
+Int64 VorbisComments::size() {
+	Int64 locNum = mNativeClass->size();
+	return locNum;
+}
+
}}}
\ No newline at end of file

Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/VorbisComments.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/VorbisComments.h	2004-07-24 07:43:21 UTC (rev 7307)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/VorbisComments.h	2004-07-24 08:51:40 UTC (rev 7308)
@@ -1,13 +1,71 @@
#pragma once
+#pragma unmanaged
+#include "dllstuff.h"
+#include "libVorbisComment/VorbisComments.h"

+#pragma managed
+using namespace System;
+using namespace illiminable::libiWrapper;
namespace illiminable {
namespace Ogg {
namespace libVorbisCommentDotNET {
+
+//NATIVE CLASS
+//class LIBVORBISCOMMENT_API VorbisComments
+//{
+//public:
+//	VorbisComments(void);
+//	~VorbisComments(void);
+//
+//	string vendorString();
+//	bool setVendorString(string inVendorString);
+//
+//	unsigned long numUserComments();
+//	SingleVorbisComment getUserComment(unsigned long inIndex);
+//
+//	vector<SingleVorbisComment> getCommentsByKey(string inKey);
+//
+//	bool addComment(SingleVorbisComment inComment);
+//	bool addComment(string inKey, string inValue);
+//
+//	bool parseOggPacket(OggPacket* inPacket, unsigned long inStartOffset);
+//	OggPacket* toOggPacket();
+//	string toString();
+//
+//	unsigned long size();
+//protected:
+//	string mVendorString;
+//	vector<SingleVorbisComment> mCommentList;
+//};
+
+
+
+
public __gc class VorbisComments
{
public:
VorbisComments(void);
~VorbisComments(void);
+
+	String* vendorString();
+	bool setVendorString(String* inVendorString);
+
+	Int64 numUserComments();
+	SingleVorbisComment* getUserComment(Int64 inIndex);
+
+	//vector<SingleVorbisComment> getCommentsByKey(String* inKey);
+
+	bool addComment(SingleVorbisComment* inComment);
+	bool addComment(String* inKey, String* inValue);
+
+	//bool parseOggPacket(OggPacket* inPacket, unsigned long inStartOffset);
+	//OggPacket* toOggPacket();
+	String* toString();
+
+	Int64 size();
+
+protected:
+	::VorbisComments* mNativeClass;
};



Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/libVorbisCommentDotNET.vcproj
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/libVorbisCommentDotNET.vcproj	2004-07-24 07:43:21 UTC (rev 7307)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/libVorbisCommentDotNET.vcproj	2004-07-24 08:51:40 UTC (rev 7308)
@@ -22,13 +22,16 @@
Name="VCCLCompilerTool"
AdditionalOptions="/Zl"
Optimization="0"
+				AdditionalIncludeDirectories="..;..\libOOOgg"
+				AdditionalUsingDirectories="..\..\..\helper\libiWrapper\Debug"
PreprocessorDefinitions="WIN32;_DEBUG"
MinimalRebuild="FALSE"
BasicRuntimeChecks="0"
-				RuntimeLibrary="1"
+				RuntimeLibrary="3"
UsePrecompiledHeader="3"
WarningLevel="3"
-				DebugInformationFormat="3"/>
+				DebugInformationFormat="3"
+				CallingConvention="2"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool



More information about the commits mailing list