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.

102 lines
2.9 KiB

  1. /******************************************************************************
  2. * TTSEngine.h *
  3. *-------------*
  4. * This is the header file for the CTTSEngine implementation.
  5. *------------------------------------------------------------------------------
  6. * Copyright (C) 1999 Microsoft Corporation Date: 03/01/99
  7. * All Rights Reserved
  8. *
  9. *********************************************************************** EDC ***/
  10. #ifndef TTSEngine_h
  11. #define TTSEngine_h
  12. //--- Additional includes
  13. #ifndef __spttseng_h__
  14. #include "spttseng.h"
  15. #endif
  16. #ifndef SPDDKHLP_h
  17. #include <spddkhlp.h>
  18. #endif
  19. #ifndef SPHelper_h
  20. #include <sphelper.h>
  21. #endif
  22. #ifndef Backend_H
  23. #include "Backend.h"
  24. #endif
  25. #ifndef Frontend_H
  26. #include "Frontend.h"
  27. #endif
  28. #ifndef FeedChain_H
  29. #include "FeedChain.h"
  30. #endif
  31. #include "resource.h"
  32. //=== Constants ====================================================
  33. #define TEXT_VOICE_FMT_INDEX 1
  34. //=== Class, Enum, Struct and Union Declarations ===================
  35. //=== Enumerated Set Definitions ===================================
  36. //=== Function Type Definitions ====================================
  37. //=== Class, Struct and Union Definitions ==========================
  38. /*** CTTSEngine COM object ********************************
  39. */
  40. class ATL_NO_VTABLE CTTSEngine :
  41. public CComObjectRootEx<CComMultiThreadModel>,
  42. public CComCoClass<CTTSEngine, &CLSID_MSTTSEngine>,
  43. public ISpTTSEngine,
  44. public IMSTTSEngineInit
  45. {
  46. /*=== ATL Setup ===*/
  47. public:
  48. DECLARE_REGISTRY_RESOURCEID(IDR_MSTTSENGINE)
  49. DECLARE_PROTECT_FINAL_CONSTRUCT()
  50. BEGIN_COM_MAP(CTTSEngine)
  51. COM_INTERFACE_ENTRY(ISpTTSEngine)
  52. COM_INTERFACE_ENTRY(IMSTTSEngineInit)
  53. END_COM_MAP()
  54. /*=== Methods =======*/
  55. public:
  56. /*--- Constructors/Destructors ---*/
  57. HRESULT FinalConstruct();
  58. void FinalRelease();
  59. /*--- Non interface methods ---*/
  60. HRESULT InitDriver();
  61. /*=== Interfaces ====*/
  62. public:
  63. //--- IMSTTSEngineInit ----------------------------------------
  64. STDMETHOD(VoiceInit)( IMSVoiceData* pVoiceData );
  65. //--- ISpTTSEngine --------------------------------------------
  66. STDMETHOD(Speak)( DWORD dwSpeakFlags,
  67. REFGUID rguidFormatId, const WAVEFORMATEX * pWaveFormatEx,
  68. const SPVTEXTFRAG* pTextFragList, ISpTTSEngineSite* pOutputSite );
  69. STDMETHOD(GetOutputFormat)( const GUID * pTargetFormatId, const WAVEFORMATEX * pTargetWaveFormatEx,
  70. GUID * pDesiredFormatId, WAVEFORMATEX ** ppCoMemDesiredWaveFormatEx );
  71. private:
  72. /*=== Member Data ===*/
  73. CComPtr<IEnumSpSentence> m_cpSentEnum;
  74. CBackend m_BEObj;
  75. CFrontend m_FEObj;
  76. IMSVoiceData *m_pVoiceDataObj; // This should not AddRef
  77. ULONG m_BytesPerSample;
  78. bool m_IsStereo;
  79. ULONG m_SampleRate;
  80. MSVOICEINFO m_VoiceInfo;
  81. };
  82. #endif //--- This must be the last line in the file