AudioOutput.h 1.03 KB
Newer Older
1 2 3 4 5 6 7 8
/****************************************************************************
 *
 *   (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 ****************************************************************************/
pixhawk's avatar
pixhawk committed
9

10
#pragma once
pixhawk's avatar
pixhawk committed
11 12 13

#include <QObject>
#include <QTimer>
14
#include <QThread>
pixhawk's avatar
pixhawk committed
15
#include <QStringList>
16
#include <QTextToSpeech>
17

18 19 20
#include "QGCToolbox.h"

class QGCApplication;
Lorenz Meier's avatar
Lorenz Meier committed
21

22
class AudioOutput : public QGCTool
pixhawk's avatar
pixhawk committed
23 24 25
{
    Q_OBJECT
public:
26
    AudioOutput(QGCApplication* app, QGCToolbox* toolbox);
pixhawk's avatar
pixhawk committed
27

28 29
    static bool     getMillisecondString    (const QString& string, QString& match, int& number);
    static QString  fixTextMessageForAudio  (const QString& string);
30

pixhawk's avatar
pixhawk committed
31
public slots:
Don Gagne's avatar
Don Gagne committed
32
    void            say                     (const QString& text);
33

34 35
private slots:
    void            _stateChanged           (QTextToSpeech::State state);
pixhawk's avatar
pixhawk committed
36 37

protected:
38 39
    QTextToSpeech*  _tts;
    QStringList     _texts;
pixhawk's avatar
pixhawk committed
40 41
};