Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
4abafb46
Commit
4abafb46
authored
Dec 09, 2014
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable tunes, allow to re-enable them with a simple define
parent
e2a75529
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
15 deletions
+23
-15
qgroundcontrol.pro
qgroundcontrol.pro
+5
-2
QGCAudioWorker.cpp
src/audio/QGCAudioWorker.cpp
+12
-5
QGCAudioWorker.h
src/audio/QGCAudioWorker.h
+6
-8
No files found.
qgroundcontrol.pro
View file @
4abafb46
...
...
@@ -111,8 +111,11 @@ QT += network \
serialport
\
sql
\
printsupport
\
quick
\
multimedia
quick
contains
(
DEFINES
,
QGC_NOTIFY_TUNES_ENABLED
)
{
QT
+=
multimedia
}
!
contains
(
DEFINES
,
DISABLE_GOOGLE_EARTH
)
{
QT
+=
webkit
webkitwidgets
...
...
src/audio/QGCAudioWorker.cpp
View file @
4abafb46
...
...
@@ -2,7 +2,6 @@
#include <QDebug>
#include <QCoreApplication>
#include <QFile>
#include <QSound>
#include "QGC.h"
#include "QGCAudioWorker.h"
...
...
@@ -28,12 +27,14 @@
QGCAudioWorker
::
QGCAudioWorker
(
QObject
*
parent
)
:
QObject
(
parent
),
voiceIndex
(
0
),
emergency
(
false
),
muted
(
false
),
#if defined _MSC_VER && defined QGC_SPEECH_ENABLED
pVoice
(
NULL
),
#endif
sound
(
NULL
)
#ifdef QGC_NOTIFY_TUNES_ENABLED
sound
(
NULL
),
#endif
emergency
(
false
),
muted
(
false
)
{
// Load settings
QSettings
settings
;
...
...
@@ -42,7 +43,9 @@ QGCAudioWorker::QGCAudioWorker(QObject *parent) :
void
QGCAudioWorker
::
init
()
{
sound
=
new
QSound
(
""
);
#ifdef QGC_NOTIFY_TUNES_ENABLED
sound
=
new
QSound
(
":/files/audio/alert.wav"
);
#endif
#if defined Q_OS_LINUX && defined QGC_SPEECH_ENABLED
espeak_Initialize
(
AUDIO_OUTPUT_SYNCH_PLAYBACK
,
500
,
NULL
,
0
);
// initialize for playback with 500ms buffer and no options (see speak_lib.h)
...
...
@@ -98,10 +101,12 @@ void QGCAudioWorker::say(QString text, int severity)
beep
();
}
#ifdef QGC_NOTIFY_TUNES_ENABLED
// Wait for the last sound to finish
while
(
!
sound
->
isFinished
())
{
QGC
::
SLEEP
::
msleep
(
100
);
}
#endif
#if defined _MSC_VER && defined QGC_SPEECH_ENABLED
pVoice
->
Speak
(
text
.
toStdWString
().
c_str
(),
SPF_DEFAULT
,
NULL
);
...
...
@@ -150,7 +155,9 @@ void QGCAudioWorker::beep()
if
(
!
muted
)
{
#ifdef QGC_NOTIFY_TUNES_ENABLED
sound
->
play
(
":/files/audio/alert.wav"
);
#endif
}
}
...
...
src/audio/QGCAudioWorker.h
View file @
4abafb46
...
...
@@ -3,7 +3,9 @@
#include <QObject>
#include <QTimer>
#ifdef QGC_NOTIFY_TUNES_ENABLED
#include <QSound>
#endif
/* For Snow leopard and later
#if defined Q_OS_MAC & defined QGC_SPEECH_ENABLED
...
...
@@ -38,20 +40,16 @@ public slots:
void
beep
();
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
int
voiceIndex
;
///< The index of the flite voice to use (awb, slt, rms)
#if defined _MSC_VER && defined QGC_SPEECH_ENABLED
ISpVoice
*
pVoice
;
#endif
int
voiceIndex
;
///< The index of the flite voice to use (awb, slt, rms)
#ifdef QGC_NOTIFY_TUNES_ENABLED
QSound
*
sound
;
#endif
bool
emergency
;
///< Emergency status flag
QTimer
*
emergencyTimer
;
bool
muted
;
QSound
*
sound
;
};
#endif // QGCAUDIOWORKER_H
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment