summaryrefslogtreecommitdiff
path: root/plugins/WinterSpeak/src/SpeakConfig.h
blob: 6894eecfb3a615b3e9c8c49b2d569b22941b1847 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once

#include "Common.h"
#include "ConfigDatabase.h"
#include "TextToSpeech.h"

class TextToSpeech;

class SpeakConfig : public Observer
{
public:
	SpeakConfig(HINSTANCE instance);
	virtual ~SpeakConfig();

	//--------------------------------------------------------------------------
	// Description : Called by a subject that this observer is observing
	//               to signify a change in state
	// Parameters  : subject - the subject that changed
	//--------------------------------------------------------------------------
	virtual void update(Subject &subject);

	//--------------------------------------------------------------------------
	// Description : speak a sentence
	// Parameters  : sentence - the sentence to speak
	//               user - the user to associate the say with
	//                      NULL = ignore user
	// Returns     : true - speak successful
	//               false - speak failed
	//--------------------------------------------------------------------------
	bool status(const std::wstring &sentence, HCONTACT user = NULL);
	bool message(const std::wstring &sentence, HCONTACT user = NULL);
	bool say(const std::wstring &sentence, HCONTACT user, bool message);

private:
	HINSTANCE                   m_instance;

	ConfigDatabase              m_db;
	std::auto_ptr<TextToSpeech> m_tts;
	DialogConfigEngine          m_dialog_engine;
	DialogConfigActive          m_dialog_active;
};