www.pudn.com > WMACompressor.zip > WmaWriterProfile.h


// 
//  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY 
//  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 
//  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR 
//  PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER  
//  REMAINS UNCHANGED. 
// 
//  Email:  yetiicb@hotmail.com 
// 
//  Copyright (C) 2002-2004 Idael Cardoso.  
// 
#pragma once 
 
#pragma unmanaged 
#include "consts.h" 
#include "Profile.h" 
#include "ProfileManager.h" 
#pragma managed 
 
using namespace System; 
using namespace System::Runtime::InteropServices; 
using namespace System::Runtime::Serialization; 
 
 
 
namespace Yeti 
{ 
  namespace MMedia 
  { 
    namespace Wmf 
    { 
      [Serializable] 
      public __gc class WmaWriterProfile : public ISerializable 
      { 
      protected: 
        Guid m_Id; 
        String* m_Name; 
        String* m_ProfileData; 
        String* m_Desc; 
        void LoadProfile(Guid ID); 
        void LoadProfile(String* ProfileData); 
        WmaWriterProfile(SerializationInfo* info, StreamingContext context); 
      public: 
        WmaWriterProfile(); 
        WmaWriterProfile(Guid ID); 
        WmaWriterProfile(String* ProfileData); 
         
        virtual String* ToString() 
        { 
          return m_Name; 
        } 
 
        // ISerializable 
        virtual void GetObjectData(SerializationInfo* info, StreamingContext context); 
 
        __property String* get_Name() 
        { 
          return m_Name; 
        } 
        __property Guid get_Id() 
        { 
          return m_Id; 
        } 
        __property String* get_Description() 
        { 
          return m_Desc; 
        } 
        __property String* get_ProfileData() 
        { 
          return m_ProfileData; 
        } 
        __property CProfile* get_pProfile(); 
      }; 
 
      __gc __sealed class ProfileManager : public IDisposable 
      { 
      private: 
        CProfileManager* m_pProfileManager; 
      public: 
        ProfileManager(); 
 
        virtual ~ProfileManager() 
        { 
          Dispose(false); 
        } 
        __property CProfileManager* get_pProfileMager() 
        { 
          return m_pProfileManager; 
        } 
 
        void Dispose(void) 
        { 
          Dispose(true); 
        } 
      protected: 
 
        void Dispose(bool disposing) 
        { 
          if ( m_pProfileManager != NULL ) 
          { 
            delete m_pProfileManager; 
            m_pProfileManager = NULL; 
            if ( disposing ) 
            { 
              GC::SuppressFinalize(this); 
            } 
          } 
        } 
      }; 
 
      public __gc __sealed class WmaWriterProfileManager 
      { 
      private: 
        static WmaWriterProfile* g_AudioSystemProfiles[]; 
        static ProfileManager* g_ProfileManager; 
        WmaWriterProfileManager() 
        { 
        } 
      public: 
         
        static WmaWriterProfileManager() 
        { 
          g_ProfileManager = new ProfileManager(); 
          g_AudioSystemProfiles = new WmaWriterProfile* [AudioSystemProfilesCount]; 
          for (int i = 0; i < g_AudioSystemProfiles->Length; i++) 
          { 
            IntPtr pid = (int)AudioSystemProfilesIDs[i]; 
            Guid* id = __try_cast(Marshal::PtrToStructure(pid, __typeof(Guid))); 
            g_AudioSystemProfiles[i] = new WmaWriterProfile(*id); 
          } 
        } 
 
        __property static WmaWriterProfile* get_AudioSystemProfiles()[] 
        { 
          return g_AudioSystemProfiles; 
        } 
        __property static Object* get_gProfileManager() 
        { 
          return g_ProfileManager; 
        } 
        // Get the name of the WM profile specified by ID 
        static String* GetProfileName(Guid ID); 
      }; 
    } 
  } 
}