Source code of Windows XP (NT5)
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.

86 lines
2.6 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (c) 1998-1999 Microsoft Corporation
  6. //
  7. // File: dmtempl.h
  8. //
  9. //--------------------------------------------------------------------------
  10. // DMTempl.h : Declaration of the CDMTempl
  11. #ifndef __DMTEMPL_H_
  12. #define __DMTEMPL_H_
  13. #include "DMCompos.h"
  14. struct TemplateStruct
  15. {
  16. void AddIntro(bool f1Bar, int nLength);
  17. void AddIntro(TList<PlayChord>& PlayList, int nIntroLength);
  18. void AddEnd(int nLength);
  19. void InsertCommand(TListItem<TemplateCommand> *pCommand, BOOL fIsCommand);
  20. void AddChord(int nMeasure, DWORD dwChord);
  21. void AddCommand(int nMeasure, DWORD dwCommand);
  22. void CreateSignPosts();
  23. void CreateEmbellishments(WORD shape, int nFillLength, int nBreakLength);
  24. void IncorporateTemplate(short nMeasure, TemplateStruct* pTemplate, short nDirection);
  25. void FillInGrooveLevels();
  26. String m_strName;
  27. String m_strType;
  28. short m_nMeasures;
  29. TList<TemplateCommand> m_CommandList;
  30. };
  31. /////////////////////////////////////////////////////////////////////////////
  32. // CDMTempl
  33. class CDMTempl :
  34. public IDMTempl,
  35. public IPersistStream
  36. {
  37. public:
  38. CDMTempl();
  39. ~CDMTempl();
  40. void CleanUp();
  41. HRESULT SaveCommandList( IAARIFFStream* pRIFF, DMUS_TIMESIGNATURE& TimeSig );
  42. HRESULT SaveSignPostList( IAARIFFStream* pRIFF, DMUS_TIMESIGNATURE& TimeSig );
  43. HRESULT LoadTemplate( LPSTREAM pStream, DWORD dwSize );
  44. HRESULT Init(TemplateStruct* pTemplate);
  45. // IUnknown
  46. //
  47. virtual STDMETHODIMP QueryInterface(const IID &iid, void **ppv);
  48. virtual STDMETHODIMP_(ULONG) AddRef();
  49. virtual STDMETHODIMP_(ULONG) Release();
  50. // IDMTempl
  51. public:
  52. HRESULT STDMETHODCALLTYPE CreateSegment(IDirectMusicSegment* pSegment);
  53. HRESULT STDMETHODCALLTYPE Init(void* pTemplate);
  54. // IPersist
  55. public:
  56. STDMETHOD(GetClassID)(THIS_ LPCLSID pclsid);
  57. // IPersistStream
  58. public:
  59. // Determines if the Style has been modified by simply checking the Style's m_fDirty flag. This flag is cleared
  60. // when a Style is saved or has just been created.
  61. STDMETHOD(IsDirty)(THIS);
  62. // Loads a Style from a stream.
  63. STDMETHOD(Load)(THIS_ LPSTREAM pStream);
  64. // Saves a Style to a stream in RIFF format.
  65. STDMETHOD(Save)(THIS_ LPSTREAM pStream, BOOL fClearDirty);
  66. STDMETHOD(GetSizeMax)(THIS_ ULARGE_INTEGER FAR* pcbSize);
  67. public: // attributes
  68. long m_cRef;
  69. BOOL m_fDirty; // has this been modified?
  70. CRITICAL_SECTION m_CriticalSection; // for i/o
  71. BOOL m_fCSInitialized;
  72. TemplateStruct* m_pTemplateInfo;
  73. };
  74. #endif //__DMTEMPL_H_