1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #ifndef BACKENDS_TEXT_TO_SPEECH_MACOSX_H
24 #define BACKENDS_TEXT_TO_SPEECH_MACOSX_H
25 
26 #include "common/scummsys.h"
27 
28 #if defined(USE_TTS) && defined(MACOSX)
29 
30 #include "common/text-to-speech.h"
31 #include "common/queue.h"
32 #include "common/ustr.h"
33 
34 class MacOSXTextToSpeechManager : public Common::TextToSpeechManager {
35 public:
36 	MacOSXTextToSpeechManager();
37 	virtual ~MacOSXTextToSpeechManager() override;
38 
39 	virtual bool say(const Common::U32String &str, Action action) override;
40 
41 	virtual bool stop() override;
42 	virtual bool pause() override;
43 	virtual bool resume() override;
44 
45 	virtual bool isSpeaking() override;
46 	virtual bool isPaused() override;
47 	virtual bool isReady() override;
48 
49 	virtual void setVoice(unsigned index) override;
50 
51 	virtual void setRate(int rate) override;
52 
53 	virtual void setPitch(int pitch) override;
54 
55 	virtual void setVolume(unsigned volume) override;
56 
57 	virtual void setLanguage(Common::String language) override;
58 
59 	virtual int getDefaultVoice() override;
60 
61 	virtual void freeVoiceData(void *data) override;
62 
63 	bool startNextSpeech();
64 
65 private:
66 	virtual void updateVoices() override;
67 
68 	Common::Queue<Common::String> _messageQueue;
69 	Common::String _currentSpeech;
70 	bool _paused;
71 };
72 
73 #endif
74 
75 #endif // BACKENDS_TEXT_TO_SPEECH_MACOSX_H
76 
77