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.

98 lines
3.4 KiB

  1. /******************************************************************************
  2. * MSE_TTSEngine.h *
  3. *-------------*
  4. * This is the header file for the CMSE_TTSEngine implementation.
  5. *------------------------------------------------------------------------------
  6. * Copyright (C) 1999 Microsoft Corporation Date: 03/01/99
  7. * All Rights Reserved
  8. *
  9. *********************************************************************** EDC ***/
  10. #ifndef MSE_TTSEngine_h
  11. #define MSE_TTSEngine_h
  12. //--- Additional includes
  13. #include "ms_entropicengine.h"
  14. #include <spddkhlp.h>
  15. #include <sphelper.h>
  16. #include "Frontend.h"
  17. #include "FeedChain.h"
  18. #include "resource.h"
  19. #include "perfmon.h"
  20. //=== Constants ====================================================
  21. #define TEXT_VOICE_FMT_INDEX 1
  22. //=== Class, Enum, Struct and Union Declarations ===================
  23. //=== Enumerated Set Definitions ===================================
  24. //=== Function Type Definitions ====================================
  25. //=== Class, Struct and Union Definitions ==========================
  26. /*** CMSE_TTSEngine COM object ********************************
  27. */
  28. class ATL_NO_VTABLE MSE_TTSEngine :
  29. public CComObjectRootEx<CComMultiThreadModel>,
  30. public CComCoClass<MSE_TTSEngine, &CLSID_MSE_TTSEngine>,
  31. public ISpTTSEngine,
  32. public ISpObjectWithToken
  33. {
  34. /*=== ATL Setup ===*/
  35. public:
  36. DECLARE_REGISTRY_RESOURCEID(IDR_MSE_TTSENGINE)
  37. DECLARE_PROTECT_FINAL_CONSTRUCT()
  38. BEGIN_COM_MAP(MSE_TTSEngine)
  39. COM_INTERFACE_ENTRY(ISpTTSEngine)
  40. COM_INTERFACE_ENTRY(ISpObjectWithToken)
  41. END_COM_MAP()
  42. /*=== Methods =======*/
  43. public:
  44. /*--- Constructors/Destructors ---*/
  45. HRESULT FinalConstruct();
  46. void FinalRelease();
  47. /*=== Interfaces ====*/
  48. public:
  49. //--- ISpTTSEngine --------------------------------------------
  50. STDMETHOD(Speak)( DWORD dwSpeakFlags,
  51. REFGUID rguidFormatId, const WAVEFORMATEX * pWaveFormatEx,
  52. const SPVTEXTFRAG* pTextFragList, ISpTTSEngineSite* pOutputSite );
  53. STDMETHOD(GetOutputFormat)( const GUID * pTargetFormatId, const WAVEFORMATEX * pTargetWaveFormatEx,
  54. GUID * pDesiredFormatId, WAVEFORMATEX ** ppCoMemDesiredWaveFormatEx );
  55. //--- ISpObjectWithToken ----------------------------------
  56. STDMETHODIMP SetObjectToken(ISpObjectToken * pToken);
  57. STDMETHODIMP GetObjectToken(ISpObjectToken ** ppToken)
  58. { return SpGenericGetObjectToken( ppToken, m_cpToken ); }
  59. private:
  60. #define USE_PERF_COUNTERS (0)
  61. #if USE_PERF_COUNTERS
  62. void IncrementPerfCounter(PERFC perfc) { m_pco.IncrementCounter(perfc); }
  63. void SetPerfCounter(PERFC perfc, __int32 value) { m_pco.SetCounter(perfc, value); }
  64. #else
  65. void IncrementPerfCounter(PERFC perfc) {};
  66. void SetPerfCounter(PERFC perfc, __int32 value) {};
  67. #endif
  68. /*=== Member Data ===*/
  69. CComPtr<IEnumSpSentence> m_cpSentEnum;
  70. CComPtr<ISpObjectToken> m_cpToken;
  71. CBackEnd *m_pBEnd;
  72. CFrontend m_FEObj;
  73. #ifdef USE_VOICEDATAOBJ
  74. CVoiceData m_VoiceDataObj; // This should not AddRef
  75. #endif
  76. ULONG m_BytesPerSample;
  77. bool m_IsStereo;
  78. ULONG m_SampleRate;
  79. #ifdef USE_VOICEDATAOBJ
  80. MSVOICEINFO m_VoiceInfo;
  81. #endif
  82. CPerfCounterObject m_pco;
  83. };
  84. #endif //--- This must be the last line in the file