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.

82 lines
2.9 KiB

  1. //
  2. //
  3. //
  4. #ifndef _Garglep_
  5. #define _Garglep_
  6. #include "dsdmobse.h"
  7. #include "dmocom.h"
  8. #include "dsdmo.h"
  9. #include "PropertyHelp.h"
  10. #include "param.h"
  11. class CDirectSoundGargleDMO :
  12. public CDirectSoundDMO,
  13. public CParamsManager,
  14. public ISpecifyPropertyPages,
  15. public IDirectSoundFXGargle,
  16. public CParamsManager::UpdateCallback,
  17. public CComBase
  18. {
  19. public:
  20. CDirectSoundGargleDMO( IUnknown *pUnk, HRESULT *phr);
  21. ~CDirectSoundGargleDMO();
  22. DECLARE_IUNKNOWN;
  23. STDMETHODIMP NDQueryInterface(REFIID riid, void **ppv);
  24. static CComBase* WINAPI CreateInstance(IUnknown *pUnk, HRESULT *phr);
  25. // InitOnCreation is called by the class factory to give the object a chance to initialize
  26. // immediately after it is created. This is used to prepare the object's parameter information.
  27. HRESULT InitOnCreation();
  28. // The Init function is an override from the CPCMDMO base class and it provides initialization
  29. // for the effect's actual audio processing. Note that InputType must have been set before this
  30. // occurs in order for this to work.
  31. HRESULT Init();
  32. STDMETHOD(Clone) (THIS_ IMediaObjectInPlace **);
  33. // IPersist methods
  34. virtual HRESULT STDMETHODCALLTYPE GetClassID( CLSID *pClassID );
  35. // ISpecifyPropertyPages
  36. STDMETHOD(GetPages)(CAUUID * pPages) { return PropertyHelp::GetPages(CLSID_DirectSoundPropGargle, pPages); }
  37. // IPersistStream
  38. STDMETHOD(IsDirty)(void) { return m_fDirty ? S_OK : S_FALSE; }
  39. STDMETHOD(Load)(IStream *pStm) { return PropertyHelp::Load(this, DSFXGargle(), pStm); }
  40. STDMETHOD(Save)(IStream *pStm, BOOL fClearDirty) { return PropertyHelp::Save(this, DSFXGargle(), pStm, fClearDirty); }
  41. STDMETHOD(GetSizeMax)(ULARGE_INTEGER *pcbSize) { if (!pcbSize) return E_POINTER; pcbSize->QuadPart = sizeof(DSFXGargle); return S_OK; }
  42. // IDirectSoundFXGargle
  43. STDMETHOD(SetAllParameters) (THIS_ LPCDSFXGargle);
  44. STDMETHOD(GetAllParameters) (THIS_ LPDSFXGargle);
  45. // SetParam handling
  46. STDMETHODIMP SetParam(DWORD dwParamIndex,MP_DATA value) { return SetParamInternal(dwParamIndex, value, false); }
  47. HRESULT SetParamUpdate(DWORD dwParamIndex, MP_DATA value) { return SetParamInternal(dwParamIndex, value, true); }
  48. HRESULT SetParamInternal(DWORD dwParamIndex, MP_DATA value, bool fSkipPasssingToParamManager);
  49. // All of these methods are called by the base class
  50. HRESULT FBRProcess(DWORD cQuanta, BYTE *pIn, BYTE *pOut);
  51. HRESULT Discontinuity();
  52. HRESULT ProcessInPlace(ULONG ulQuanta, LPBYTE pcbData, REFERENCE_TIME rtStart, DWORD dwFlags);
  53. bool m_fDirty;
  54. private:
  55. // gargle params
  56. ULONG m_ulShape;
  57. ULONG m_ulGargleFreqHz;
  58. // gargle state
  59. ULONG m_ulPeriod;
  60. ULONG m_ulPhase;
  61. BOOL m_bInitialized;
  62. };
  63. EXT_STD_CREATE(Gargle);
  64. #endif