QGCAudioWorker.h 1018 Bytes
Newer Older
1 2 3 4 5 6 7 8
#ifndef QGCAUDIOWORKER_H
#define QGCAUDIOWORKER_H

#include <QObject>
#include <QTimer>

#if defined _MSC_VER && defined QGC_SPEECH_ENABLED
// Documentation: http://msdn.microsoft.com/en-us/library/ee125082%28v=VS.85%29.aspx
Don Gagne's avatar
Don Gagne committed
9
#include <basetyps.h>
10 11 12 13 14 15 16 17 18 19 20 21
#include <sapi.h>
#endif

class QGCAudioWorker : public QObject
{
    Q_OBJECT
public:
    explicit QGCAudioWorker(QObject *parent = 0);
    ~QGCAudioWorker();

    void mute(bool mute);
    bool isMuted();
22
    void init();
23

dogmaphobic's avatar
dogmaphobic committed
24 25
    static QString fixTextMessageForAudio(const QString& string);

26 27 28
signals:

public slots:
Don Gagne's avatar
Don Gagne committed
29 30
    /** @brief Say this text */
    void say(QString text);
31

32
protected:
33
    int voiceIndex;   ///< The index of the flite voice to use (awb, slt, rms)
34
#if defined _MSC_VER && defined QGC_SPEECH_ENABLED
35
    ISpVoice *pVoice;
36
#endif
37 38 39
    bool emergency;   ///< Emergency status flag
    QTimer *emergencyTimer;
    bool muted;
40
private:
dogmaphobic's avatar
dogmaphobic committed
41
    static bool _getMillisecondString(const QString& string, QString& match, int& number);
42 43 44
};

#endif // QGCAUDIOWORKER_H