forked from goldendict/goldendict
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspeechclient.hh
53 lines (39 loc) · 1018 Bytes
/
speechclient.hh
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
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef __SPEECHCLIENT_HH_INCLUDED__
#define __SPEECHCLIENT_HH_INCLUDED__
#include <QObject>
#include "config.hh"
class SpeechClient: public QObject
{
Q_OBJECT
public:
struct Engine
{
QString id;
QString name;
// Volume and rate may vary from 0 to 100
int volume;
int rate;
Engine( Config::VoiceEngine const & e ) :
id( e.id )
, name( e.name )
, volume( e.volume )
, rate( e.rate )
{}
};
typedef QList<Engine> Engines;
SpeechClient( Config::VoiceEngine const & e, QObject * parent = 0L );
virtual ~SpeechClient();
static Engines availableEngines();
const Engine & engine() const;
bool tell( QString const & text, int volume = -1, int rate = -1 );
bool say( QString const & text, int volume = -1, int rate = -1 );
signals:
void started( bool ok );
void finished();
protected:
virtual void timerEvent( QTimerEvent * evt );
private:
struct InternalData;
InternalData * internalData;
};
#endif // __SPEECHCLIENT_HH_INCLUDED__