QGCAudioWorker.h 1.27 KB
Newer Older
1 2 3 4 5
#ifndef QGCAUDIOWORKER_H
#define QGCAUDIOWORKER_H

#include <QObject>
#include <QTimer>
6
#include <QSound>
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28

/* 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();
29
    void init();
30 31 32 33 34 35 36

signals:

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

37 38 39
    /** @brief Sound a single beep */
    void beep();

40 41 42 43 44 45 46 47
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
48
    ISpVoice *pVoice;
49 50 51 52 53
#endif
    int voiceIndex;   ///< The index of the flite voice to use (awb, slt, rms)
    bool emergency;   ///< Emergency status flag
    QTimer *emergencyTimer;
    bool muted;
54
    QSound *sound;
55 56 57
};

#endif // QGCAUDIOWORKER_H