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.

98 lines
3.9 KiB

  1. // Copyright (c) 1998 Microsoft Corporation
  2. //
  3. //
  4. //
  5. #ifndef _SYSLINK_
  6. #define _SYSLINK_
  7. #include <mmsystem.h>
  8. #undef INTERFACE
  9. #define INTERFACE IReferenceClock
  10. DECLARE_INTERFACE_(IReferenceClock, IUnknown)
  11. {
  12. /* IUnknown */
  13. STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
  14. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  15. STDMETHOD_(ULONG,Release) (THIS) PURE;
  16. /* IReferenceClock */
  17. /* */
  18. /* get the time now */
  19. STDMETHOD(GetTime) (THIS_ REFERENCE_TIME *pTime) PURE;
  20. /* ask for an async notification that a time has elapsed */
  21. STDMETHOD(AdviseTime) (THIS_ REFERENCE_TIME baseTime, /* base time */
  22. REFERENCE_TIME streamTime, /* stream offset time */
  23. HANDLE hEvent, /* advise via this event */
  24. DWORD * pdwAdviseCookie) PURE; /* where your cookie goes */
  25. /* ask for an async periodic notification that a time has elapsed */
  26. STDMETHOD(AdvisePeriodic) (THIS_ REFERENCE_TIME startTime, /* starting at this time */
  27. REFERENCE_TIME periodTime, /* time between notifications */
  28. HANDLE hSemaphore, /* advise via a semaphore */
  29. DWORD * pdwAdviseCookie) PURE; /* where your cookie goes */
  30. /* cancel a request for notification */
  31. STDMETHOD(Unadvise) (THIS_ DWORD dwAdviseCookie) PURE;
  32. };
  33. #undef INTERFACE
  34. #define INTERFACE IDirectMusicSynthSink
  35. DECLARE_INTERFACE_(IDirectMusicSynthSink, IUnknown)
  36. {
  37. /* IUnknown */
  38. STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
  39. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  40. STDMETHOD_(ULONG,Release) (THIS) PURE;
  41. /* IDirectMusicSynthSink */
  42. STDMETHOD(Init) (THIS_ CSynth *pSynth) PURE;
  43. STDMETHOD(SetFormat) (THIS_ LPCWAVEFORMATEX pWaveFormat) PURE;
  44. STDMETHOD(SetMasterClock) (THIS_ IReferenceClock *pClock) PURE;
  45. STDMETHOD(GetLatencyClock) (THIS_ IReferenceClock **ppClock) PURE;
  46. STDMETHOD(Activate) (THIS_ HWND hWnd,
  47. BOOL fEnable) PURE;
  48. STDMETHOD(SampleToRefTime) (THIS_ LONGLONG llSampleTime,
  49. REFERENCE_TIME *prfTime) PURE;
  50. STDMETHOD(RefTimeToSample) (THIS_ REFERENCE_TIME rfTime,
  51. LONGLONG *pllSampleTime) PURE;
  52. };
  53. typedef IDirectMusicSynthSink *PDIRECTMUSICSYNTHSINK;
  54. class CSysLink : public IDirectMusicSynthSink
  55. {
  56. public:
  57. // IUnknown
  58. //
  59. STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *);
  60. STDMETHOD_(ULONG, AddRef) (THIS);
  61. STDMETHOD_(ULONG, Release) (THIS);
  62. // IDirectMusicSynthSink
  63. //
  64. STDMETHOD(Init) (THIS_ CSynth *pSynth);
  65. STDMETHOD(SetFormat) (THIS_ LPCWAVEFORMATEX pWaveFormat);
  66. STDMETHOD(SetMasterClock) (THIS_ IReferenceClock *pClock);
  67. STDMETHOD(GetLatencyClock) (THIS_ IReferenceClock **ppClock);
  68. STDMETHOD(Activate) (THIS_ HWND hWnd, BOOL fEnable);
  69. STDMETHOD(SampleToRefTime) (THIS_ LONGLONG llSampleTime,REFERENCE_TIME *prfTime);
  70. STDMETHOD(RefTimeToSample) (THIS_ REFERENCE_TIME rfTime, LONGLONG *pllSampleTime);
  71. // Class
  72. //
  73. CSysLink();
  74. ~CSysLink();
  75. private:
  76. LONG m_cRef;
  77. };
  78. #define STATIC_IID_IDirectMusicSynthSink \
  79. 0xaec17ce3, 0xa514, 0x11d1, 0xaf, 0xa6, 0x00, 0xaa, 0x00, 0x24, 0xd8, 0xb6
  80. DEFINE_GUIDSTRUCT("aec17ce3-a514-11d1-afa6-00aa0024d8b6", IID_IDirectMusicSynthSink);
  81. #define IID_IDirectMusicSynthSink DEFINE_GUIDNAMED(IID_IDirectMusicSynthSink)
  82. #endif // _SYSLINK_