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.

95 lines
3.1 KiB

  1. //////////////////////////////////////////////////////////////////////
  2. // PromptEng.h : Declaration of the CPromptEng
  3. //
  4. // Created by JOEM 04-2000
  5. // Copyright (C) 2000 Microsoft Corporation
  6. // All Rights Reserved
  7. //
  8. /////////////////////////////////////////////////////// JOEM 4-2000 //
  9. #ifndef __PROMPTENG_H_
  10. #define __PROMPTENG_H_
  11. #include "resource.h" // main symbols
  12. #include "PromptDb.h"
  13. #include "Query.h"
  14. #include "DbQuery.h"
  15. #include "LocalTTSEngineSite.h"
  16. #include "PhoneContext.h"
  17. #include "TextRules.h"
  18. #include <spddkhlp.h>
  19. #include <spcollec.h>
  20. /////////////////////////////////////////////////////////////////////////////
  21. // CPromptEng
  22. //
  23. // Voice with associated prerecorded prompt database will use this engine
  24. // to search for a set of prompts that match the desired message.
  25. // This prompt engine class should contain a TTS engine member.
  26. //
  27. ///////////////////////////////////////////////////////// JOEM 02-15-2000 ///
  28. class ATL_NO_VTABLE CPromptEng :
  29. public CComObjectRootEx<CComMultiThreadModel>,
  30. public CComCoClass<CPromptEng, &CLSID_PromptEng>,
  31. public ISpObjectWithToken,
  32. public ISpTTSEngine
  33. {
  34. public:
  35. DECLARE_REGISTRY_RESOURCEID(IDR_PROMPTENG)
  36. DECLARE_PROTECT_FINAL_CONSTRUCT()
  37. DECLARE_GET_CONTROLLING_UNKNOWN()
  38. BEGIN_COM_MAP(CPromptEng)
  39. COM_INTERFACE_ENTRY(ISpTTSEngine)
  40. COM_INTERFACE_ENTRY(ISpObjectWithToken)
  41. END_COM_MAP()
  42. public:
  43. // Constructors/Destructors
  44. HRESULT FinalConstruct();
  45. void FinalRelease();
  46. // ISpObjectWithToken
  47. STDMETHOD(SetObjectToken)(ISpObjectToken *pToken);
  48. STDMETHOD(GetObjectToken)(ISpObjectToken **ppToken)
  49. { return SpGenericGetObjectToken( ppToken, m_cpToken ); }
  50. // ISpTTSEngine
  51. STDMETHOD(Speak)(DWORD dwSpeakFlags, 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. private:
  56. STDMETHOD(DispatchQueryList)(const DWORD dwSpeakFlags, REFGUID rguidFormatId, const WAVEFORMATEX * pWaveFormatEx);
  57. STDMETHOD(SendTextOutput)(const DWORD dwSpeakFlags, REFGUID rguidFormatId);
  58. STDMETHOD(BuildQueryList)(const DWORD dwSpeakFlags, const SPVTEXTFRAG* pCurrentFrag, const FragType fFragType );
  59. STDMETHOD(ParseSubQuery)(const DWORD dwSpeakFlags, const WCHAR* pszText, USHORT* unSubQueries );
  60. STDMETHOD(CompressQueryList)();
  61. STDMETHOD(CompressTTSItems)(REFGUID rguidFormatId);
  62. STDMETHOD(SendSilence)(const int iMsec, const DWORD iAvgBytesPerSec);
  63. void DebugQueryList();
  64. private:
  65. CComPtr<ISpObjectToken> m_cpToken;
  66. CComPtr<ISpObjectToken> m_cpTTSToken;
  67. CComPtr<IPromptDb> m_cpPromptDb;
  68. CComPtr<ISpTTSEngine> m_cpTTSEngine;
  69. CPhoneContext m_phoneContext;
  70. CTextRules m_textRules;
  71. CDbQuery m_DbQuery;
  72. CLocalTTSEngineSite* m_pOutputSite;
  73. CSPArray<CQuery*,CQuery*> m_apQueries;
  74. double m_dQueryCost;
  75. bool m_fAbort;
  76. };
  77. #endif //__PROMPTENG_H_