QGCAudioWorker.h 1.22 KB
Newer Older
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
#ifndef QGCAUDIOWORKER_H
#define QGCAUDIOWORKER_H

#include <QObject>
#include <QTimer>

/* For Snow leopard and later
#if defined Q_OS_MAC & defined QGC_SPEECH_ENABLED
#include <NSSpeechSynthesizer.h>
#endif
   */


#if defined _MSC_VER && defined QGC_SPEECH_ENABLED
// Documentation: http://msdn.microsoft.com/en-us/library/ee125082%28v=VS.85%29.aspx
#include <sapi.h>
#endif

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

    void mute(bool mute);
    bool isMuted();

signals:

public slots:
    /** @brief Say this text if current output priority matches */
    void say(QString text, int severity = 1);

35 36 37
    /** @brief Sound a single beep */
    void beep();

38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
protected:
#if defined Q_OS_MAC && defined QGC_SPEECH_ENABLED
    //NSSpeechSynthesizer
#endif
#if defined Q_OS_LINUX && defined QGC_SPEECH_ENABLED
    //cst_voice* voice; ///< The flite voice object
#endif
#if defined _MSC_VER && defined QGC_SPEECH_ENABLED
    static ISpVoice *pVoice;
#endif
    int voiceIndex;   ///< The index of the flite voice to use (awb, slt, rms)
    bool emergency;   ///< Emergency status flag
    QTimer *emergencyTimer;
    bool muted;
};

#endif // QGCAUDIOWORKER_H