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.

111 lines
3.8 KiB

  1. // DMPers.h : Declaration of the CDMPers
  2. //
  3. // Copyright (c) 1997-1999 Microsoft Corporation
  4. //
  5. // @doc EXTERNAL
  6. //
  7. #ifndef __DMPERS_H_
  8. #define __DMPERS_H_
  9. #include "dmusici.h"
  10. #include "DMCompos.h"
  11. const short MAX_PALETTE = 24;
  12. struct DMPersonalityStruct
  13. {
  14. //void ResolveConnections( LPPERSONALITY personality, short nCount );
  15. bool m_fLoaded; // is the personality loaded in memory?
  16. GUID m_guid;
  17. //DWORD m_dwVersionMS;
  18. //DWORD m_dwVersionLS;
  19. String m_strName; // Name of the personality
  20. //String m_strCategory; // Category of the personality
  21. DWORD m_dwScalePattern; // Scale for the personality
  22. DWORD m_dwChordMapFlags; // Flags (?)
  23. TList<DMChordData> m_aChordPalette[MAX_PALETTE]; // chord palette
  24. TList<DMChordEntry> m_ChordMap; // Chord map DAG (adjacency list)
  25. TList<DMSignPost> m_SignPostList; // List of sign posts
  26. };
  27. /*
  28. @interface IDirectMusicPersonality |
  29. The <i IDirectMusicPersonality> interface provides methods for manipulating personalities.
  30. Personalities provide the Composer (<i IDirectMusicComposer>) with the information it
  31. needs to compose chord progressions, which it uses to build section segments and automatic
  32. transitions, as wells as to change the chords in an existing segment as it plays.
  33. It also supports the <i IPersistStream> and <i IDirectMusicObject> interfaces for loading
  34. its data.
  35. @base public | IUnknown
  36. @meth HRESULT | GetScale | Returns the scale of the personality.
  37. */
  38. /////////////////////////////////////////////////////////////////////////////
  39. // CDMPers
  40. class CDMPers :
  41. public IDMPers,
  42. public IDirectMusicChordMap,
  43. public IDirectMusicObject,
  44. public IPersistStream
  45. {
  46. public:
  47. CDMPers();
  48. ~CDMPers();
  49. // IUnknown
  50. //
  51. virtual STDMETHODIMP QueryInterface(const IID &iid, void **ppv);
  52. virtual STDMETHODIMP_(ULONG) AddRef();
  53. virtual STDMETHODIMP_(ULONG) Release();
  54. // IDMPers
  55. public:
  56. void CleanUp();
  57. //HRESULT LoadPersonality( LPSTREAM pStream, DWORD dwSize );
  58. HRESULT DM_ParseDescriptor( IAARIFFStream* pIRiffStream, MMCKINFO* pckMain, LPDMUS_OBJECTDESC pDesc );
  59. HRESULT DM_LoadPersonality( IAARIFFStream* pIRiffStream, MMCKINFO* pckMain );
  60. HRESULT DM_LoadSignPost( IAARIFFStream* pIRiffStream, MMCKINFO* pckParent, DMExtendedChord** apChordDB );
  61. HRESULT DM_LoadChordEntry(
  62. IAARIFFStream* pIRiffStream, MMCKINFO* pckParent, DMExtendedChord** apChordDB, short& nMax );
  63. HRESULT STDMETHODCALLTYPE GetPersonalityStruct(void** ppPersonality);
  64. // IDirectMusicPersonality
  65. public:
  66. HRESULT STDMETHODCALLTYPE GetScale(DWORD* pdwScale);
  67. //HRESULT STDMETHODCALLTYPE GetName(BSTR* pdwName);
  68. // IDirectMusicObject methods
  69. HRESULT STDMETHODCALLTYPE GetDescriptor(LPDMUS_OBJECTDESC pDesc) ;
  70. HRESULT STDMETHODCALLTYPE SetDescriptor(LPDMUS_OBJECTDESC pDesc) ;
  71. HRESULT STDMETHODCALLTYPE ParseDescriptor(LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc) ;
  72. // IPersist
  73. public:
  74. STDMETHOD(GetClassID)(THIS_ LPCLSID pclsid);
  75. // IPersistStream
  76. public:
  77. // Determines if the Style has been modified by simply checking the Style's m_fDirty flag. This flag is cleared
  78. // when a Style is saved or has just been created.
  79. STDMETHOD(IsDirty)(THIS);
  80. // Loads a Style from a stream.
  81. STDMETHOD(Load)(THIS_ LPSTREAM pStream);
  82. // Saves a Style to a stream in RIFF format.
  83. STDMETHOD(Save)(THIS_ LPSTREAM pStream, BOOL fClearDirty);
  84. STDMETHOD(GetSizeMax)(THIS_ ULARGE_INTEGER FAR* pcbSize);
  85. protected: // attributes
  86. long m_cRef;
  87. BOOL m_fDirty; // has the style been modified?
  88. CRITICAL_SECTION m_CriticalSection; // for i/o
  89. BOOL m_fCSInitialized;
  90. DMPersonalityStruct m_PersonalityInfo; // The details of the personality
  91. };
  92. #endif //__DMPERS_H_