Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

101 lines
3.9 KiB

  1. // Copyright (c) 1999 Microsoft Corporation
  2. // container.h : Declaration of the CContainer
  3. #ifndef __CONTAINER_H_
  4. #define __CONTAINER_H_
  5. #include "alist.h"
  6. #include "riff.h"
  7. #include "..\shared\dmusicp.h"
  8. class CContainer;
  9. class CContainerItem : public AListItem
  10. {
  11. public:
  12. CContainerItem(bool fEmbedded);
  13. ~CContainerItem();
  14. CContainerItem * GetNext() {return(CContainerItem *)AListItem::GetNext();};
  15. IDirectMusicObject *m_pObject;
  16. DWORD m_dwFlags;
  17. DMUS_OBJECTDESC m_Desc; // Stored description of object.
  18. bool m_fEmbedded; // This is an embedded (as opposed to referenced) object.
  19. WCHAR * m_pwszAlias;
  20. };
  21. class CContainerItemList : public AList
  22. {
  23. public:
  24. CContainerItem * GetHead() {return (CContainerItem *)AList::GetHead();};
  25. CContainerItem * RemoveHead() {return (CContainerItem *)AList::RemoveHead();};
  26. void AddTail(CContainerItem * pItem) { AList::AddTail((AListItem *)pItem);};
  27. };
  28. class CContainer :
  29. public IDirectMusicContainer,
  30. public IDirectMusicObject,
  31. public IPersistStream,
  32. public IDirectMusicObjectP
  33. {
  34. public:
  35. CContainer::CContainer();
  36. CContainer::~CContainer();
  37. // IUnknown
  38. virtual STDMETHODIMP QueryInterface(const IID &iid, void **ppv);
  39. virtual STDMETHODIMP_(ULONG) AddRef();
  40. virtual STDMETHODIMP_(ULONG) Release();
  41. // IDirectMusicContainer
  42. STDMETHODIMP EnumObject(REFGUID rguidClass,
  43. DWORD dwIndex,
  44. LPDMUS_OBJECTDESC pDesc,
  45. WCHAR *pwszAlias);
  46. // IDirectMusicObject
  47. STDMETHODIMP GetDescriptor(LPDMUS_OBJECTDESC pDesc);
  48. STDMETHODIMP SetDescriptor(LPDMUS_OBJECTDESC pDesc);
  49. STDMETHODIMP ParseDescriptor(LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc);
  50. // IPersist functions
  51. STDMETHODIMP GetClassID( CLSID* pClsId );
  52. // IPersistStream functions
  53. STDMETHODIMP IsDirty();
  54. STDMETHODIMP Load( IStream* pIStream );
  55. STDMETHODIMP Save( IStream* pIStream, BOOL fClearDirty );
  56. STDMETHODIMP GetSizeMax( ULARGE_INTEGER FAR* pcbSize );
  57. // IDirectMusicObjectP
  58. STDMETHOD_(void, Zombie)();
  59. private:
  60. void Clear(); // Remove all object references.
  61. HRESULT Load(IStream* pStream, IDirectMusicLoader *pLoader);
  62. HRESULT LoadObjects(IStream *pStream,
  63. IRIFFStream *pRiffStream,
  64. MMCKINFO ckParent,
  65. IDirectMusicLoader *pLoader);
  66. HRESULT LoadObject(IStream* pStream,
  67. IRIFFStream *pRiffStream,
  68. MMCKINFO ckParent,
  69. IDirectMusicLoader *pLoader);
  70. HRESULT ReadReference(IStream* pStream,
  71. IRIFFStream *pRiffStream,
  72. MMCKINFO ckParent,
  73. DMUS_OBJECTDESC *pDesc);
  74. IStream * m_pStream; // Pointer to stream this was loaded from.
  75. // This also provides access to the loader, indirectly.
  76. CContainerItemList m_ItemList; // List of objects that were loaded by container.
  77. long m_cRef; // COM reference counter.
  78. DWORD m_dwFlags; // Flags loaded from file.
  79. DWORD m_dwPartialLoad; // Used to keep track of partial load.
  80. // IDirectMusicObject variables
  81. DWORD m_dwValidData;
  82. GUID m_guidObject;
  83. FILETIME m_ftDate; /* Last edited date of object. */
  84. DMUS_VERSION m_vVersion; /* Version. */
  85. WCHAR m_wszName[DMUS_MAX_NAME]; /* Name of object. */
  86. WCHAR m_wszCategory[DMUS_MAX_CATEGORY]; /* Category for object */
  87. WCHAR m_wszFileName[DMUS_MAX_FILENAME]; /* File path. */
  88. bool m_fZombie;
  89. };
  90. #endif //__CONTAINER_H_