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.

79 lines
2.6 KiB

  1. /******************************************************************************
  2. * TrueTalk.h *
  3. *--------------*
  4. * This module is the declaration of class CTrueTalk
  5. *------------------------------------------------------------------------------
  6. * Copyright (C) 2000 Microsoft Corporation Date: 02/29/00
  7. * All Rights Reserved
  8. *
  9. ********************************************************************* PACOG ***/
  10. #ifndef __TRUETALK_H_
  11. #define __TRUETALK_H_
  12. #include "resource.h" // main symbols
  13. #include <spddkhlp.h>
  14. //#include <sapi.h>
  15. EXTERN_C const CLSID CLSID_TrueTalk;
  16. class CFrontEnd;
  17. class CBackEnd;
  18. class CPhStrQueue;
  19. /////////////////////////////////////////////////////////////////////////////
  20. // CTrueTalk
  21. class ATL_NO_VTABLE CTrueTalk :
  22. public CComObjectRootEx<CComMultiThreadModel>,
  23. public CComCoClass<CTrueTalk, &CLSID_TrueTalk>,
  24. public ISpTTSEngine,
  25. public ISpObjectWithToken
  26. {
  27. public:
  28. DECLARE_REGISTRY_RESOURCEID(IDR_TRUETALK)
  29. DECLARE_NOT_AGGREGATABLE(CTrueTalk)
  30. BEGIN_COM_MAP(CTrueTalk)
  31. COM_INTERFACE_ENTRY(ISpTTSEngine)
  32. COM_INTERFACE_ENTRY(ISpObjectWithToken)
  33. END_COM_MAP()
  34. //-- Constructors, destructors
  35. HRESULT FinalConstruct();
  36. void FinalRelease();
  37. //-- Threading control
  38. static void InitThreading();
  39. static void ReleaseThreading();
  40. //-- ISpObjectWithToken
  41. STDMETHODIMP GetObjectToken(ISpObjectToken ** ppToken)
  42. { return SpGenericGetObjectToken( ppToken, m_cpToken ); }
  43. STDMETHOD(SetObjectToken)(ISpObjectToken * pToken);
  44. //-- ISpTTSEngine
  45. STDMETHOD(Speak)(DWORD dwSpeakFlags, REFGUID rguidFormatId, const WAVEFORMATEX * pWaveFormatEx,
  46. const SPVTEXTFRAG * pTextFragList, ISpTTSEngineSite * pOutputSite);
  47. STDMETHOD(GetOutputFormat)( const GUID * pTargetFormatId, const WAVEFORMATEX * pTargetWaveFormatEx,
  48. GUID * pOutputFormatId, WAVEFORMATEX ** ppCoMemOutputWaveFormatEx );
  49. private:
  50. HRESULT DoUnicodeToAsciiMap ( const WCHAR *pUnicodeString, ULONG ulUnicodeStringLength, char* pszAsciiString);
  51. HRESULT RunFrontEnd ( const SPVTEXTFRAG *pTextFragList, ISpTTSEngineSite * pOutputSite);
  52. int SyncActions (ISpTTSEngineSite * pOutputSite);
  53. static const int m_iQueueSize;
  54. CComPtr<ISpObjectToken> m_cpToken;
  55. WAVEFORMATEX m_WaveFormatEx;
  56. bool m_fTextOutput;
  57. DWORD m_dwDebugLevel;
  58. CFrontEnd* m_pTtp;
  59. CPhStrQueue* m_pPhoneQueue;
  60. CBackEnd* m_pBend;
  61. double m_dGain;
  62. };
  63. #endif //__TRUETALK_H_