Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qgroundcontrol
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Valentin Platzgummer
qgroundcontrol
Commits
28a03325
Commit
28a03325
authored
5 years ago
by
Don Gagne
Browse files
Options
Downloads
Patches
Plain Diff
No speech during unit tests
parent
cf4fba04
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Audio/AudioOutput.cc
+16
-4
16 additions, 4 deletions
src/Audio/AudioOutput.cc
src/Audio/AudioOutput.h
+1
-1
1 addition, 1 deletion
src/Audio/AudioOutput.h
with
17 additions
and
5 deletions
src/Audio/AudioOutput.cc
+
16
−
4
View file @
28a03325
...
...
@@ -17,9 +17,17 @@
#include
"SettingsManager.h"
AudioOutput
::
AudioOutput
(
QGCApplication
*
app
,
QGCToolbox
*
toolbox
)
:
QGCTool
(
app
,
toolbox
)
,
_tts
(
new
QTextToSpeech
(
this
)
)
:
QGCTool
(
app
,
toolbox
)
,
_tts
(
nullptr
)
{
if
(
qgcApp
()
->
runningUnitTests
())
{
// Cloud based unit tests don't have speech capabilty. If you try to crank up
// speech engine it will pop a qWarning which prevents usage of QT_FATAL_WARNINGS
return
;
}
_tts
=
new
QTextToSpeech
(
this
);
//-- Force TTS engine to English as all incoming messages from the autopilot
// are in English and not localized.
#ifdef Q_OS_LINUX
...
...
@@ -28,8 +36,13 @@ AudioOutput::AudioOutput(QGCApplication* app, QGCToolbox* toolbox)
connect
(
_tts
,
&
QTextToSpeech
::
stateChanged
,
this
,
&
AudioOutput
::
_stateChanged
);
}
bool
AudioOutput
::
say
(
const
QString
&
inText
)
void
AudioOutput
::
say
(
const
QString
&
inText
)
{
if
(
!
_tts
)
{
qDebug
()
<<
"say"
<<
inText
;
return
;
}
bool
muted
=
qgcApp
()
->
toolbox
()
->
settingsManager
()
->
appSettings
()
->
audioMuted
()
->
rawValue
().
toBool
();
muted
|=
qgcApp
()
->
runningUnitTests
();
if
(
!
muted
&&
!
qgcApp
()
->
runningUnitTests
())
{
...
...
@@ -46,7 +59,6 @@ bool AudioOutput::say(const QString& inText)
_tts
->
say
(
text
);
}
}
return
true
;
}
void
AudioOutput
::
_stateChanged
(
QTextToSpeech
::
State
state
)
...
...
This diff is collapsed.
Click to expand it.
src/Audio/AudioOutput.h
+
1
−
1
View file @
28a03325
...
...
@@ -29,7 +29,7 @@ public:
static
QString
fixTextMessageForAudio
(
const
QString
&
string
);
public
slots
:
bool
say
(
const
QString
&
text
);
void
say
(
const
QString
&
text
);
private
slots
:
void
_stateChanged
(
QTextToSpeech
::
State
state
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment