QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
AudioOutput Class Reference

The AudioOutput class provides functionality for audio output using text-to-speech. More...

#include <AudioOutput.h>

+ Inheritance diagram for AudioOutput:
+ Collaboration diagram for AudioOutput:

Public Types

enum class  TextMod { None = 0 , Translate = 1 << 0 }
 Enumeration for text modification options. More...
 

Public Member Functions

 AudioOutput (QObject *parent=nullptr)
 
 ~AudioOutput ()
 Destructor for the AudioOutput class.
 
void init (Fact *mutedFact)
 Initialize the Singleton.
 
bool isMuted () const
 
void setMuted (bool muted)
 
void say (const QString &text, TextMods textMods=TextMod::None)
 

Static Public Member Functions

static AudioOutputinstance ()
 

Detailed Description

The AudioOutput class provides functionality for audio output using text-to-speech.

Definition at line 13 of file AudioOutput.h.

Member Enumeration Documentation

◆ TextMod

enum class AudioOutput::TextMod
strong

Enumeration for text modification options.

Enumerator
None 
Translate 

Definition at line 21 of file AudioOutput.h.

Constructor & Destructor Documentation

◆ AudioOutput()

AudioOutput::AudioOutput ( QObject *  parent = nullptr)
explicit

Constructs an AudioOutput object.

Parameters
parentThe parent QObject.

Definition at line 37 of file AudioOutput.cc.

◆ ~AudioOutput()

AudioOutput::~AudioOutput ( )

Destructor for the AudioOutput class.

Definition at line 44 of file AudioOutput.cc.

Member Function Documentation

◆ init()

void AudioOutput::init ( Fact mutedFact)

Initialize the Singleton.

Definition at line 54 of file AudioOutput.cc.

References errorString, setMuted(), and Fact::valueChanged().

◆ instance()

AudioOutput * AudioOutput::instance ( )
static

Gets the singleton instance of AudioOutput.

Returns
The singleton instance.

Definition at line 49 of file AudioOutput.cc.

◆ isMuted()

bool AudioOutput::isMuted ( ) const
inline

Checks if the audio output is muted.

Returns
True if muted, false otherwise.

Definition at line 44 of file AudioOutput.h.

◆ say()

void AudioOutput::say ( const QString &  text,
TextMods  textMods = TextMod::None 
)

Reads the specified text with optional text modifications.

Parameters
textThe text to be read.
textModsThe text modifications to apply.

Definition at line 123 of file AudioOutput.cc.

References qgcApp, and Translate.

◆ setMuted()

void AudioOutput::setMuted ( bool  muted)

Sets the mute state of the audio output.

Parameters
enableTrue to mute, false to unmute.

Definition at line 115 of file AudioOutput.cc.

Referenced by init().


The documentation for this class was generated from the following files: