File: speechclient.hh

package info (click to toggle)
goldendict-webengine 23.02.05-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 19,148 kB
  • sloc: cpp: 58,537; javascript: 9,942; ansic: 9,242; xml: 41; makefile: 15; sh: 9
file content (53 lines) | stat: -rw-r--r-- 1,018 bytes parent folder | download | duplicates (6)
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__