/* mpg123clr: MPEG Audio Decoder library Common Language Runtime version. copyright 2009 by Malcolm Boczek - free software under the terms of the LGPL 2.1 mpg123clr.dll is a derivative work of libmpg123 - all original mpg123 licensing terms apply. All rights to this work freely assigned to the mpg123 project. */ /* libmpg123: MPEG Audio Decoder library copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1 see COPYING and AUTHORS files in distribution or http://mpg123.org */ /* 1.8.1.0 04-Aug-09 Initial release. */ #pragma once #pragma warning(disable : 4635) #include "mpg123.h" #pragma warning(default : 4635) #include "string.h" #include "text.h" #include #include #include using namespace std; using namespace System; using namespace System::Runtime::InteropServices; namespace mpg123clr { namespace id3 { // Recommended usage when creating reference type on the managed heap (not using stack semantics // for reference types...) [see Destructors and Finalizers in Visual C++] // // A ^ myA = gcnew A; // try // { // use myA // } // finally // { // delete myA; // } ///Wrapper for mpg123_id3v2. [StructLayout(LayoutKind::Sequential)] public ref struct mpg123id3v2 { private: mpg123_id3v2* sb; array^ __clrcall MakeTextList(mpg123_text* ptr, size_t count); protected: ///Finalizer. ///Does nothing - wrapper points to underlying memory, this class doesn't allocate memory. /// Implementation of CLR Finalize(). !mpg123id3v2(void); internal: ///Working Constructor. ///Maps to mpg123_id3v2 memory. /// mpg123id3v2(mpg123_id3v2* sb); public: ///Constructor. ///Only creates object for use as "out" target in ID3 constructor. /// mpg123id3v2(void); ///Destructor. Used for final object deletion. ///Calls finalizer for clean disposal of internal (unmanaged) library handles. /// /// Implementation of CLR Dispose(). /// ~Destructor and !Finalizer are the prescribed implementation of Dispose() and Finalize(). /// See Destructors and Finalizers in Visual C++ ~mpg123id3v2(void); ///Get the ID3v2 title text. ///Property returns the last encountered ID3v2 title text. /// ///The last encountered ID3v2 title text. property String^ title{String^ __clrcall get();} ///Get the ID3v2 artist text. ///Property returns the last encountered ID3v2 artist text. /// ///The last encountered ID3v2 artist text. property String^ artist{String^ __clrcall get();} ///Get the ID3v2 album text. ///Property returns the last encountered ID3v2 album text. /// ///The last encountered ID3v2 album text. property String^ album{String^ __clrcall get();} ///Get the ID3v2 comment text. ///Property returns the last encountered ID3v2 comment text. /// ///The last encountered ID3v2 comment text. property String^ comment{String^ __clrcall get();} ///Get the ID3v2 year text. ///Property returns the last encountered ID3v2 year text. /// ///The last encountered ID3v2 year text. property String^ year{String^ __clrcall get();} ///Get the ID3v2 genre text. ///Property returns the last encountered ID3v2 genre text. /// ///The last encountered ID3v2 genre text. property String^ genre{String^ __clrcall get();} ///Get the ID3v2 version. ///Property returns the ID3v2 version. /// ///The ID3v2 version. property int version{int __clrcall get();} ///Get an array of Comments. ///Property returns an array of Comments. /// ///An array of Comments. property array^ Comments{array^ __clrcall get();}; ///Get an array of ID3v2 text fields (including USLT). ///Property returns an array of ID3v2 text fields (including USLT). /// ///An array of ID3v2 text fields (including USLT). property array^ Texts{array^ __clrcall get();}; ///Get an array of extra (TXXX) fields. ///Property returns an array of extra (TXXX) fields. /// ///An array of extra (TXXX) fields. property array^ Extras{array^ __clrcall get();}; }; } }